Page 1 of 1

[RELEASED] Zone Shipping Plus v079.x

Posted: Thu Jan 15, 2009 1:16 am
by Qphoria
Normal Zone Shipping currently is limited to:
- weight-based only
- based on incremental pricing only, so as weight goes up, price also has to go up (which means no volume discounts)


My thoughts:
Add a new configuration option in the admin that specifies which calculation method to be used:

incremental - (current default way) - increase the shipping cost as the volume increases
a value of 5:10, 10:20 means
volume of 0-5 = $10 shipping
volume of 6-10 = $20 shipping

decremental - decrease the shipping cost as the volume increases
a value of 10:10, 20:5 means
volume of 0-10 = $10 shipping
volume of 11-20 = $5 shipping

This could also be expanded to include an option that is price, weight, or item-count based. This would effectively merge the subtotal zone shipping contrib as well.

Price-based example:
incremental - increase the shipping cost as the volume increases
a value of 5:10, 10:20 means
cost of $0-$5  = $10 shipping
cost of $6-$10 = $20 shipping

Item-count based example:
incremental - increase the shipping cost as the volume increases
a value of 5:10, 10:20 means
0-5 items in the cart  = $10 shipping
6-10 items in the cart = $20 shipping

Any other thoughts?

Re: Zone Shipping Improvement idea

Posted: Tue Jan 27, 2009 11:47 am
by Qphoria
Ok, it's done :)

Working perfectly :)
What does it do:
============
This module expands on the original zone shipping module to allow calculate zone shipping based not only on the weight, but also the subtotal or item count of the entire order. It also supports incremental and decremental ranges, useful for breaks on shipping costs if the customer purchases a large order.

Main features:
==============
* Zone Shipping can be based on Weight, Subtotal, or ItemCount
* Calculation ranges can be set to increase or decrease
* Hides option when rates are out-of-range instead of showing 0.00
DOWNLOAD

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Tue Jan 27, 2009 8:07 pm
by Geek
Just wondering...does this work with percentages as well or no?

ie:

10:5,200:8%

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Tue Jan 27, 2009 9:43 pm
by Qphoria
no but could probably be easily added

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Wed Jan 28, 2009 3:06 am
by Qphoria
Done! :)

v079.2 - 2009-JAN-27 - Qphoria
- Added support for % based costs. For example, a subtotal zone with 10:25% means that a $10 cart total charges $2.50 shipping.

Good call Geek :)


Summary:
itemcount/incremental: 4:10%,8:20% - If there is 1-4 items in your cart, it takes 10% of the cart subtotal for the shipping cost. If there are 5-8 items, it takes 20% of the cart subtotal. If there are more than 8 items, it won't show this shipping option.

weight/incremental: 4:10%,8:20% - If the cart weight is 1-4 units, it takes 10% of the cart subtotal for the shipping cost. If the cart weight is 5-8 units, it takes 20% of the cart subtotal. If there are more than 8 units, it won't show this shipping option.

subtotal/decremental: 4:20%,8:10% - If the cart subtotal is 4-7 (dollars), it takes 20% of the cart subtotal for the shipping cost. If the cart weight is 8+ (dollars), it takes 10% of the cart subtotal. If there are less than 4 (dollars), it won't show this shipping option.

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Wed Jan 28, 2009 7:04 am
by Geek
No prob, Qphoria.

A lot of the modules, so far that I have seen, don't include the ability for percentage. And
most of the retail industry deals with percentages. lol

edit:
It appears though that you have to use either you use a set dollar amount or percentages.
But, what if you wanted to added both in the cost field? I have been working on a module
to try and do that, but with my limited knowledge of PHP I am having a hard time doing that.
Still learning a lot with PHP though.

edit:
It appears that I was wrong. You can use both, I just had it setup wrong. HA!

But, now I have another problem. On the checkout page, I receive a parsing error at the top of the page.
Could it have been something I did to the code? Doubtful, cause I recopied the original module files into
the locations on the site and I still get the error. Any thoughts?

Error:

Code: Select all

Parse error: syntax error, unexpected ')' in ../catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1
I am running OpenCart 0.7.9-RC6.

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Fri Jan 30, 2009 3:01 pm
by Geek
Qphoria? Anybody?

It all looks right to me in the code, but I need another set of eyes if possible.

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Fri Jan 30, 2009 3:19 pm
by Qphoria
ah i didnt see your edits. They don't show up as new posts. I'll research this issue more.

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Fri Jan 30, 2009 3:32 pm
by Qphoria
Maybe the return stuff isn't needed.

Can you edit the file in the error above and try
replacing:

Code: Select all

if (eval("return($value $op $array[0]);")) {
with

Code: Select all

if (eval("$value $op $array[0]")) {
If that don't work try:

Code: Select all

if (eval("return $value $op $array[0];")) {
If that don't work try:

Code: Select all

if (eval('return $value $op $array[0];')) {

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Fri Jan 30, 2009 4:44 pm
by Geek
Well, here are the results of the edit changes:

Replaced:

Code: Select all

if (eval("return($value $op $array[0]);")) {
With:

Code: Select all

if (eval("$value $op $array[0]")) {
Results:

Code: Select all

Parse error: syntax error, unexpected $end in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected $end in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected $end in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected $end in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected $end in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected $end in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1
So, that didn't work then I replaced it with:

Code: Select all

if (eval("return $value $op $array[0];")) {
Results:

Code: Select all

Parse error: syntax error, unexpected ';' in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1
Then I replaced that with:

Code: Select all

if (eval('return $value $op $array[0];')) {
Results of that:

Code: Select all

Parse error: syntax error, unexpected T_VARIABLE in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected T_VARIABLE in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected T_VARIABLE in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected T_VARIABLE in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected T_VARIABLE in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1

Parse error: syntax error, unexpected T_VARIABLE in /mnt/w0205/d18/s13/b02dbab8/www/dev/opencart/catalog/extension/shipping/zoneplus.php(58) : eval()'d code on line 1
Any other ideas?

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Fri Jan 30, 2009 7:30 pm
by Qphoria
can you show me your admin config for the value:cost

I think i know where the problem is but would be helpful to use your data

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Fri Jan 30, 2009 10:37 pm
by Qphoria
I'm unable to reproduce your error so if you could try uploading this attached version of the extension file to:
catalog/extension/shipping/
overwrite the existing zoneplus.php file

Let me know if that works. I think the problem is that sometimes array[0] could be "" and it is trying to evaluate (1 >= )
Now I check that array is populated before trying to run the equation

The thing is, array[0] should be populated assuming the admin stuff is set up correctly in "value:cost" pairs

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Tue Feb 03, 2009 9:54 am
by Qphoria
any update on this?

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Tue Feb 03, 2009 10:32 am
by Geek
Sorry for the delayed reply, please don't dock my pay as well. lol

I figured out it was the settings that was causing the problem. I had it set as decremental instead of incremental.

But, I was wondering, is there a way to set it up for a handling fee so it will display it in the checkout?

Re: [RELEASED] Zone Shipping Plus v079.x

Posted: Tue Feb 03, 2009 10:54 am
by Qphoria
handling fee? you mean like an additional fee?

There is the Calculate Surcharge contrib that I made that adds a surcharge based on weight and/or subtotal

You can add that as a separate calculation that will show on the checkout page.

I will be updating that one to include itemcount as well.