0

I have created a new content type with product title, description, price(field_price), SKU(field_sku) fields. I just want to add a Add to cart button into this content type.

What I tried? I have read many places, it says to add 'Product references'. I have tried to do that using 'Entity reference' field and selected 'Product'. But no luck.

Can someone guide me step by step about how can we add such 'Add to cart' button in custom content type?

1

Follow below steps to show Add to cart button into any content type.

  1. Add field with reference as Product and select list of product bundles you want to show in content type.
  2. And in field settings select reference as shown in below. enter image description here
  3. Go to content type manage display and select as "Rendered Entity" as shown below. enter image description here
  4. Go to the product type which you selected in content type and click on manage display.
  5. See for variations and select as "Add to cart form" as shown in below. enter image description here

And that's it after adding node with product you will be able to see the Add to cart button into node view like below.

enter image description here

  • Thank you!, Now I am getting 'Add to cart' button. But I should able to add price while creating the node. Now price is getting from the product page and cannot add price while creating the node. Basically every node should act as product with different price. – shanidkv Nov 7 '17 at 5:13
  • For single product you want different prices to display in each node? – Ajay Reddy Nov 7 '17 at 6:04
  • Each node different prices. For example: I have a content type 'Toys'. I have to create many Toys contents with different price and other details. – shanidkv Nov 7 '17 at 6:06
  • You have to add "Product Variations" for this to each product. Cannot add the price for each node. – Ajay Reddy Nov 7 '17 at 6:08
  • Ok, I don't want any predefined prices. Price should be always free text. Any options for this? – shanidkv Nov 7 '17 at 6:10

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.