OK, I *think* I have the attributes bug fixed when adding new products with attributes. At least it's working for me with a variety of scenarios, but there could be problems from the way other users have their attributes set up. Mine are all priced by attributes, this may or may not affect this functionality. So, hopefully some folks will try this out and report back their results.
To reiterate, the problem I was having was when adding products with attributes and the products are using the sale/special price and that checkbox is selected on the finial step when entering quantity. It was adding up prices incorrectly, really large prices as if combining the sale price with the regular price.
Here's what I did:
in admin/edit_orders.php on line 1294 of an unaltered file find:
PHP Code:
or die("Failed to connect database: ");
while($row10a=mysql_fetch_array($result10a, MYSQL_NUM)) {
if ($row10a[2] == 1 && $_POST[applyspecialstoprice])
$newpricechange = zen_get_discount_calc($add_product_products_id, $row10a[3], $row10a[0], $add_product_quantity);
and change it to this:
PHP Code:
or die("Failed to connect database: ");
$new_attributes_price= '';
$attributes_values = $result10a;
$attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
$attributes_price_final_value = $attributes_price_final;
$attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1);
if ($attributes_values->fields["attributes_discounted"]) {
$new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc($add_product_products_id, true, $new_attributes_price);
if ($new_attributes_price != $attributes_price_final_value) {
$new_attributes_price = $currencies->display_price($new_attributes_price, zen_get_tax_rate(1), 1);
} else {
$new_attributes_price = '';
}
}
while($row10a=mysql_fetch_array($result10a, MYSQL_NUM)) {
if ($row10a[2] == 1 && $_POST[applyspecialstoprice])
$newpricechange = $new_attributes_price;
If anyone else wants to try it out and let me know what you experience I will try to fix any problems that arise. Hopefully it won't cause any problems and it will all work the way it should in every scenario.
Bookmarks