order total/ order detail

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #164947

In order to make the merchant's job easier, I would like to know how to make at least one of the following possible:

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
10 years 3 months ago #164949

Hello,
You forgot to attach your screenshot :), 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". If you want to edit your back-end product listing, you'll have to edit the code of the "listing" file of the "product" view of your back-end template via "Hikashop->Display->Views".
Note that some development skills will be required.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165200

sorry heres the attachment.




I want to add a column that shows the product each customer ordered and the quantity of each product..

Last edit: 10 years 3 months ago by jonathan.lee.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165201

I was able to change the heading "date modified" in to "product". (heres a screenshot for you to compare)

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

Last edit: 10 years 3 months ago by jonathan.lee.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165202

I end up finding the code for date modified and delete them. (heres a screenshot for comparison )




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

Last edit: 10 years 3 months ago by jonathan.lee.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165221

Also, is it possible to shows the total amount of each product that is ordered.

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
10 years 3 months ago #165242

Hello,
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.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165357

Hi,

I need help on the coding so the amount of ordered product by each customer will be display under the order tab.

Last edit: 10 years 3 months ago by jonathan.lee.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165646

Hi, Xavier

is it the right link?

it redirect me to my post lol

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165851

So I finally put the product name and the quantity under order tab.



Is it possible to display it in one row with one order instead of multiple rows with one order?

also, how do I change the export so it only export few information that I wanted instead of all information?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 3 months ago #165872

Hi,

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.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #165945

I tried the foreach, but nothing comes up.

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.

  • Posts: 13201
  • Thank you received: 2322
10 years 3 months ago #165951

Hi,

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:

<td>
<?php
$orderClass = hikashop_get('class.order');
$orderClass->loadProducts($row);
foreach($row->products as $product){
   echo $product->order_product_name.'('.$product->order_product_quantity.')';
}
?>
</td>

The following user(s) said Thank You: jonathan.lee

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 3 months ago #166066

loadProducts();

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.

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #166099

Hi,

All the functions related on the orders are in the file "administrator/components/com_hikashop/classes/order.php".

The following user(s) said Thank You: jonathan.lee

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
10 years 2 months ago #166324

What about the function like hikashop_xxxxx

where is it located?

for example:
hikashop_config
hikashop_get

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
10 years 2 months ago #166360

They are located in the file administrator/components/com_hikashop/helpers/helper.php

The following user(s) said Thank You: jonathan.lee

Please Log in or Create an account to join the conversation.

Time to create page: 0.103 seconds
Powered by Kunena Forum