Skip to content

Instantly share code, notes, and snippets.

@pramodjodhani
Created June 24, 2024 07:28
Show Gist options
  • Save pramodjodhani/76fe6fb3b67d2a695f8c50df11f2b8c1 to your computer and use it in GitHub Desktop.
Save pramodjodhani/76fe6fb3b67d2a695f8c50df11f2b8c1 to your computer and use it in GitHub Desktop.
Iconic Product configurator - compatibility with Porto theme.
<?php
/**
* Iconic Product configurator - compatiblity with Porto theme.
*
* @return void
*/
function iconic_pc_disable_default_porto_filter() {
remove_filter( 'woocommerce_single_product_image_thumbnail_html', array( 'Iconic_PC_Product', 'single_product_image_thumbnail_html' ), 10, 2 );
}
add_action( 'init', 'iconic_pc_disable_default_porto_filter', 20 );
function iconic_pc_porto_modify_html_of_single_img( $html, $product_id ) {
global $jckpc;
ob_start();
$jckpc->display_product_image( $product_id );
return ob_get_clean();
}
add_filter( 'woocommerce_single_product_image_html', 'iconic_pc_porto_modify_html_of_single_img', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment