Cindy, I wonder if the way to go here is just add up the line items to get the total, rather than depending on the individual machinations of mods (which were designed to run on the catalog side) updating $order->info['total'].
Cindy, I wonder if the way to go here is just add up the line items to get the total, rather than depending on the individual machinations of mods (which were designed to run on the catalog side) updating $order->info['total'].
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Cindy,
I hate to tell you, but I found another problem in Edit Orders 4.3.1. If you add a product to an order or change the quantity of an item in the order, the change is made even if there is insufficient stock in inventory. Might be nice to bring up a warning message if there is insufficient stock when adding a product or increasing the quantity of a product.
Dave![]()
Edit Orders 4.3.1 and my mods (Quantity Discounts, Better Together, et. al.):
This seems to work. In the function process() in the code file in includes/modules/order_total (e.g. includes/modules/order_total/ot_quantity_discount.php for Quantity Discounts)
Change
toCode:if ($this->calculate_tax != 'VAT') { $order->info['total'] -= $od_amount[$key]; }
Code:if (!IS_ADMIN_FLAG) { if ($this->calculate_tax != 'VAT') { $order->info['total'] -= $od_amount[$key]; } }
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Hello,
I have added the products price to my order confirmation email. The issue I have is that it is not formatted as currency ($-Canadian). See below:
3 x KARMA Wellness Water - Probiotics Blueberry Lemonade 12 x 532ml Plastic (KAR532PBL) @ 35.2 = $105.60
I want the price 35.2 to appear as $35.20 and don't know the syntax.
Below in red is what I changed/added in includes/classes/order.php
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\$sql_data_array = array('orders_id' => $zf_insert_id,
'products_id' => zen_get_prid($this->products[$i]['id']),
'products_model' => $this->products[$i]['model'],
'products_name' => $this->products[$i]['name'],
'products_description' => zen_get_products_description($this->products[$i]['id']), //added by JM
'products_price' => $this->products[$i]['price'],
'final_price' => $this->products[$i]['final_price'],
'onetime_charges' => $this->products[$i]['onetime_charges'],
'products_tax' => $this->products[$i]['tax'],
'products_quantity' => $this->products[$i]['qty'],
'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
'product_is_free' => $this->products[$i]['product_is_free'],
'products_discount_type' => $this->products[$i]['products_discount_type'],
'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
'products_prid' => $this->products[$i]['id']);
zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I also added the following in red:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$this->products[$index] = array('qty' => $products[$i]['quantity'],
'name' => $products[$i]['name'],
'model' => $products[$i]['model'],
'tax_groups'=>$taxRates,
'tax_description' => zen_get_tax_description($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId),
'price' => zen_round($products[$i]['price'],$decimals),
'final_price' => zen_round($products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']), $decimals),
'onetime_charges' => $_SESSION['cart']->attributes_price_onetime_charges($products[$i]['id'], $products[$i]['quantity']),
'weight' => $products[$i]['weight'],
'products_priced_by_attribute' => $products[$i]['products_priced_by_attribute'],
'product_is_free' => $products[$i]['product_is_free'],
'products_discount_type' => $products[$i]['products_discount_type'],
'products_discount_type_from' => $products[$i]['products_discount_type_from'],
'id' => $products[$i]['id'],
'rowClass' => $rowClass);
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
the line that displays details of the product order has been changed to the following:
$this->products_ordered .= $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ' ' .zen_get_products_description($this->products[$i]['id']) . ' ' . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') . '@ ' .$this->products[$i]['price']. ' = ' .
Any help is appreciated.
Thanks in advance!