G
G
Grizar2021-02-17 02:23:19
WordPress
Grizar, 2021-02-17 02:23:19

How to add a duplicate button to the cart?

I have a WordPress site with WooCommerce.
I want to make a buy button sticky at the bottom of the page in the product card.
I thought that you can do it with a hook, display a duplicate of the button and stick it at the bottom using css.
I use it

add_action( 'woocommerce_single_product_summary', 'woocommerce_template_add_to_cart', 20);
but the duplicate does not appear,
THEN DISPLAYS THE DOUBLE IN THE LIST and it is necessary in the product card
add_action( 'after_setup_theme', 'lets_add_cart_button' );
function lets_add_cart_button() {
  add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 20 );
}

can someone tell me how to display a duplicate of the BUY button? (ONLY IN THE PRODUCT CARD)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question