• Hi everyone,

    I would like to replace the add to cart buttons for my product pages in woocommerce to a button link pointing to a specific page. The tricky part is, I would like to customize each product URL as opposed to having all product links going to the same page. Any ideas how this can be accomplished?

    Thanks!
    Dan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    You need to override the add-to-cart templates to replace the button with your given link. For simple products you need to copy this template to your child theme and modify it as per your need.
    /wp-content/plugins/woocommerce/templates/single-product/add-to-cart/simple.php

    You also have access to the $product object inside this template so you can dynamically change your links depending on products.

    Thanks

    Thread Starter ddzc

    (@ddzc)

    Hi there! I don’t really have much coding experience or background. What exact coding is required?

    I found a solution on how to remove the add to cart button completely, but it also removes and breaks the “Make Offer” button, which I would like to keep in tact.

    Thanks!

    Okay, it’s breaking the make offer button because you removed the code to generate that.

    Try adding this code in your theme’s style.css file :

    .single_add_to_cart_button { display: none }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Replace Add to Cart button with Button Link’ is closed to new replies.