Blog

Thoughts and Upcomings are shared here.

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.

Simple DIY Product Photography

A friend asked me to try and make some nice product pictures for his website.
Since I mostly shoot landscapes, I thought I would like to try  a simple setup, to shoot product photography without any specialised equipment (except for an external flash and camera offcourse 🙂 ).

I wanted some reflection of the product, so I used my old Ipad as a glass plate to place the product on, you can use any other glass plate or tablet you have available.
I first tried flashing right on the bracelet (on a white table) which gave a lot of flash reflections in the product picture:

OLYMPUS DIGITAL CAMERA
First try, not too bad, but not that great eather..

It could be worse, but I’m not super thrilled about the result. I need to bounce the flash, and place the flash inside a small space, to get a nice effect.

So for my “product photo studio” I used one of the cubes in my ikea kallax closet, you can use any space you have preferably with a white ceiling to bounce the flash off), or create a box with some white wood
As you can see in the picture below, my wall has a little blue-ish color, which I think adds to the end result.

OLYMPUS DIGITAL CAMERA
Product Photography Setup

Result (unedited):

OLYMPUS DIGITAL CAMERA
Bracelet On Ipad In Closet 🙂
OLYMPUS DIGITAL CAMERA
Other Side
Different bracelet
Different bracelet

 

Simple DIY Product Photography

A friend asked me to try and make some nice product pictures for his website.
Since I mostly shoot landscapes, I thought I would like to try  a simple setup, to shoot product photography without any specialised equipment (except for an external flash and camera offcourse 🙂 ).

I wanted some reflection of the product, so I used my old Ipad as a glass plate to place the product on, you can use any other glass plate or tablet you have available.
I first tried flashing right on the bracelet (on a white table) which gave a lot of flash reflections in the product picture:

OLYMPUS DIGITAL CAMERA
First try, not too bad, but not that great eather..

It could be worse, but I’m not super thrilled about the result. I need to bounce the flash, and place the flash inside a small space, to get a nice effect.

So for my “product photo studio” I used one of the cubes in my ikea kallax closet, you can use any space you have preferably with a white ceiling to bounce the flash off), or create a box with some white wood
As you can see in the picture below, my wall has a little blue-ish color, which I think adds to the end result.

OLYMPUS DIGITAL CAMERA
Product Photography Setup

Result (unedited):

OLYMPUS DIGITAL CAMERA
Bracelet On Ipad In Closet 🙂
OLYMPUS DIGITAL CAMERA
Other Side
Different bracelet
Different bracelet