I'm trying to get prices for each variant (8GB, 16GB, 32GB etc.) on the same product.
I have set the price in the variant editor as a price attribute but I do not know how to get the value.
Hello again, not sure if I should start a new topic or continue this one, but here goes!
I'm going to have three different prices depending on the quantity.
Is this possible and if so, how? :)
Do I create three properties(price 1, price 2, price 3) in the Variant-document type?
In currency-setting there is a field for the property alias for the price. Is it possible to add more aliases or should I use, for example, variant.getPropertyValue("price2")?
In that case you should use the marketing system to calculate your prices. That way the discount will automatically be calculated when the order lines are updated in the cart.
If the setup is advanced you can make your own rules and/or awards. In your case a rule will probably be just fine. Check out the open source part of Tea Commerce on github to see how to do that:
https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/master/Source/TeaCommerce.Umbraco.Application/Marketing/Rules/ProductRule
https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/master/Source/TeaCommerce.Umbraco.Configuration/Marketing/Models
The product in the frontend should then somehow explain how to get a cheaper price. How you show that is your "problem" depending on the case.
Thanks for the info, I just heard that it will be three different hardcoded prices. Is this possible or should I use the marketing system anyway? Different products will have different thresholds(1-25 qty, 1-40 qty, etc)
With that you get to choose the price that is set on the individual order line. You would then have to save the three prices as order line properties and then choose the correct price each time the order is recalculated.
Use the "Product property aliases" setting on the store to automatically save the product properties to the order line.
The product variants I have is a combination of colors and size for USB-sticks.
The problem is they have a lot of colors and sizes, it will be cumbersome to specify the price on all the combinations (example, blue - 16gb, red - 16gb, green - 16gb, green - 32gb, yellow 32gb etc.)
Can I specify the prices so the prices only shows up on the variant sizes of the products? Should I do it on the product itself and specify prices for the sizes (and the quantity price, as there will be different prices for quantity as well) or do you have a better idea how to solve it?
Variant Prices on product page
Hello!
I'm trying to get prices for each variant (8GB, 16GB, 32GB etc.) on the same product. I have set the price in the variant editor as a price attribute but I do not know how to get the value.
Thanks in advance!
/Jim
UPDATE: It is actually supported. Se next answer.
Hi Jim,
That's a pretty important feature, and I can see that we actually does not allow you to fetch a price for a specific variant.
It works when you add the variant to the cart, but the GetPrice method of TC does not let you send a variantId along.
We need to fix that fast. I will take a look at it today and get back to you!
/Rune
Hi Rune,
Thanks for looking into it!
/Jim
Ah. I was too fast. It is actually supported, but the documentation was not showing how to do it. So don't mind my previous answer.
I have updated the documentation with an example of fetching prices for variants. https://documentation.teacommerce.net/razor-api/price/getprice/
/Rune
Hello again, not sure if I should start a new topic or continue this one, but here goes!
I'm going to have three different prices depending on the quantity. Is this possible and if so, how? :) Do I create three properties(price 1, price 2, price 3) in the Variant-document type?
In currency-setting there is a field for the property alias for the price. Is it possible to add more aliases or should I use, for example, variant.getPropertyValue("price2")?
Thanks! :)
/Jim
In that case you should use the marketing system to calculate your prices. That way the discount will automatically be calculated when the order lines are updated in the cart. If the setup is advanced you can make your own rules and/or awards. In your case a rule will probably be just fine. Check out the open source part of Tea Commerce on github to see how to do that: https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/master/Source/TeaCommerce.Umbraco.Application/Marketing/Rules/ProductRule https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/master/Source/TeaCommerce.Umbraco.Configuration/Marketing/Models
The product in the frontend should then somehow explain how to get a cheaper price. How you show that is your "problem" depending on the case.
/Rune
Thanks for the info, I just heard that it will be three different hardcoded prices. Is this possible or should I use the marketing system anyway? Different products will have different thresholds(1-25 qty, 1-40 qty, etc)
/Jim
Then you might want to build an order line price calculator instead: https://documentation.teacommerce.net/net-api/price-calculators/order-line-calculator/
With that you get to choose the price that is set on the individual order line. You would then have to save the three prices as order line properties and then choose the correct price each time the order is recalculated. Use the "Product property aliases" setting on the store to automatically save the product properties to the order line.
/Rune
You really are a lifesaver! Thanks for the information. Have a good day!
/Jim
Hello again!
The product variants I have is a combination of colors and size for USB-sticks. The problem is they have a lot of colors and sizes, it will be cumbersome to specify the price on all the combinations (example, blue - 16gb, red - 16gb, green - 16gb, green - 32gb, yellow 32gb etc.)
Can I specify the prices so the prices only shows up on the variant sizes of the products? Should I do it on the product itself and specify prices for the sizes (and the quantity price, as there will be different prices for quantity as well) or do you have a better idea how to solve it?
Many thanks,
/Jim
Hi Jim,
You are getting into some more advanced stuff now. I'm sure you can do it in one of two ways:
Maybe set the prices on the Size variant node and then make a Custom product information extractor to fetch the price. You should override the GetOriginalUnitPrices and the GetSnapshot methods: https://documentation.teacommerce.net/net-api/product-information-extractor/
The Tea Commerce For Umbraco 7 code is open source. So you could change the angular code and markup for the product variant property editor.
Lastly you could sign up for the Tea Commerce confidence program to get extra help with your project: https://teacommerce.net/products/confidence/
/Rune
Okay, thanks a lot for the fast answer! :)
Have a good day!
/Jim
No problem. Please flag the correct answer for others to see, when you have got it working.
/Rune
is working on a reply...