Forums / Bug Reports / [Done v2.0.0] freeoptions shows up even when not applicable, if icon has been enabled

[Done v2.0.0] freeoptions shows up even when not applicable, if icon has been enabled

Locked

Started by kands on 6 Aug 2007, 10:08 PM · Views: 2,768

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
6 Aug 2007, 10:08 PM
#1
kands avatar

kands

New Zenner

Join Date:
Apr 2007
Posts:
24
Plugin Contributions:
0

[Done v2.0.0] freeoptions shows up even when not applicable, if icon has been enabled

Hi
I set up the free shipping option (freeoptions) to offer free shipping on orders over 3 items and added an icon in the class constructor as follows
*$this->icon = (( defined('DIR_WS_ICONS') ? DIR_WS_ICONS : 'images/icons/' ) . 'shipping_ukrm.jpg');//~~Added icon

*Now the problem is when an order is placed which does not qualify for free shipping, on the checkout_shipping under the Shipping Methods shown, an empty fieldset is shown with only the icon in the legend .

To correct this I had to modify the the freeoptins.php as follows in the
function quote($method = '')
at line 193 which is
*if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
*To the following
if ($this->enabled) {
if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
}

Now the reason I am asking if this is a bug is I have heavily modified the installation and this may be due to something else I have done however I don't think so but thought I would mention it here and let the experts determine if it is a bug or not

7 Aug 2007, 12:39 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: [Done v2.0.0] freeoptions shows up even when not applicable, if icon has been enabled

That solution should work fine.

I'd be more inclined to move the closing } from the existing if($this->enabled) a from a few lines up such that it also includes the lines you mention and those above it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Aug 2007, 4:26 AM
#3
kands avatar

kands

New Zenner

Join Date:
Apr 2007
Posts:
24
Plugin Contributions:
0

Re: [Done v2.0.0] freeoptions shows up even when not applicable, if icon has been enabled

Hi DrByte
I had thought of that but wasn't sure if including the lines
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
would have any side effects.
Many thanks for your reply
Steven

7 Aug 2007, 4:32 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: [Done v2.0.0] freeoptions shows up even when not applicable, if icon has been enabled

Indeed, having the quote['tax'] section (ie: setting the default tax class for the module to other than default) would cause the same problem, so it should all be wrapped in the same condition.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.