While working with VirtueMart on Joomla, I realised that the Shipping cost is calculated as a whole. What I needed was to have the same shipping cost for every item. So Here how it goes..
Modifying the shipping file to set shipping per item:
- First thing we need to do it access the ftp account where all the files are stored.
- Onces accessed the ftp account, copy and paste the link below:
- Lookup the file standard_shipping.php, and open it on a notepad.
- use the ctrl + F to find the following text: $total_shipping_handling =
- There should be 3 lines starting with $total_shipping_handling, so under those 3 lines paste the following line:
$total_shipping_handling = $d[“zone_qty”] * $dbr->f( “shipping_rate_value” ) + $dbr->f( “shipping_rate_package_fee” ) ;
If you want to add extra fixed charge per item a basic fee
example: (3 items x 2.00 euro) plus a basic shipping fee of 5 euro which would add up to 11 euro
OR paste the following:
$total_shipping_handling = $d[“zone_qty”] * $dbr->f( “shipping_rate_value” );
If you simply want to make one single cost per item
example: 3 items for 4 euro each which add up to 12 euro in total.
- So your code in the file should look something like:
$total_shipping_handling = $dbr->f( "shipping_rate_value" ) + $dbr->f( "shipping_rate_package_fee" ) ; $total_shipping_handling = $GLOBALS['CURRENCY']->convert( $total_shipping_handling, $shipping_rate_currency_code, $GLOBALS ['product_currency'] ) ; $total_shipping_handling *= $taxrate ; $total_shipping_handling = $d["zone_qty"] * $dbr->f( "shipping_rate_value" ); $show_shipping_handling = $CURRENCY_DISPLAY->getFullValue( $total_shipping_handling ) ;
Setting the Actual Shipping Rate per Item:
- First thing we need to do, is to configure the shipping option from:
- Components — VirtueMart
- Admin — Configuration —- Shipping
- Check ONLY:
“Standard Shipping module with individual configured carriers and rates. RECOMMENDED !”
- Access the Shipping Settings
- Create a Shipping Rate and fill in details. It should look something like this:
Goodluck and enjoy 😉