Epic Design

some words about us

RSS Feed

Blog
You are here: Home Joomla! Tutorials Virtuemart Postcode Shipping
Virtuemart Postcode Shipping
Written by Houman Kargaran
PDF Print E-mail

I have tested this module on Virtuemart 1.1.3.

To download click on the below link then click on the postcode shipping module

I have transfered all the comments to the support Forum.

Download link

All The Australian Postcodes

General

This module is primary is written for the Australian postcodes, the zones can be used as reference you can enter any zone you want.
You need product weight, Fixed rate based on the zone or postcode, cost per kilo based on the zone or postcode.
This module is good for the postcodes which are not following any order.


Also you can set the min amount so system won't charge the customer if the min amount is achieved, or you can disable it.
This module will create 2 tables for you, you can make them yourself or simply let the module to take care of it.
All the above setting has been addressed in details in the configuration section.
This module calculates the shipping based on the below formula:

Fixed Rate + ( (Individual Weight x Qty) x Cost Per Kilo )

How to install this:

First please back up your website and database in case anything went wrong.
Unzip the file on your desktop or somewhere that you have easy access to.

  • Copy these 3 files
    • postcodeshipping.cfg.php
    • postcodeshipping.ini
    • postcodeshipping.php
  • Paste them in Your/Joomla/Root/administrator/component/com_virtuemart/classes/shipping/
  • You need 2 CSV files (CSV has to be comma delimited)
    • List of the postcodes
    • First Column is the postcodes - second Zones Reference
      Epic Design - virtuemart postcode shipping - Fig 1
    • List of the zones and zone details Column 1: Zone Name, Column 2: Fixed Rate, Column 3: Cost Per Kilo
      Epic Design - virtuemart postcode shipping - Fig 2
    • The zones in zone.csv has to be exist in the option postcode.csv
    • You can name those files anything you want as long as address them in the configuration section
    • When you made the CSV files put in a folder somewhere in your server, I put them in the images/stories/postcodeshipping.
      As long as you know the address to the file you will be fine, in the configuration file module will show you your root address.
  • You are done. Now login to your admin panel, you need to have proper permission to edit the virtuemart
  • Go to component > virtuemart > configuration > shipping tab
  • Select the Postcode Shipping
    Epic Design - virtuemart postcode shipping - Fig 3
  • Click Save
  • From side menu go to store and click on Shipping Module List
    Epic Design - virtuemart postcode shipping - Fig 4
  • Click on the Postcode Shipping (Configure Ship Method)
    Epic Design - virtuemart postcode shipping - Fig 5
  • Ihave pre filled all the options, you just need to make sure the DB Option is checked so module makes you the proper table. Also put the full address to the Zone and postcode CSV files. I have entered your root address. You can use that address too.
    For example: this address is shown by module /usr/home/username/www/htdocs and your postcode file is in /images/stories/postcode.csv then simply your address will be /usr/home/username/www/htdocs/images/stories/postcode.csv
  • If you check the postcode update module will assume you have got a new sets of prices and zone details and update everything
  • After setting up just click on the save and you are done.

Please let me know how do you find this module, and let me knwo if you need any help.

Option for Australian users so they can show the GST to their users:

  1. Use this Zip file and follow the folder structure: com_virtuemart
  2. joomlaRoot/components/com_virtuemart/themes/defaults/templates/order_emails/confirmation_email.tpl.php
    find PHPSHOP_ORDER_PRINT_TOTAL_TAX in and change this block to
    <tr class="Stil1">
    <td colspan=4 align=right><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_TOTAL_TAX') ?> :</td>
    <td><?php $fullNumber = explode("AUD",$order_total); echo "AUD".number_format($fullNumber[1] / 11,2,".",""); ?></td>
    </tr>
  3. Go to joomlaRoot/administrator/com_virtuemart/languages/common/english.php
    line: 123 and change this: 'PHPSHOP_ORDER_PRINT_TOTAL_TAX' => 'Includes GST of',
  4. joomlaRoot/components/com_virtuemart/themes/defaults/templates/pages/account.order_details.tpl.php
    Line 526: comment out this line echo $CURRENCY_DISPLAY->getFullValue($tax_total, '', $db->f('order_currency'));
    And Add: <?php echo "AUD".number_format($total / 11,2,".",""); ?>
  5. Go To: administrator/components/com_virtuemart/html/order.order_print
    Line 442 comment out this block:
    <tr>
    <td align="right" colspan="7"><strong>:</strong></td>
    <td width="5%" align="right" style="padding-right: 5px;"><?php echo $GLOBALS['CURRENCY_DISPLAY']->getFullValue($db->f("order_shipping_tax"), '', $db->f('order_currency')) ?></td>
    </tr>
    and add this:
    <tr>
    <td align="right" colspan="7"><strong>:</strong></td>
    <td width="5%" align="right" style="padding-right: 5px;">
    <?php  $shipping_total = $db->f("order_shipping");  $fullNumber = explode("AUD",$shipping_total); echo "AUD".number_format($fullNumber[0] / 11,2,".",""); ?>
    </td>
    </tr>
  6. Go to store configuration, and edit the setting under “Currency Display Style” so that the ‘thousands separator’ field is blank instead of default of comma. (Thanks to Nicole Fleming)

Thats all.

 

To download click on the below link then click on the postcode shipping module

Support Forum

Download link

All The Australian Postcodes

Hooroo

Houman Kargaran