2

Where in the Panels "add content" list can I find the "add to cart" button?

So far I can only add it via node / node content =

enter image description here

but this prints node title + body text + add to cart as opposed to just add to cart - here is the node content panel with a cyan border:

enter image description here

How can I add just the "add to cart" button without the other stuff?

Thanks...

5

The "Add to Cart Form" is not available directly from Panels. You need to create a view to load the Add to Cart Form and then display that view in the panel. When creating the view you have total control over what you want to display or not display.

Panels is a way to put other Drupal content constructs together, first you have to build the constructs to hold the content though...

4

You need to show the Product reference field (in the "node" section) and use the formatter as "Add to cart" form.

  • This should be the accepted answer. You don't need views to display the Add to cart button. You just need to go Add content (on your panels page) -> node -> Field: Product reference field. Then set the format to be Add to cart form. – Teegan Feb 11 '16 at 3:43
  • This is the correct answer! For me the field was called "Product variations". – andrbmgi Oct 21 '16 at 10:39
  • This is perfect answer, this helps adding field as "Attribute selection widget" to the panels as well. – Tanvir Ahmad Jan 14 '17 at 16:06
0

I spent a lot of time figuring out how to create an ad to cart button in my custom panel node of product, but finally I have found a simple way.

  1. I am not using teaser view of nodes, I use views and panels everywhere. So I configure the teaser view of node - so I hid everything except the price field.

  2. In panels module I add content entity - Rendered Node at the settings a choose the teaser View mode and nearly that's it. But at the teaser mode there is the header and read more link what I do not need at all.

  3. At your theme you need to find the node--teaser.tpl.php usually at the templates directory an erase the header and the read more link.

And that's all, you have a ad to cart button where ever you want :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.