Created
June 24, 2024 07:28
-
-
Save pramodjodhani/76fe6fb3b67d2a695f8c50df11f2b8c1 to your computer and use it in GitHub Desktop.
Iconic Product configurator - compatibility with Porto theme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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