Copied to clipboard

Flag this post as spam?

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


  • Puck Holshuijsen 90 posts 352 karma points
    Jul 05, 2017 @ 14:02
    Puck Holshuijsen
    0

    Hardcoded text problems for my dutch webshop

    Hi Guys,

    I got 2 little issues with some hardcoded text (as seen in the screenshot). enter image description here

    My whole webshop is in Dutch, except these two labels. I just want them to show the name of the shipment (PostNL in this case) and for Tax I want it to show 6% and not Netherlands.

    I found out that the shipment line is being set inside the merchello core

      public static string ShipmentLineItemName(this IShipmentRateQuote shipmentRateQuote)
            {
                return string.Format("Shipment - {0} - {1} items", shipmentRateQuote.ShipMethod.Name, shipmentRateQuote.Shipment.Items.Count);
            }
    

    And for the Tax i think it is inside this one

     public static T AsLineItemOf<T>(this ITaxCalculationResult taxCalculationResult) where T : LineItemBase
            {
                var ctrValues = new object[]
                {
                    EnumTypeFieldConverter.LineItemType.Tax.TypeKey,
                    taxCalculationResult.Name,
                    "Tax", // TODO this may not e unqiue (SKU),
                    1,
                    taxCalculationResult.TaxAmount,
                    taxCalculationResult.ExtendedData
                };
    
                var attempt = ActivatorHelper.CreateInstance<LineItemBase>(typeof(T), ctrValues);
    
                if (attempt.Success) return attempt.Result as T;
    
                MultiLogHelper.Error<ILineItem>("Failed instiating a line item from invoiceTaxResult", attempt.Exception);
    
                throw attempt.Exception;
            }
    

    Is there an easy way to translate this, and change the way the tax name is set?

    Thanks!

    Puck

  • Tom Madden 205 posts 272 karma points c-trib
    Jul 25, 2017 @ 14:42
    Tom Madden
    0

    Just came across the same issue. I was looking to display just the delivery method, 'Royal Mail' in my case, and not 'Shipment - Royal Mail - 1 items'

    Maybe it would be better if only the ShipMethod Name was stored as the ShipmentLineItemName, which makes this method redundant, then we could display it any way we want.

    Or, if there was a way to override this without changing the core of Merchello?

    /t

  • Puck Holshuijsen 90 posts 352 karma points
    Aug 02, 2017 @ 07:25
    Puck Holshuijsen
    0

    Yeah haven't figured the overriding part out yet. Tried that before i posted this issue

  • Michael Griffith 9 posts 79 karma points
    Jul 25, 2017 @ 18:33
    Michael Griffith
    0

    You should be able to modify the view to change that line or parse over it before posting it. I believe the view is InvoiceSummary?

  • Puck Holshuijsen 90 posts 352 karma points
    Aug 02, 2017 @ 07:34
    Puck Holshuijsen
    0

    I'm with Tom on this part. It will probably change in the (near) future, so it will break if we parse it.

  • Tom Madden 205 posts 272 karma points c-trib
    Jul 25, 2017 @ 20:09
    Tom Madden
    0

    Yes, but parsing it feels messy and if that text changes in future could break. It doesn't feel right to be hard coded and stored in the line item in the first place, imho

    /t

Please Sign in or register to post replies

Write your reply to:

Draft