Developer forum

Forum » Rapido » Rapido, Cart - Custom Product Fields

Rapido, Cart - Custom Product Fields

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

In Rapido, the content for the cart comes from a Json feed and the json feed is produced by a paragraph with a ParagraphViewModel. 

Like this: @Model.GetModuleOutput()

That feed does not seem to output for example custom fields for products that are in the cart. 

What would be the correct "Rapido"-way to get access to product fields for the products in the cart? 

Regards / Aki


Replies

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply
This post has been marked as an answer

Hi Aki

You will have to add them by yourself. It should be quite easy. First you may want to read the chapter about designing the json feeds on Rapido http://doc.dynamicweb.com/downloads/rapido#sideNavTitle1-4-1-5 

Then go to the JSON feed template (Templates/Designs/Rapido/Json/eCom7/CartV2/Cart.cshtml) 
- Update the model (OrderLine) in the top, to add those new properties you want.
- Then further down in the feed template, where we work with orderlines, combine the new properties with the data you want from Dynamicweb by using TemplateTags. Like you can see the others are made.
- Then in the cart template that renders it all (Templates/Designs/Rapido/eCom7/CartV2/Cart.cshtml), locate the script template that should render the new properties and make the markup as you want it, and use mustache tags to attach the data. Like this {{myCustomProductField}}

It is really easy and fast to to, once you get the hang of it.

Votes for this answer: 2
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Karsten,

Thanks for the pointers. I am starting to get the hanf of it. :)

Regards / Aki

 
Jens Mouritzen
Jens Mouritzen
Reply

Hi guys

I followed the best practice (and the above guide) and got it working. But the data submitted in the fields on the cart, does not show on the orders? What could this be?

 
Nicolai Pedersen
Reply

Ok, then you probably have made something wrong...

 

You must be logged in to post in the forum