You need to adapt your individual theme files for the image URLs to be changed to Cloudimage URLs. Identify first which theme files are used by your shop and edit them one by one as detailled below.
Backup your theme files. Before making changes in these files, it is recommended that you download and save them securely to be able to restore them later in case of error.
Here are a couple of examples indicating the change that needs to be made in the theme files. You can follow similar steps to change all of your theme files.
List of some files that need to be changed (files may vary between themes):
featured-product.liquid
product-template.liquid
collection-grid-item.liquid
Product-grid-item.liquid
header.liquid
video.liquid
As general what you need to do is:
assign new variable inheriting the original theme image url
replace the old image invocation with inclusion of cloudimage
Example 1
You can make the changes inside product-template.liquid.
Explained changes:
We assign new variables for every URL usage from the original theme file (visible above)
using
{% assign meaningfull_name = the_entire_value_used_in_the_original_request %}
For example: src="{{ image | img_url: '200x200' }}"
we create new variable that equals the old src "image | img_url: '200x200'"
{% assign old_img_src = image | img_url: '200x200' %}
Now we replace the src="{{ image | img_url: '200x200' }}" with src="{% include 'cloudimage' src:old_img_src %}"
Where wi replace the old value with {% include 'cloudimage' src:the_meaningful_name_we_assign_before_that %}-
This way we get the chance to switch between the original image path and the optimised one by using the implemented Cloudimage enable/disable option
Now we need to perform this change in all files that deliver image URLs being src, data-src, background-image, zoom-image