2

Can someone school me or point me to a resource where I can learn how to render the add-to-cart buttons for specific products on any page? I know how to get them in a view and I'm using Commerce Kickstart.

The goal is simple, for the slider, I'd like to include an add-to-cart button for the slideshow product in the slide itself. The slides are content but they're not controlled by a view as Commerce Kickstart has it's own module for the slideshow. Even if it were a view, I don't think it would help.

So is there a way to print out an add-to-cart (even in PHP) like finding the add-to-cart variable for a product by id or something and just rendering it? Thanks.

1

Solved: Experimenting I added a product variation field to the Slideshow content type. This essentially creates a new line item type but that's okay. I can now render the field in the view and it adds to the cart like it's supposed to. Just some CSS now and it will be just fine.

  • 1
    So one problem I found is that the Slideshow now becomes a product display so the content view will no longer display it when you go to admin/content and you cannot create a new slideshow unless you go to add products instead of add content. So you have to remove the filter "is a product display" from the content view or else you will never see the slideshow items. – o_O Nov 12 '12 at 4:57

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.