- Posts: 15
- Thank you received: 0
order total/ order detail
- jonathan.lee
-
Topic Author
- Offline
I want to know how to add a coloum in the order tab table and shows the product that each costumer orders. (add a coloum in the table as shown with the attachments.)
or a function that shows the total number of order for each product.
Thank you
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
You forgot to attach your screenshot
Note that some development skills will be required.
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
Now I need to know what function to call to replace the data modified function so it can show the product each customer has ordered and the quantity of each product..
tinypic.com/r/2nhm9lg/8
Thank you
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
Now I just need a function to call the product each customer ordered and the quantity of each product.
for example, the following code is calling the order date and displaying it with year, month day, hour and min.
<td class="hikashop_order_date_value">
<?php echo hikashop_getDate($row->order_created,'%Y-%m-%d %H:%M');?>
I need to know what to call in order to display the product each customer ordered and the quantity of each product.
Thank you
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
For example:
customer A order product A x1, product B x2
customer B order product A x2, product B x2
so adding it up, I will have to prepare the amount of product A x3 and product B x 4.
Is there away to do this and display it under order tab?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
If you want to edit your back-end order listing, you'll have to edit the code of the "listing" file of the "order" view of your back-end template via "Hikashop->Display->Views", also it will be possible to display the total amount of each porduct that your customer ordered but it will require to :
- do some SQL request to your database to know how many products of each type your customer have bought and to know the price of the product
- calculate each total prices
- display them.
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
is it the right link?
it redirect me to my post lol
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Yes it is possible, it's just your code which must be adapted as you want.
The foreach for the product display must be in the order "PRODUCT(QUANTITY)" <td>.
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
what should I put in the foreach()
I tried
foreach($row->order_product_name as $product_name)
echo $product_name ,' ( ',$row->order_product_quantity,' )' ;
originally I didnt use foreach, just
echo $row->order_product_name ,' ( ',$row->order_product_quantity,' )' ;
Thank you
Please Log in or Create an account to join the conversation.
It require to load all the products in the listing, so use the function "loadProducts()" of the order class.
Then do a foreach on "$row->products" and display all the products of the order in the listing.
Example:
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
is the function I been looking for.
which file contains all the functions? where can I find a documentation that states all the functions for me to use?
I actually went in to the view.html.php and change the sql code in order to display the product each by each.
Your code makes it much simpler.
Thanks
Please Log in or Create an account to join the conversation.
All the functions related on the orders are in the file "administrator/components/com_hikashop/classes/order.php".
Please Log in or Create an account to join the conversation.
- jonathan.lee
-
Topic Author
- Offline
- Posts: 15
- Thank you received: 0
where is it located?
for example:
hikashop_config
hikashop_get
Thank you
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.