Post by i2Paq » Mon Nov 09, 2009 11:11 pm

I've installed OC 1.3.3 and I'm trying to configure the weight based shipping but I cannot get it completly to work.

I want to offer free shipping below 10Kg and above it will cost € 13,50.
I have configured my product with a weight of 0.250Kg each.
In the Weight base shipping module I have the following: 10:1.00,20:13.50
If I buy 1 item at checkout iw shows me: Netherlands (0.250kg) € 1.00.
But If I lower the price below 1.00 the module does not showup during checkout.

Am I missing something or is this a bug?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Daniel » Wed Nov 11, 2009 6:25 am

i'll look into this.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by i2Paq » Wed Nov 11, 2009 6:43 am

Daniel wrote:i'll look into this.
I also reported it as a Bug in the Bugtracker.

Just to be sure, sorry if this was not necessery :-[

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Wed Nov 11, 2009 7:59 am

This is the problem:

In catalog/model/shipping/weight.php

Line 44:

Code: Select all

if ((int)$cost) { 
Change to :

Code: Select all

if ((string)$cost) { 

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by i2Paq » Thu Nov 12, 2009 2:00 am

Qphoria wrote:argh.. stupid php thinks 0 == ''

Try:

Code: Select all

if ((string)$cost != '') { 
Huble I bow for The Master Image

I also updated the BUG tracker here.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by dannowatts » Thu Nov 12, 2009 6:22 am

Qphoria wrote:argh.. stupid php thinks 0 == ''

Try:

Code: Select all

if ((string)$cost != '') { 
why'd you change it to a string, from a float, from an integer?

rocksteady,
danno~

New member

Posts

Joined
Tue Nov 10, 2009 11:40 am

Post by Qphoria » Fri Nov 13, 2009 11:29 pm

There is no type conversion. I am only using it for the conditional.

In php
0 == "" <--int (Original way. Didn't allow sub 1.00 prices)
0.00 == "" <--float (Solution attempt 1. Allowed sub 1.00, but not 0.00)
but "0.00" != "" <-- string (Final Solution. Allows sub 1.00 and 0.00)

If you have:
10:0.00, 20:5.00, 30:10.00 then you DO want free shipping for 10 or less

if you used the (int), 0.00 would show up as 0 which = "".
If you used the (float), 0.00 would show up as 0.00 which still = "".
So i made it check for the existence of an actual string value for the price

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dannowatts » Sat Nov 14, 2009 4:40 am

gotcha.
thanks!

rocksteady,
danno~

New member

Posts

Joined
Tue Nov 10, 2009 11:40 am

Post by deeve » Fri Dec 04, 2009 6:32 am

I've read all the above but can't understand why my schema of 2 different product weights 1 & 1.5kg doesn't calculate a single item of 1.5 as 1.5 x the shipping weight but prefers to defer it as 2 @ the 1kg rate!

http://forum.opencart.com/viewtopic.php?f=22&t=8391

Active Member

Posts

Joined
Tue Oct 20, 2009 4:31 pm

Post by i2Paq » Thu Apr 01, 2010 8:10 pm

Using 1.4.6 I see that this bug has re-apeard.

Reported in the 1.4.6 Bug topic here.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Fri Apr 02, 2010 12:19 pm

fixed in next version to allow 0

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 21 guests