Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WooCommerce - make shop and catalogue images link straight to cart
- // code goes in functions.php for your child theme
- remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
- add_action( 'woocommerce_before_shop_loop_item', 'my_loop_open', 10);
- function my_loop_open() {
- $cart_link = 'http://www.topcode.co.uk/solar_active/shop/cart/?add-to-cart='.get_the_ID();
- echo '<a href="' . $cart_link . '" class="woocommerce-LoopProduct-link">';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement