Zen Cart Logo
Forums / Bug Reports / [Not a Bug] Negative attribute price factor not working

[Not a Bug] Negative attribute price factor not working

Locked

Views: 1,195

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
6 Sep 2011, 2:04 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

[Not a Bug] Negative attribute price factor not working

Running 1.50 BETA 20110828. I have a product defined with a negative attribute price factor and while the price factor displays as a negative value in my admin ... it was not being applied in my storefront (also verified on a clean install of the beta).

The fix was to make the following four changes to /includes/classes/shopping_cart.php:

//           if ($attribute_price->fields['attributes_price_factor'] > 0) {  /* Line 758 */
          if ($attribute_price->fields['attributes_price_factor'] != 0) { 

//            if ($attribute_price->fields['attributes_price_factor_onetime'] >0) {  /* Line 784 */
          if ($attribute_price->fields['attributes_price_factor_onetime'] != 0) {  

//          if ($attribute_price->fields['attributes_price_factor'] > 0) { /* Line 927 */
         if ($attribute_price->fields['attributes_price_factor'] != 0) {

//          if ($attribute_price->fields['attributes_price_factor_onetime'] > 0) { /* Line 1011 */
         if ($attribute_price->fields['attributes_price_factor_onetime'] != 0) {
6 Sep 2011, 2:26 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Not a Bug] Negative attribute price factor not working

What values were you using?

Did you have this issue in v1.3.9h or are you just testing the fun stuff? :unsure:

6 Sep 2011, 3:34 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: [Not a Bug] Negative attribute price factor not working

I defined a dropdown attribute name with two attribute values:

"Regular" ... using all defaults
"Price Factor" ... setting price factor to -0.5 and offset 0

The same problem exists in the v1.3.9h version of shopping_cart.php (seen by inspection); I'm actually defining a new storefront via the beta.

6 Sep 2011, 3:48 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Not a Bug] Negative attribute price factor not working

And if used, as intended, with:
One Time Factor: 1
Offset: 1.5

does it now work correctly on both Admin and Catalog?

6 Sep 2011, 7:54 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: [Not a Bug] Negative attribute price factor not working

Ajeh, I plugged in the numbers like you said and the result is a 1/2 off value (as I wanted/expected).

If a negative value of the 'price_factor' isn't supposed to be used, why is the value allowed to be entered in the admin?

6 Sep 2011, 10:29 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Not a Bug] Negative attribute price factor not working

There are 10,000 safeties that "could" be added to Zen Cart ... not all of them have been added, at this time ... :smile:

Thanks for the update that this is working for you ...