Tag: extension

Opencart calculate shipping distance

UPDATE 30-09-2018

Some changes have been made by google, unfortunately I can’t support 200 stores to update the extension, so in order to keep using this extension you need to update to the latest version, or follow these steps to make it work again (this might be the quickest, also if you have a customized version):

Opencart 3.0 and up

step 1. open the file catalog\model\extension\shipping\zip_distance.php
step 2. find the getgoogleurl function, and replace it with:

 private function _googleUrl($params) {
        return array(
            'url' => 'https://maps.googleapis.com/maps/api/distancematrix/json',
            'query' => 'origins=' . $params['origins'] . '&destinations=' . $params['destinations'] . '&mode=driving&units=' . $params['units'] . '&sensor=false&key=' . $this->config->get('shipping_zip_distance_api_key')
        );
    }

The changes in this function are: replaced http url with https url, added api key to the query params

Save changes, and you are done!

 

Opencart 2.3.0.0, 2.3.0.1, 2.3.0.2:

step 1. open the file catalog\model\extension\shipping\zip_distance.php
step 2. find the getgoogleurl function, and replace it with:

/**
     * Build the google url with parameters
     * @param array $params
     * @return array
     */
    private function _googleUrl($params) {
        return array(
            'url' => 'https://maps.googleapis.com/maps/api/distancematrix/json',
            'query' => 'origins=' . $params['origins'] . '&destinations=' . $params['destinations'] . '&mode=driving&units=' . $params['units'] . '&sensor=false&key=' . $this->config->get('zip_distance_api_key')

        );
    }

The changes in this function are: replaced http url with https url, added api key to the query params

Save changes, and you are done!

Any Lower versions
The older versions don’t have the apikey yet in the backend, so you need to do it manually:

Find the getgoogleurl function and replace http with https and at the end of the query string add &key=YOURAPIKEY

I created an extension for opencart where you can calculate the distance based on the shippingaddress or the zipcode of the customer & your shop.

Pushover push notifications for opencart

Get opencart push notifications on your phone!

This App uses the pushover app to send push messages to your Android or IOS device if a new order is received, or a customer is created.

To receive notifications you will need to purchase the Pushover App for Android (http://pushover.net/clients/android) or iOS (http://pushover.net/clients/ios)

Then download and install the opencart extension:

https://www.opencart.com/index.php?route=extension/extension/info&extension_id=14803&token=2a91840bddb0b8cefeb4a4317cac88f7