Skip Navigation

[Résolu] wpv-wooaddcart amount

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 4 réponses, has 4 voix.

Last updated by gabriels-2 Il y a 7 années et 2 mois.

Assigned support staff: Caridad.

Auteur
Publications
#96347

Hi,

I would like to add amount before my add to cart in a single product view-template. Is that possible?

#96550

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

#96716

Wow, yess it worked!

Thank you very much.

#127454

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

#227239

hi i'm trying to get this work on my page: hidden link
but its not showing up?