Developer forum

Forum » Development » cart

Reply

Hi!

 

Is there a way to allready have a shopping cart filled with one product? I'm working on a site with only one product, and I don't see the point of having an extra click. I wanna be able to go in to a page showing the basket with the product allready in place.

 

Thanks,

Christopher


Replies

 
Reply

Try

 

 

Dynamicweb.eCommerce.Products.

Product product = new Dynamicweb.eCommerce.Products.Product("ProductID");Order order =Dynamicweb.eCommerce.Common.Context.Cart;

 

Dynamicweb.eCommerce.Orders.

order.Products.Add(product);

 
Reply

Sooo.. I need Developer to make my wish come true?

 
Reply

Well, you posted this in a developer forum, so I assumed you were looking for some custom code. You could also take a look at a standard form for adding a product to the basket. Simulate that using Javascript so it appears that the product is automatically in the basket.

 
Reply

Thanks!

 

Where should I post this kind of question?

 
Reply

Actually I did not quite understand

 

"You could also take a look at a standard form for adding a product to the basket. Simulate that using Javascript so it appears that the product is automatically in the basket."

 

I want to just have a menu point with the text "kjøp". When you click the menu point I want to show the basket allredy containing the product.

 
Reply

You have to add the product to the basket first, which the standard product template is capable of when a user presses to "Add to basket" link. So my suggestion is to look at what happens when a user clicks the link and invoke that event using Javascript.

 

You must be logged in to post in the forum