Post by bobural » Thu Oct 17, 2013 4:09 am

OK this is a small tutorial that I decided to share with you guys...

Let's say you have Shipping to City A and Shipping to City B.
Shipping to City A costs 10$ and shipping to city B 20$ - ok so far...
But what about if you want to offer free shipping to city A if the cart is more then 50$ and other shipping to city B if the cart is 100$.. what do you do???

Well the following:
Create 2 Geozones - alocate zone A to city A and zone B to city B
Copy the Free Shipping from opencart module to your pc. The relevant files are(hope I got them all):
- admin\controller\shipping\free.php
- admin\language\english\shipping\free.php
- admin\view\template\shipping\free.tpl
- catalog\language\english\shipping\free.php
- catalog\model\shipping\free.php

Now open all the files with notepad++ or your favorite text editor and rename everything from "free" to "free2". Rename the extensions of the files also from free.php or free.tpl to free2.php and free2.tpl

Upload them to Opencart installation and now you have 2 free shipping modules... (you can have as many free shipping methods as you like)

Alocate one free shipping to zone A and the other to zone B and add 20$ to A and 50$ to B...

Edit the from /catalog/controller/checkout the shipping_method.php and cart.php and before:

Code: Select all

$this->session->data['shipping_methods'] = $quote_data;
add the following:

Code: Select all

			if (isset($quote_data['free'])) {
    			$free_and_pickup['free'] = $quote_data['free'];
    			$free_and_pickup['pickup'] = $quote_data['pickup'];
    			$quote_data = $free_and_pickup;
			}
			
			if (isset($quote_data['free2'])) {
    			$free_and_pickup['free2'] = $quote_data['free2'];
    			$free_and_pickup['pickup'] = $quote_data['pickup'];
    			$quote_data = $free_and_pickup;
			}
The above code is not mine ... I found it also here: http://forum.opencart.com/viewtopic.php ... 75#p446975

Thank you and... I just wanted to help. Forum is a sharing info not a market...

Newbie

Posts

Joined
Sun May 26, 2013 9:15 am
Who is online

Users browsing this forum: No registered users and 0 guests