fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

how modify

raffaele ficco

it’s possible to modify by ourselves the template’s files ? this one:  /templates/variation-template.php

Hakik Zaman

Hi raffaele,

Thanks for reaching out to us. Can you please explain a bit more about your goal?

Which part do you want to customize? Hope to hear from you soon.

Thank You

raffaele ficco

we would to modify the template’s files who generate your plugin without modify source code.

 

Hakik Zaman

Hi raffaele,

Our premium (Variation Swatches for WooCommerce Pro) version only generates the template file- variable.php

You can add your template by adding a folder called woo-variation-swatches inside your current theme.

Here is a screenshot for a better understanding: https://i.imgur.com/uXzLG79.png. It will be applied on the shop/archive page.

To modify the markup of Buttons, Images, Radio, and Color Swatches. You have to modify it using filter hooks.

Button Filter: woo_variation_swatches_button_attribute_template

Image Filter: woo_variation_swatches_image_attribute_template

Radio Filter: woo_variation_swatches_color_attribute_template

Color Filter: woo_variation_swatches_color_attribute_template

You can check more filters here:

woo-variation-swatches > includes > class-woo-variation-swatches-product-page.php

You can use the above filters to modify swatches as you want inside your current theme’s functions.php file.

Note: It is recommended to add the Custom Code to the child theme’s functions.php file, to avoid any data loss while updating the Parent Theme.

Thank You