Copied to clipboard

Flag this post as spam?

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


  • Tobbe 81 posts 387 karma points c-trib
    Apr 21, 2017 @ 13:17
    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 2560 posts 8256 karma points
    Apr 24, 2017 @ 07:07
    Anders Burla
    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