Copied to clipboard

Flag this post as spam?

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


  • Luke Alderton 192 posts 509 karma points
    Dec 07, 2012 @ 18:24
    Luke Alderton
    0

    Shipping by weight, product weight in order line

    Ive managed to get a simple shipping by weight feature added into the starter kit and its using default weight etc but I cant seem to add the product weight into the order line because this code:

    foreach (OrderLine ol in order.OrderLines)
                {
                    OrderLineProperty weightProp = ol.Properties.FirstOrDefault(p => p.Alias == "productWeight");
                    if (weightProp != null && !string.IsNullOrEmpty(weightProp.Value))
                    {
                        totalWeightInKg += (decimal)PriceHelper.ParsePrice(weightProp.Value.ToString());
                    }
                    else
                    {
                        totalWeightInKg += defaultWeightInKg;
                    }
                }

    returns null, any ideas or a small code snippet I could use to add my product weight to the order line before that is run?

     

    Thanks in advance.

  • Anders Burla 2560 posts 8256 karma points
    Dec 07, 2012 @ 19:05
    Anders Burla
    0

    Hi Luke

    To get the information from the Umbraco node and into the order line you need to login in to the Tea Commerce admin. In the general settings you have one called order line property alias. This is a comma seperated list of property aliases of the properties you want to copy from Umbraco to Tea Commerce order line.

    Kind regards
    Anders

  • Luke Alderton 192 posts 509 karma points
    Dec 10, 2012 @ 10:53
    Luke Alderton
    0

    Thanks, that worked! :)

  • rich hamilton 117 posts 136 karma points
    Feb 01, 2013 @ 17:12
    rich hamilton
    0

    Luke, I have been looking at your solution.

    How do you store the //Shipping Rules

    ?

  • Anders Burla 2560 posts 8256 karma points
    Feb 04, 2013 @ 07:10
    Anders Burla
    0

    Hi Rich

    You can just store them as Umbraco nodes and make up your own structure and document types. Then you can fetch the info from Umbraco and do the calculations.

    Kind regards
    Anders

  • Luke Alderton 192 posts 509 karma points
    Feb 04, 2013 @ 11:06
    Luke Alderton
    0

    As Anders stated, you can just do 'Shipping Rules' -> 'Shipping Rule' in your Content area.

Please Sign in or register to post replies

Write your reply to:

Draft