Category Archives: Trick & Tips

How to install xshippingpro in OC 2.x?

Although I am giving screenshot of xshippingpro but these steps applicable for any module. So any module can be installed by following these steps.

First, unzip downloaded zip file.

You will get another zip file named get xshippingpro.ocmod.zip

 

Now, please Go to Admin -> Extensions -> Extension Installer.

Then select “xshippingpro.ocmod.zip” and click on continue.

Now please navigate to admin -> Extensions -> Shipping. Now click on Install button located beside X-shipping pro row.

Finally, go to Admin -> Extensions -> Modifications and now click on “Refresh” button

Congrats! You are done. Now it is ready for adding shipping method. New shipping method can be added from admin -> Extensions -> Shipping

Always display sub-categories in left side in opencart

By default sub-categories won’t be displayed until parent category become active. If you want to  keep sub-categories visible always, this hacks for you.

You need to modify two files.

Controller

catalog/controller/extension/module/category.php   [OC 2.3.x]
catalog/controller/module/category.php   [OC < 2.3 ]

Find following codes

Now replace above codes by following

 

View

catalog/controller/extension/module/category.tpl   [OC 2.3.x]
catalog/controller/module/category.tpl   [OC < 2.3 ]

You can replace all codes of template file by following

Good luck!

Moving Currency Selection from header to footer in opencart

If you want to move Currency selection dropdown from header to footer, you will need to following two files:

  1. catalog/controller/common/footer.php  Please add following code

Now  $currency is available inside catalog/view/theme/YOUR_THEME/template/common/footer.tpl so you can place it whatever you want in footer.tpl file i.e you will have place following code

 

 

 

Showing Breadcrumb on Homepage in opencart

By default opencart does not show breadcrumb on home page in default theme.  If you want to show breadcrumb on home page, you will have to modify two files.

Controllercatalog/controller/common/home.php, Add following code of lines just before the line $data[‘column_left’] = $this->load->controller(‘common/column_left’);

View   catalog/view/theme/YOUR_THEME/template/common/home.tpl , add following lines of code after <div class=”container”> or as per your theme.

That’s all.  It is recommended to use OCmod for modifying file instead of modifying directly, otherwise it will be lost in future update.

Feeling lazy! NO worry, I attached an OCmod. You can install through opencart extension installer.  Finally, refresh your modifications list in Admin -> Extensions -> Modification

Click here to download breadcrumbonhome.ocmod.xml 

Free shipping just for certain products using xshippingpro

It is very easy to setup free shipping for the certain products using xshippingpro. Please do following for achieving this scenario:

  1. Create a new method and give it a name
  2. Now go to Category/Product tab. Select category rule is “Any of the selected products”. Now select applicable products.
  3. Now go to Price Setting Tab and select rate type is “Flat”. Now enter price is 0

That’s all. It is very easy, isn’t it?

To know more about Product/Category rule, check this article 

 

 

Unit Ranges in details in xshippingpro

For each method you can define multiple ranges e.g weight ranges or quantity ranges and a separate cost for that range.
For example, consider a shipping requirements where you need following:

1. For the first 3 items, cost is $5
2. For the remaining each item cost is $2

In this scenario, we need two unit range rows. Since it is related with quantity, so must
select rate type is “Quantity”. Then you will have to enter following unit ranges.

Start    End       Cost        Per Unit Block       Allow Partial
0            3            5               0                                       NO
4           9999       2             1                                        NO
Finally you will have to select final price to cumulative. why cumulative? Because you want to sum up two ranges cost together.

Q. So what will be shipping cost for 5 items from above scenario?

A. For first 3 item, $5 (According first unit range)
For remaining 2 item (2 x $2) $4 (According second unit range)
——————————————
Cumulative cost $9

So shipping cost will be $9
Q. What is Per Unit Block?

A. Per Unit Block simply means per unit. For example, in our above scenario, we want to charge
$2 per item after the first 3 items. So Per unit block is 1. Thats why we have entered Per unit block is 1
for second unit range (second row) for our described shipping scenario.
Q. What is Allow Partial?

A. Sometimes you might need to charge for the half block or half item. Sometimes you don’t want
to allow partila block. Moreover you want to charge for the full block cost in case of partial block. Consider following scenario:
1. if weight is less 3kg, cost will be $5 per kg
2. if weight is greater than 3kg, cost will be flat rate $10
In this scenario, we need two unit range rows. Since it is related with weight, so must
select rate type is “weight”. Then you will have to enter following unit ranges.

Start    End       Cost        Per Unit Block       Allow Partial
0            3            5               0                                       NO
4           9999       10             0                                        NO

Since we don’t need summed cost of each rows together in this scenario. So final cost will be single NOT cumulative.

So what will be cost of 3kg?   Total block 3, cost of each block $5 so cost is $15 (3*5) (according to first row)
So what will be cost of 4kg?   Flat rate $10 (according to second row)
So what will be cost of 2.5kg?   Total block 2.5, cost of each block $5 so cost is $15 (3*5, 2.5 rounds to 3 depending on Allow Partial) (according to first row).
But if you would set “Allow Partial” is Yes, cost would be $12.5 (2.5*5)