Hi,

When you use display suite and change from node > manage display > basic layout to something else (for example "Fluid two column") "add to cart" doesn't show on the node anymore. How can you get this to "add to cart" on every layout? Should it be done via template.php or..?

Comments

Alex Dicianu’s picture

Hi,
I've checked and indeed the "Add to cart" does not appear in the list. It's actually a normal behavior because the button isn't a field and so it will not appear in the fields list. I will try to fix this for the next release.
Thanks.

kaizerking’s picture

use Renderable elements module you will get all the elements available

P.Selfin’s picture

use Renderable elements module you will get all the elements available

Thanks, but how to use?

kaizerking’s picture

There is link on the project page on how to use. one you enable it you get a link on every page , :manage display, which will register the form to mange the display, then it will be available in display suite and also on its own manage display which lists all the registered forms. registering means just enabling to manage

tomchy’s picture

Subscribe!
I don't find the Add to cart button in the renderable elements...

lolandese’s picture

The Renderable elements module didn't solve anything in my case. The "manage display" is shown only on forms, not on nodes.

Instead I used another workaround by creating a block View with only the Add to cart button as a field and the node ID as contextual filter. Remember to "Provide a default value" "when the filter value is not available" of the type "Content ID from URL".

After this create a custom Block field in DS using the block View you just created.

Thanks.

P.Selfin’s picture

Simple Solution
In Display Suite -> admin/structure/ds/fields > Add a code field >
<div class="basic-cart-add-to-cart-my"><a id="basic-cart-add-to-cart-link-my-[node:nid]" class="button basic-cart-add-to-cart-link-my" href="/cart/add/[node:nid]">Add to cart</a></div>
> Token - Toggle this checkbox if you are using tokens in this field.
And you have new field :)

lolandese’s picture

Status: Active » Fixed

#7 answers the question.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

zpolgar’s picture

#7 is partly ok, because the add to cart link don't appear in the right place. In DS the price field is before but when it shown "Add to cart" link is before Price field.

kerrycurtain’s picture

#7 worked for me but to get the button to actually add to the cart I did have to add the full site URL to the href like so...

href="http://www.mysite/cart/add/[node:nid]"