Support » Theme: Customizr » ADD SECOND add to cart BUTTON at bottom of products pages ?

  • hello,

    How can I add a second ADD TO CART button ?

    I found this but the code is not working and I do not want to install a plugin:
    https://stackoverflow.com/questions/41797697/how-to-add-a-second-add-to-cart-button-on-woocommerce

    
    add_action( 'woocommerce_single_product_summary', 'my_extra_button_on_product_page', 30 );
    
    function my_extra_button_on_product_page() {
      global $product;
      echo '<a href="URL">Add to cart</a>';
    }
    

    and

    
    add_action( 'woocommerce_single_product_summary', 'custom_button_after_product_summary', 30 );
    
    function custom_button_after_product_summary() {
      global $product;
      echo "<a href='".$product->add_to_cart_url()."'>add to cart</a>";
    }
    

    Thank you so much for your help.

Viewing 1 replies (of 1 total)
  • Hi there,
    tried the second snippet on my side and it works fine.
    Anyway the “woocommerce_singe_product_summary” is a WooCommerce hook, and since this theme doesn’t override the woocommerce templates, you better ask on the WooCommerce support forum.

    Hope this helps 😉

Viewing 1 replies (of 1 total)
  • The topic ‘ADD SECOND add to cart BUTTON at bottom of products pages ?’ is closed to new replies.