ccarmstrong
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] WooCommerce product images link to external URL?While I wasn’t able to find help here, I did find help elsewhere and got it resolved for the product catalog images. I added this to code snippets and product catalog images link to an external URL and open in a new tab.
remove_action(‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’);
add_action(‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_template_loop_product_link_open’, 15);add_action(‘woocommerce_before_shop_loop_item’, ‘woocommerce_add_aff_link_open’, 10);
add_action(‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_add_aff_link_close’, 10);function woocommerce_add_aff_link_open(){
$product = wc_get_product(get_the_ID());
if( $product->is_type( ‘external’ ) )
echo ‘get_product_url() . ‘” class=”woocommerce-LoopProductImage-link” target=”_blank”>’;
}function woocommerce_add_aff_link_close(){
$product = wc_get_product(get_the_ID());
if( $product->is_type( ‘external’ ) )
echo ‘‘;
}Forum: Plugins
In reply to: [WooCommerce] WooCommerce product images link to external URL?It didn’t work for long and I still don’t have a solution. Sorry.
Forum: Plugins
In reply to: [WooCommerce] WooCommerce product images link to external URL?UPDATE: I resolved the first issue myself, but have not been able to figure out the second. On the single product page, I’d like to have the image lead to an external URL and do away with the lightbox/zoom features.