Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ben-heath/f5e6aa0330682f47f7867c46e960d0e3 to your computer and use it in GitHub Desktop.
Save ben-heath/f5e6aa0330682f47f7867c46e960d0e3 to your computer and use it in GitHub Desktop.
Respondo Pro Removal of /woocommerce/single-product/product-image.php file and content-product.php file
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
add_action( 'woocommerce_before_shop_loop_item_title', 'sls_woocommerce_template_loop_product_thumbnail', 10 );
function sls_woocommerce_template_loop_product_thumbnail() {
echo '<a class="thumbnail" title="'.get_the_title().'" href="'. get_the_permalink() . '">'.woocommerce_get_product_thumbnail().'</a>';
echo '<h3><a href="'.get_the_permalink().'">'.get_the_title().'</a></h3>';
}
add_filter( 'woocommerce_single_product_image_html', 'custom_woocommerce_single_product_image_html', 10, 2 );
function custom_woocommerce_single_product_image_html( $html, $post_id ) {
// do something to $html here
$html2 = '<script type="text/javascript">jQuery("a.woocommerce-main-image.zoom").addClass("thumbnail");</script>';
return $html . $html2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment