Creating a new shipping method

From VYRE

Jump to: navigation, search

Shipping methods specify the rules that you might want to apply when selling items. For example your shipping costs model might be that any orders outside UK will pay a flat fee of £50, UK orders for £50 or less will pay a flat fee of £5 and UK orders for more than £50 will pay 10% of subtotal.

The cost calculation is written in velocity as follows:

#if ( $order.getShippingAddress() && !($order.getShippingAddress().getCountry() == "UK") )
    $vyre.returnValue("20.00")
#elseif ( $comp.lessThan($order.getSubtotal(), "50"))
    $vyre.returnValue("50.00")
#else
    $vyre.returnValue($math.mul($order.getSubtotal(), "0.10"))
#end
Personal tools