6

In shipping methods, is it possible to setup zones? For example rather that setting up a separate method for ever country in Europe, can I create a single shipping method for Europe and add in the European countries?

Thanks as always!

1 Answer 1

5

It's not possible to do using the CP. However, it's possible to write a simple shipping plugin, and group your shipping rules for various countries.

For example, you could put this into a file named store/libraries/store_shipping/store_shipping_example.php:

class Store_shipping_example extends Store_shipping_driver
{
    /**
     * Calculate the shipping total for an order.
     * Use print_r($order) to see all the fields available to you.
     * The fields available also match those in the Checkout tag:
     * http://exp-resso.com/docs/store/tags/checkout.html
     *
     * @param array $order
     */
    public function calculate_shipping($order)
    {
        $eu_countries = array('uk', 'ie', 'fr', 'de', 'es', 'it');

        if (in_array($order['shipping_country'], $eu_countries))
        {
            return 15.00;
        }
        else
        {
            return 30.00;
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.