Hi,
I would like to add amount before my add to cart in a single product view-template. Is that possible?
Dear Marijke,
You can create a custom shortcode to call the woocommerce add-to-cart button. it includes a quantity selector. Add these lines to functions.php in your theme:
add_shortcode('my-addtocart', 'my_addtocart_shortcode');
function my_addtocart_shortcode($atts, $content = '') {
ob_start();
woocommerce_template_single_add_to_cart();
$out = ob_get_contents();
ob_end_clean();
return $out;
}
And now you can use the [my-addtocart] shortcode in your Content Template.
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
Tried the same approach and the buttons show's and works apart from the fact that it only adds the top most product on the list of products irrespective which product from the list i add. Thus the same product (1st product in list) gets added on instead of other chosen products....
hidden link
hi i'm trying to get this work on my page: hidden link
but its not showing up?