Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
First time using Tea Commerce. I am trying to add different extra prices to a product depending on what a customer choses in fx size, color etc. the prices come from going through different pages picking something on each page, eventually ending up on an overview page where each product has its own form, but i cant seem to acces the forms on the basketpage with Request.Form. the product itself with its starting price is in the basket.
ex. var colorprice = Convert.ToInt32(Request.Form["colorprice"]);
var colorprice = Convert.ToInt32(Request.Form["colorprice"]);
becomes an empty variable.
One way is to use the variants system in Tea Commerce. Each variant can be comprised of both size, color and whatever you need.
In Umbraco you can add a price to each variant.
In your frontend you will let the user choose the size, color etc. and the in the end you add the corresponding variant to the cart.
Check out the variant system here:
If you need each color and size to have it's own price, that needs to be added to the total unitprice of the product/order line you can do this:
- Add the price to the color and size document types (Again see the demo to find the variant groups).
- After that you just need to build a custom order line calculator to calculate the price from the prices on the product and the variant groups:
Hope this helps
I've got the total variantprice, but i get an error trying to add it up with the unitprice
Operator '+' cannot be applied to operands of type 'TeaCommerce.Api.Models.Price' and 'int
Converting the unitprice to int also makes an error.
What did you end up trying to do? You're not giving me a lot to work with :)
I've got the unitprice from the nodeid. bprice is the extras prices that needs to be added to the unitprice and placed in the basket. bprice is the full price of all the extras prices. But when attempting to do so, we get beforementioned error. code here:
@(orderLine.UnitPrice + Convert.ToInt32(bprice))
The Price object cannot be calculated as it's not a number. The price object have several version of the price with and without VAT. You should use Visual Studios code completion to find the value on the Price you need for the job you are trying to accomplish.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted