Copied to clipboard

Flag this post as spam?

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


  • Tobbe 62 posts 314 karma points c-trib
    1 week ago
    Tobbe
    0

    Access order in shipping calculator

    I just upgraded TC from 2.2.3 to 2.3.5. Earlier I did this:

    protected override decimal CalculatePrice(ShippingMethod shippingMethod, Currency currency, Order order)
    {    
         if (order.SubtotalPrice.WithVat >= 175)
         {
                    return 0M;
         }
    
         return base.CalculatePrice(shippingMethod, currency, order);
     }
    

    But now the signature has changed, so I cant access the order paramter?

    protected override Price CalculatePrice(ShippingMethod shippingMethod, Currency currency, long countryId, long? countryRegionId, VatRate vatRate)
    

    Is this not possible anymore or am I missing something?

  • Anders Burla Johansen 2455 posts 7781 karma points
    6 days ago
    Anders Burla Johansen
    100

    The shipping calculator still have this method in 2.3.5 you just need to inherit from ShippingCalculator and not just implement the interface.

    protected virtual Price CalculatePrice( ShippingMethod shippingMethod, Currency currency, Order order )
    

    Kind regards

    ANders

Please Sign in or register to post replies

Write your reply to:

Draft