Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jim 22 posts 163 karma points
    May 09, 2016 @ 07:56
    Jim
    0

    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

  • Rune Grønkjær 1372 posts 3103 karma points
    May 09, 2016 @ 08:29
    Rune Grønkjær
    0

    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

  • Jim 22 posts 163 karma points
    May 09, 2016 @ 08:48
    Jim
    0

    Hi Rune,

    Thanks for looking into it!

    /Jim

  • Rune Grønkjær 1372 posts 3103 karma points
    May 09, 2016 @ 08:54
    Rune Grønkjær
    100

    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

  • Jim 22 posts 163 karma points
    May 09, 2016 @ 11:08
    Jim
    0

    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

  • Rune Grønkjær 1372 posts 3103 karma points
    May 09, 2016 @ 11:27
    Rune Grønkjær
    0

    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

  • Jim 22 posts 163 karma points
    May 09, 2016 @ 12:38
    Jim
    0

    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

  • Rune Grønkjær 1372 posts 3103 karma points
    May 09, 2016 @ 13:46
    Rune Grønkjær
    0

    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

  • Jim 22 posts 163 karma points
    May 09, 2016 @ 13:48
    Jim
    0

    You really are a lifesaver! Thanks for the information. Have a good day!

    /Jim

  • Jim 22 posts 163 karma points
    May 13, 2016 @ 05:22
    Jim
    0

    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

  • Rune Grønkjær 1372 posts 3103 karma points
    May 13, 2016 @ 06:27
    Rune Grønkjær
    0

    Hi Jim,

    You are getting into some more advanced stuff now. I'm sure you can do it in one of two ways:

    1. 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/

    2. 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

  • Jim 22 posts 163 karma points
    May 09, 2016 @ 08:57
    Jim
    0

    Okay, thanks a lot for the fast answer! :)

    Have a good day!

    /Jim

  • Rune Grønkjær 1372 posts 3103 karma points
    May 09, 2016 @ 08:58
    Rune Grønkjær
    0

    No problem. Please flag the correct answer for others to see, when you have got it working.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft