VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Shipping Modules => Topic started by: lemonyellow on September 09, 2005, 15:34:22 PM

Title: Shipvalue - Shipping charge based on order total
Post by: lemonyellow on September 09, 2005, 15:34:22 PM
Hi,

Here's a shipping module called Shipvalue that I developed for a client who wanted shipping charges based on the value of the order total rather than on product weight.

The Module allows you to set up to 10 individual shipping charges based on the total order value.  For example the default configuration for the module is a follows:

Orders less than £20.00 shipping charge = £2.95
Orders less than £50.00 shipping charge = £4.70
Orders less than £70.00 shipping charge = £5.50
Orders greater than £70.00 but less than £10,000 shipping charge = £0.00 FREE

You can also include tax in the shipping total.

NOTE: This shipping module has only been tested on Mambo 4.5.1.3 Stable [Three For Rum Reassigned] and mambo-phpShop 1.2 stable 3  [Good Young Progress].

Installation instructions are in the readme.txt file. Hope you find it useful.

Regards

Rhys

[attachment cleanup by admin]
Title: Re: Shipvalue - Shipping charge based on order total
Post by: lemonyellow on January 04, 2006, 11:44:35 AM
A number of people have reported a problem when configuring the Shipvalue shipping method.  When they try to save their changes they get the following message:

shippingmethodSave is not a valid MOS_com_phpShop function

This seems to occur in mambo 4.5.2.  (see http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=13286.0)

I am guessing that the shippingmethodSave function has changed between versions.  Unfortunately I haven't got the time to investigate/fix the bug at the moment.

A quick workaround would be to replace the default values in the administrator\components\com_phpshop\classes\shipping\shipvalue.cfg.php file with your own default values.  Then you won't have to edit the values in admin.

At the moment the default values in the shipvalue.cfg.php file are:

define ('BASE_SHIP1', '20.00');
define ('BASE_SHIP2', '50.00');
define ('BASE_SHIP3', '70.00');
define ('BASE_SHIP4', '10000.00');
define ('BASE_SHIP5', '');
define ('BASE_SHIP6', '');
define ('BASE_SHIP7', '');
define ('BASE_SHIP8', '');
define ('BASE_SHIP9', '');
define ('BASE_SHIP10', '');
define ('BASE_CHARGE1', '2.95');
define ('BASE_CHARGE2', '4.70');
define ('BASE_CHARGE3', '5.50');
define ('BASE_CHARGE4', '0');
define ('BASE_CHARGE5', '');
define ('BASE_CHARGE6', '');
define ('BASE_CHARGE7', '');
define ('BASE_CHARGE8', '');
define ('BASE_CHARGE9', '');
define ('BASE_CHARGE10', '');
define ('SHIPVALUE_TAX_CLASS', '3');


You can change the "Order total values" by editing the BASE_SHIPx values. The corresponding "Shipping charges" can be changed by editing the BASE_CHARGEx values. Don't forget to change the tax class (if required).  Replace the default shipvalue.cfg.php file with your edited version.

Hopefully someone will find the code changes required to fix the admin.

Regards
Title: Re: Shipvalue - Shipping charge based on order total
Post by: lemonyellow on January 05, 2006, 14:44:11 PM
Further to the above - someone has informed me that ShipValue works ok on the latest version of joomla/virtuemart.

Regards
Title: Re: Shipvalue - Shipping charge based on order tot
Post by: trip on January 18, 2006, 14:14:17 PM
Hi
quick question I am getting the following error on this module

Notice: Undefined variable: flat_charge in /home/*****/public_html/administrator/components/com_phpshop/classes/shipping/shipvalue.php on line 80

can you explain what the problem is here
using mambo 4.5.2.3

regards
TriP
Title: Re: Shipvalue - Shipping charge based on order total
Post by: weatherangel on March 24, 2006, 19:23:42 PM
Quote from: lemonyellow on January 04, 2006, 11:44:35 AM
A number of people have reported a problem when configuring the Shipvalue shipping method.  When they try to save their changes they get the following message:

shippingmethodSave is not a valid MOS_com_phpShop function

This seems to occur in mambo 4.5.2.  (see http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=13286.0)

I went looking for the above thread, and keep getting a message saying that the topic is off limits to me and it keeps setting me back to guest, even though I'm logged into the forums?  Does anyone still have the contents of the topic?  I'd really like to fix this bug in my version of VirtueMart...
Title: Re: Shipvalue - Shipping charge based on order tot
Post by: David Wyatt on June 07, 2007, 13:57:52 PM
I'm using lemonyellow's ShipValue with the current version of joomla/virtuemart. I would like to use two copies, one for UK, a second one for International. Anyone know if this is possible?

June 14: I've managed to create a second copy, and it all works except that both copies get the same value of the shipping for any order, instead of 2 values, one from each cfg file. They seem to read from the cfg file belonging to the first copy accessed. For the moment I've given up and am using a workaround I picked up elsewhere of putting a supplemtary postage item in the shop which International purchasers have to put in the basket, but it's an ugly way of doing it. I feel having got this far messing with the code I could eventually get there - perhaps someone could cast some light on how the shipping values are read, cos I'm missing something along the line.
Title: Re: Shipvalue - Shipping charge based on order total
Post by: alyssa on June 09, 2007, 16:41:28 PM
Can this be modified from a value to list of zip codes?
Title: Re: Shipvalue - Shipping charge based on order tot
Post by: dj_mystic82 on August 07, 2007, 13:24:31 PM
Quote from: David Wyatt on June 07, 2007, 13:57:52 PM
I'm using lemonyellow's ShipValue with the current version of joomla/virtuemart. I would like to use two copies, one for UK, a second one for International. Anyone know if this is possible?

June 14: I've managed to create a second copy, and it all works except that both copies get the same value of the shipping for any order, instead of 2 values, one from each cfg file. They seem to read from the cfg file belonging to the first copy accessed. For the moment I've given up and am using a workaround I picked up elsewhere of putting a supplemtary postage item in the shop which International purchasers have to put in the basket, but it's an ugly way of doing it. I feel having got this far messing with the code I could eventually get there - perhaps someone could cast some light on how the shipping values are read, cos I'm missing something along the line.

Not sure if you managed to get this working in the end, but I needed the same fix (I wanted a standard and recorded delivery option) and came across the same problem, but managed to fix it. I renamed each variable to:

BASE_SHIPA1
BASE_SHIPA2 etc and
BASE_CHARGEA1
BASE_CHARGEA2

I applied this in my new files "shipvalue2.cfg.php" and "shipvalue2.php"
Title: Re: Shipvalue - Shipping charge based on order total
Post by: David Wyatt on August 08, 2007, 00:15:18 AM
Brilliant! I had abandoned it because the customer decided to charge by weight in the end, but I'm sure that fix will come in very handy elsewhere. Thanks.
Title: Re: Shipvalue - Shipping charge based on order total
Post by: nuwud on February 20, 2009, 21:05:38 PM
Hi LemonYellow,

I was wondering if the 1.1.3 VM shipvalue module can be set to do international rates too? That is crucial.

Thanks!
Title: Re: Shipvalue - Shipping charge based on order total
Post by: Gary on March 11, 2009, 15:36:42 PM
Do any of you know if this still works?

Thanks

Gary
Title: Re: Shipvalue - Shipping charge based on order total
Post by: Gary on March 11, 2009, 15:53:17 PM
I have created 2 versions of this, one for standard delivery and one for special delivery.

The special delivery one is kicking out

/home/site/public_html/administrator/components/com_virtuemart/classes/shipping/shipvalue2.cfg.php :: Writeable
Shipping Module Configuration: shipvalue2.php

Fatal error: Call to a member function show_configuration() on a non-object in /home/site/public_html/administrator/components/com_virtuemart/html/store.shipping_module_form.php on line 48

Any ideas?

Many Thanks

Gary
Title: Re: Shipvalue - Shipping charge based on order total
Post by: purestore on March 21, 2009, 09:53:45 AM
Hi,

I am using the Shopvalue module and Japanese Yen as currency on my site. I have free shipping for sales over Y6000 as below.

Order total value 1: 6000.00 Shipping charge 1: 600.00           
Order total value 2: 6001.00 Shipping charge 2:0.00

This does not work. I get an error message Error: Please select a Shipping Method upon check out.

If I cahnge Order total value 2 to from 6001.00 to 1000000.00 it works fine.

What am I doing wrong?

Please help,

J-E
      
Title: Re: Shipvalue - Shipping charge based on order total
Post by: belindab on March 21, 2009, 10:52:03 AM
The way you have it set now you only give free shipping for orders between 6000 and 6001. Use the maximum value of your orders (just like you tried for value 2 e.g. 1000000) and you should get the result you want.
Title: Re: Shipvalue - Shipping charge based on order total
Post by: hotelathome on October 17, 2009, 02:48:46 AM
These guys have some brilliant mods to help if you want to use shipvalue rates, one for home and one for international
http://forum.virtuemart.net/index.php?topic=53372.msg203017#msg203017
use metaship and two versions of shipvalue, one called shipvalue and one called intshipvalue
http://forum.virtuemart.net/index.php?topic=36152.0
Title: Re: Shipvalue - Shipping charge based on order total
Post by: aursam on November 23, 2011, 11:44:32 AM
Hi everyone.

Having investigated many of the solutions in this thread I have identified a little cheat that has met my needs. It is by no means perfect but I thought I would share in case it is of use to someone.

I have some products that need to have the postage calculated based on order total and some as a flat rate regardless of order total. IE. some goods are products and others are gift vouchers with various prices.

I have used the standard shipping module and treated the weight feature as value. Where a product costs £169.99 I have inputted the weight as 169.99 and set up the shipping module in the same way, treating weight as a monetary value. Fortunately none of the products I need to calculate postage based on order total will ever be less than £10 so I have created a shipping cost based on weight 5 - 7 and where a product has a flat shipping rate, given it a weight value of 6

I have also encountered another little anomaly (just as I got excited to have found a solution!) that threw my theory out of whack! Don't forget to change pounds to kilograms in the unit of measure of the product ;o)

Regards
Laura