Copied to clipboard

Flag this post as spam?

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

  • MB 271 posts 934 karma points
    Feb 06, 2019 @ 14:50

    Adding product name to orderline along with variant name

    I'm using Umbraco 7.11.1 with Tea Commerce 3.2.4

    Hi guys,

    I'm working on implementing variants on a shop but another little challenge has arise.

    When adding a product with a variant to the basket, it cannot find the product name, only the variant name.

    This is likely because I don't use the property productName but rather the page title. Is it possible to implement a fallback so the page title of the product is used, rather than a property entitled productName?

    // Mike

  • Matt Brailsford 4099 posts 22021 karma points MVP 9x c-trib
    Feb 06, 2019 @ 15:02
    Matt Brailsford

    Hi Mike,

    Hmm, this should actually be how this works. It's the product information extractor that is in control of pulling out the product information and it does already have this fallback:

  • Matt Brailsford 4099 posts 22021 karma points MVP 9x c-trib
    Feb 06, 2019 @ 15:07
    Matt Brailsford

    Ahh, are you saying it's showing the variant name and not the master product name?

    If so, you might want to add the master product name as an OrderLineProperty (see docs here on how to do it: the second example is passing some properties to the orderline) then update your cart to display the orderlines master product name, rather than the variant name.

    Hope this helps


  • MB 271 posts 934 karma points
    Feb 06, 2019 @ 15:54

    Matt.. It's getting increasingly embarrassing seeing your name with a solution in every post I make....

    It works as a CHARM! For those in my shoes, here's the solution:

    First: Add the correct input fields on your product page, here's an example of my code:

        <form method="post" action="/base/TC/FormPost.aspx" class="ajaxForm" data-product-id="@productPage.Id">
                        <input name="AddOrUpdateOrderLine" value="productIdentifier, quantity, properties" type="hidden" />
                        <input name="storeId" value="@storeId" type="hidden" />
                        <input name="productIdentifier" value="@productPage.Id" type="hidden" />
                        <input name="quantity" value="1" type="hidden" />
                        @* Below are my two custom fields *@
                        <input name="productNameInput" value="@CurrentPage.Name" type="hidden" />
                        <input name="properties" value="productNameInput" type="hidden" />

    Second: Go to your shopping cart and add the following line to display the custom property:


    REMEMBER: You'd probably like to add the Master Product Name to these places as well:

    • Edit-order.cshtml
    • email-template-confirmation.cshtml
    • Cartstep1.cshtml
    • Cartstep4.cshtml
    • Cartstep5

    Voila, works like a charm!

    Thank you Matt for the solution

    // Mike

  • Matt Brailsford 4099 posts 22021 karma points MVP 9x c-trib
    Feb 06, 2019 @ 16:04
    Matt Brailsford

    Hehe, it's my job 😁

    Glad you got it working. And thanks again for sharing the full solution 👍


Please Sign in or register to post replies

Write your reply to: