Answer the question
In order to leave comments, you need to log in
Two add to cart buttons on WooCommerce?
At the moment, the product card looks like
Answer the question
In order to leave comments, you need to log in
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>';
}
Why so?
You can set your own price for each option
. And by choosing a variation, the user will select the quantity of this type of product at the corresponding price.
I think it's easier to use the built-in way of product variabilitytyts
detailed guide
Displaying the price is provided, as well as changing the content
And if you absolutely need two buttons, then instead of the standard display of the list, display product variations with a "buy" link to each option
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question