Re: Attibutes and percent pricing
This is a temp fix for Products with products_price and price factor and price factor offset where the attribute price is 0.00 ...
Edit the file:
/includes/modules/attributes.php
PHP Code:
$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);
PHP Code:
$new_attributes_price = zen_get_attributes_price_final($products_options->fields["products_attributes_id"], 1, '', 'false');
if ($products_options->fields['options_values_price'] != 0) {
$new_attributes_price = zen_get_discount_calc((int)$_GET['products_id'], true, $new_attributes_price);
}
Product Price: 200.00
Special: 100.00
Set up the Attributes as:
Red
prefix + or blank
Price: 0.00
Price Factor: 0.00
Price Factor Offset: 0.00
Green
prefix +
Price: 0.00
Price Factor: 1.2
Price Factor Offset: 1.00
Blue
prefix -
Price: 0.00
Price Factor: 0.90
Price Factor Offset: 1.00
This will display the prices as:
Red
Green ( +$20.00 )
Blue ( -$10.00 )
NOTE: this has not been tested for combinations of Attribute Price with Price Factor and Price Factor Offset ...
Re: Attibutes and percent pricing
Hi Ajeh
thanks for reply.
But that fix doesnt seem to solve the problem with the cart adding the attribute amount calc'ed on the full price.
I've applied your fix to my test site and a 100 item with a +20% attrib gets added to the cart at 140 - NOT the 120 which it should be added at.
It does fix the display issue tho.
But I think the key to the Cart issue is this constant:
ATTRIBUTES_PRICE_FACTOR_FROM_SPECIAL
its used in zen_get_attributes_price_factor - but its not set anywhere
And also about the price display issue in the attribute DropDown
I need this to work for a presentation tomorrow and I found a different solution like so:
In functions_price.php...
line-492: function zen_get_discount_calc($product_id, $attributes_id = false, $attributes_amount = false, $check_qty= false) {
If there is a special offer in place it drops into
case ($discount_type_id == 59):
line-570: $calc = ($attributes_amount * $special_price_discount);
$special_price_discount appears to be derived from:
list price / special price
which for a 200 item on special at 100 = .5
so the attrib amount is being reduced by this factor
but... $attributes_amount has already been calculated at this point so its just reducing it again needlessly
Anyway... I think thats why attributes are displaying at half the amount.
as a workaround for now I've just changed this line:
line-570: $calc = ($attributes_amount * $special_price_discount);
to this:
$calc = ($attributes_amount);
Products on Special Offer or not, with attributes calc'ed from percent factor now seem to work correctly but...
I didnt get time to look much further to see what else this breaks, so if you can please check it thru and post the correct fix I'd really appreciate it.
thanks
l.