Replies: 0
Hi,
I’m trying to add a secondary ‘add to cart’ button.
On the site we also use the Fancy product designer plugin + multistep plugin Which has an option to hide the add to cart button untill the product is customized -> we use this option, as not all customers are called ‘Your name here’ and disables it untill all steps are done (pick colour, pick size etc.).
But, with the product images, the description, the custmizer + multistep options (from the plugin) The page is quite long on desktop, and ofc. even longer on other devices. So we want to have a Add to card button on the default location, near the top as part of the ‘woocommerce_single_product_summary’ hook.
The secondary button I would like to add in between the data tabs and the upsell items. Both part of the ‘woocommerce_after_single_product_summary’ hook, on 10 and 15
We already added the fancy product designer hook to position 11.
So I was trying to add the cart to position 12 with this:
add_action( 'woocommerce_after_single_product_summary', 'customcartlokatie', 12 );
function customcartlokatie(){
echo 'Here!';
do_action('woocommerce_template_single_add_to_cart');
}
But it only echos ‘Here!’, and no 2nd cart is showing up. Can you not use the action a second time (As it is already part of the woocommerce_single_product_summary)? Or am I using this wrong.