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!
@allmart, why is this (re-)posted in the Edit Orders plugin's support thread?
My apologies yesterday I originally posted in the correct thread. Today when I checked the thread I didn't realize that I was viewing the wrong thread and saw nothing posted so I re-posted, now realizing that I was in the incorrect thread (edit orders).
What a dope and I am sorry.
Cheers!
Please take the following with a grain of salt because it was tested on ZC 1.5.6 beta though the results were the same as reported by someone using ZC 1.5.5f.
There are centrally two issues, one for eventual consideration of design of the home grown support software to EO and the following primary issue.
Once an order is placed that contains any number of product with attributes, going to edit orders and selecting the update button causes the attributes of all product in the order to be removed.
The other issue (again with ZC 1.5.6 still being in development) is that the notifiers for adding buttons into the order page are modified away from what is used in the current version of Edit orders (4.3.1) which may be an issue with the software that detects the presence of applicable notifiers (though may not also) in a single install as between two different versions of ZC the "same" notifier may exist but by a different name. I have not looked into the operation to identify the capability but thought notification of that potential issue would help plan for such "control" if not already considered.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
The first issue arises from the current EO design. When an order is updated, all products are removed/re-added ... including their attributes. Until I get time to go down a re-design path, that's the way it is.
I'll check on those notifiers; I've been trying to keep them in-line with future ZC base values.
To be clear, the highlighted portion does not fully occur. The "product" itself remains, but the attributes associated are removed. Permanently. They can be "added" back in only if the product is added with the associated attributes (costs and other characteristics), but an update from the current page (whether adjusting the attributes or not) plain removes attributes from all product whether the product was edited or not.
Seeing that little has/had changed in the base "direction" to remove and add product's to the order, my search led me to consider other "black boxes" with current review of the admin's attributes class because of the breadth of changes that were made between the current version and a version that I could readily identify as previously working (4.1.7). (I know a long time ago. :) ).
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Well,. I've noted the issue on GitHub and address it over the weekend.
OK, as usual, this was bugging me (no pun intended).
The change (currently up on EO's GitHub repository) involves a teeny change to use the correctvariable name.
In /YOUR_ADMIN/edit_orders.php, find the following section (around line 377):
and make the highlighted change:Code:if ($product_update['qty'] > 0) { // Retrieve the information for the new product $attrs = (isset($product_update['attr'])) ? $product_info['attr'] : ''; unset($product_update['attr']); $new_product = eo_get_new_product( $old_product['id'], $product_update['qty'], $attrs, false ); unset($attrs);
Code:if ($product_update['qty'] > 0) { // Retrieve the information for the new product $attrs = (isset($product_update['attr'])) ? $product_update['attr'] : ''; unset($product_update['attr']); $new_product = eo_get_new_product( $old_product['id'], $product_update['qty'], $attrs, false ); unset($attrs);
Certainly looks like that will fix it. (Note, there appear to be other "notice" related items to address besides what was done for that line.)
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks