Forums / Setting Up Categories, Products, Attributes / Attribute pricing problem

Attribute pricing problem

Results 1 to 20 of 33
03 Feb 2010, 01:22
#1
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Attribute pricing problem

Hi,

I have a product that has a special price (15% off)

I have an attribute that uses onetime_price_factor (20%)

When I view the product detail page, it calculates everything correctly. When I add the product to the cart, it then calculates the attribute off the regular price of the product, not the special price

Any ideas here?
03 Feb 2010, 02:59
#2
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

Did you accidentally turn on the Price by Attribute when it is not needed?
03 Feb 2010, 16:07
#3
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

Ajeh:

Did you accidentally turn on the Price by Attribute when it is not needed?


Product Priced By Attributes is set to NO in the product screen.. Is that what you were referring to?
03 Feb 2010, 17:16
#4
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

Check that you have applied all of the Known Bug Fixes at:
http://www.zen-cart.com/forum/showthread.php?t=82619

This is also a good time to review the Security Patches and Updates at:
http://www.zen-cart.com/forum/showthread.php?t=131115

Also, check your Quantity Discounts and make sure that you have it set to the Special vs the Price ...

Most likely this is related to post #24 on the Known Bugfixes but note all are important ...
03 Feb 2010, 17:32
#5
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

Ajeh:

Check that you have applied all of the Known Bug Fixes at:
http://www.zen-cart.com/forum/showthread.php?t=82619

This is also a good time to review the Security Patches and Updates at:
http://www.zen-cart.com/forum/showthread.php?t=131115

Also, check your Quantity Discounts and make sure that you have it set to the Special vs the Price ...

Most likely this is related to post #24 on the Known Bugfixes but note all are important ...


Thanks - where is the Quantity Discounts setting located?
03 Feb 2010, 17:49
#6
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

I am assuming the Discount that you are using are on the Catalog ... Products Price Manager ...
03 Feb 2010, 18:08
#7
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

Yes.. Everything looks right, see screen shot

http://i47.tinypic.com/x2vvyv.jpg
03 Feb 2010, 18:11
#8
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

You are not using the Discount Quantities on this Product, you just have a Special ...

Have you tried the Known Bug Fixes to resolve this problem?
03 Feb 2010, 18:15
#9
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

Ajeh:

You are not using the Discount Quantities on this Product, you just have a Special ...

Not sure I follow... Where/What is this setting?

Ajeh:


Have you tried the Known Bug Fixes to resolve this problem?

Yes, I did #24 like you suggested, didn't solve the problem
03 Feb 2010, 18:41
#10
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

I added a product to the products_discount_quantity table (it was empty) and then added it to my cart, same thing - On the detail page, shows the correct pricing for the product and attributes, when added to the cart, it gives me a different total, and the attribute is priced differently (percentage based off retail price, not special price)
03 Feb 2010, 19:28
#11
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

Could you post the exact settings on one of the Attributes that is not working?
03 Feb 2010, 19:50
#12
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

Sure, see attached ZIP file with CSV

Thanks!
03 Feb 2010, 20:12
#13
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

Could you perhaps make life easier on me and also supply an image of the Attributes Controller if you EDIT the Attribute that you are testing? :smile:
03 Feb 2010, 22:11
#15
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

Congratulations ... you found a bug! :clap:

Unfortunately, you found a bug ... :blink:

Good news ... I may already have a fix for you ... :flex:

Try a test, and edit the files:
/includes/functions/functions_prices.php
/admin/includes/functions_prices.php

find the function zen_get_attributes_price_factor ... and make the following change:

////
// return attributes_price_factor
  function zen_get_attributes_price_factor($price, $special, $factor, $offset) {
//    if (ATTRIBUTES_PRICE_FACTOR_FROM_SPECIAL =='1' and $special) {
    if ($special) {
      // calculate from specials_new_products_price
      $calculated_price = $special * ($factor - $offset);
    } else {
      // calculate from products_price
      $calculated_price = $price * ($factor - $offset);
    }
//    return '$price ' . $price . ' $special ' . $special . ' $factor ' . $factor . ' $offset ' . $offset;
    return $calculated_price;
  }


Does this magically fix the problem?

Carefully test this as I have not fully tested this yet ... and let us know if this fixes the One Time Factor on your attributes when using a Special on the Product ...
03 Feb 2010, 22:18
#16
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

I <3 YOU!

That fixed it!

Thank you so much for taking the time to help solve the problem!!
03 Feb 2010, 22:54
#17
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

I have one other problem you might be able to help me with?

If I set my attribute percentage in "attributes_price_factor_onetime" - it displays the correct dollar amount for the attribute on the product detail page. However, when I go to complete checkout, I get an error (see my other threads)

If I set my attribute percentage in "attributes_price_factor" - it displays the wrong dollar amount for the attribute on the product detail page. However, when you add to cart it is the correct dollar amount, and when you complete checkout you get no errors.

So, basically, I need to figure out how to display the correct dollar amount for the attribute, using "attributes_price_factor", so that everything works

Any ideas?
03 Feb 2010, 23:28
#18
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

It could be here? /includes/modules/attributes.php

[PHP]
// collect price information if it exists
if ($products_options->fields['attributes_discounted'] == 0 && $products_options->fields['options_values_price'] == '0.0000') {
// apply product discount to attributes if discount is on
// $new_attributes_price = $products_options->fields['options_values_price'];
$new_attributes_price = zen_get_attributes_price_final($products_options->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc((int)$_GET['products_id'], true, $new_attributes_price);
} else {
// discount is off do not apply
$new_attributes_price = $products_options->fields['options_values_price'];
}
[/PHP]
04 Feb 2010, 00:11
#19
ajeh avatar

ajeh

Oba-san

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

Re: Attribute pricing problem

A Bazzillion people and you want me to find which of your other threads relates to the problem ... work with me here and tell me which thread(s) refer to this new issue? :smile:
04 Feb 2010, 00:22
#20
z3n avatar

z3n

Zen Follower

Join Date:
Apr 2008
Posts:
122
Plugin Contributions:
0

Re: Attribute pricing problem

Ajeh:

A Bazzillion people and you want me to find which of your other threads relates to the problem ... work with me here and tell me which thread(s) refer to this new issue? :smile:


lol, sorry :blink:

http://www.zen-cart.com/forum/showthread.php?t=145749

Right now, everything works on the cart - when I add the product with attribute, it correctly adds in the cart, and checkout works without issue. I think I just need to figure out how to properly calculate the attribute cost on the detail page, because the only problem is it just displays the wrong price

I have two attributes though, to note, one is a flat charge ($350 for example) and the one that I'm having trouble with is the second attribute which calculates as a percentage of the cost of the product

If you look at this product detail page, look in the attribute drop down, you'll notice those two dollar values are not 20% and 40% as they should be

http://tinyurl.com/yf5zhwh