Porto theme compatibility fix

You are here:
← All Topics

This article belongs to our WooCommerce Multiple Images per Variation plugin.

Porto theme has a custom structure. Its very difficult to make both compatible. so far we managed to find a workaround.

Under wp-content/themes/porto/woocommerce/single-product/

rename these two files

product-image.php

product-thumbnails.php to some other names like

product-image2.php

product-thumbnails2.php

Then use this custom js code.

jQuery( document ).ready( function( $ ) {
$(document).on("click",".attachment-shop_single",function() {
       var src = $(this).attr("src");
       
       $('li.woocommerce-product-gallery__image:first-child .attachment-shop_single').attr("src",src);
       $(this).addClass("wmvi-selected");
    });
});

use this plugin to insert custom js code

https://wordpress.org/plugins/custom-css-js/

This may affect existing functionality . you can anytime rename files back to original name and remove inserted js code.