Back to Top

How to set Free shipping for Country in Virtuemart Joomla

Free shipping for specific Country in Virtuemart Joomla

Recently I was working in Joomla application and application have shipping functionality and I want to limit free shipping for a specific country in Virtuemart component within Joomla 1.5.

Joomla is a one of the most widely used Open Source Content Management System.It allows you to specify specific country which will be allowed free shipping in Virtuemart while the others will have normal shipping options. It works with the free shipping limit specify in the Virtuemart store configurations.

First of all, Open the class file ps_checkout.php from path administrator/components/com_virtuemart/classes and find vm_ps_checkout function in ps_checkout file.

Add following query into the vm_ps_checkout function:


$db = new ps_DB;
$q = "SELECT country from #__{vm}_user_info WHERE user_info_id = '" . $vars["ship_to_info_id"] . "'";
$db->query($q);

Place below if condition before the condition “if( $vendor_freeshipping > 0 && $vars[‘order_subtotal_withtax’] >= $vendor_freeshipping)” condition:


if( $db->f("country") == "US")

That’s it.Here, User the country code here the US is the code of the country you wish to allow free shipping too.

Must Read:

Browser Detection with Joomla
Free shipping for specific Country in Virtuemart Joomla
To use Pagination in Joomla

Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

Overview of Amazon Web Services (AWS)

Posted on 2 years ago

Bhumi

How to Export data using YUI DataTable

Posted on 3 years ago

Bhumi

What are Lambdas and Closures in PHP?

Posted on 1 year ago

Bhumi

The Reader’s Poll – June 2015

Posted on 3 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 4 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 4 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 5 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 5 years ago

Bhumi