Tryng to imoplement a relatively simple shop using pure razor and struggling on a few elements such as adding a product to the basket with selected properties e.g. size and colour and then initiating the checkout process. Is the reference store now available?
The Razor store will be released for Umbraco 5 only.
You can add the product like you would any product and then copy custom props to the order line afterwards.
To add a product to the cart you can use the following code:
var purchaseOrder = SiteContext.Current.OrderContext.GetBasket().PurchaseOrder; var orderLine = purchaseOrder.AddProduct(myProduct); foreach(var property in product.ProductProperties) orderLine[property.ProductDefinitionField.Name] = property.Value; purchaserOrder.Save();
That should be the gist of it. Will copy all custom product properties to the order line. You could do a pipeline for it as well if you don't want the code in your UI layer.
Razor Reference Store
Tryng to imoplement a relatively simple shop using pure razor and struggling on a few elements such as adding a product to the basket with selected properties e.g. size and colour and then initiating the checkout process. Is the reference store now available?
Thanks, Simon
Hi Simon,
The Razor store will be released for Umbraco 5 only.
You can add the product like you would any product and then copy custom props to the order line afterwards.
To add a product to the cart you can use the following code:
That should be the gist of it. Will copy all custom product properties to the order line. You could do a pipeline for it as well if you don't want the code in your UI layer.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.