- Posts: 4
- Thank you received: 0
code view order
11 years 5 months ago #199550
by pelo
code view order was created by pelo
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 2.5.19
Hello,
1/ I would like to have on the order, the name of the category just before the purchased product .
If it is in Display-view-order-show, can you give me the code to add and where ?.
If not, what should I do
2/ is it possible to have the product name in the summary table orders instead of the mode of payment?
thank you
-- Joomla version -- : 2.5.19
Hello,
1/ I would like to have on the order, the name of the category just before the purchased product .
If it is in Display-view-order-show, can you give me the code to add and where ?.
If not, what should I do
2/ is it possible to have the product name in the summary table orders instead of the mode of payment?
thank you
Please Log in or Create an account to join the conversation.
11 years 5 months ago #199576
by Xavier
Replied by Xavier on topic code view order
Hi,
For both questions it will require view editions, for the point 1 the view to edit is "checkout / cart" then you will have to add code like:
before the product name display part.
2. The view to edit is "order / listing" in the backend template, so you can replace the desired column name and date by the desired content. To get all the product's names, you will have to do some requests to get the informations in the listing directly as they are not loaded by default.
For both questions it will require view editions, for the point 1 the view to edit is "checkout / cart" then you will have to add code like:
Code:
$productClass = hikashop_get('class.product');
$categoryClass = hikashop_get('class.category');
$fullProduct = $productClass->get($row->product_id);
$category = $categoryClass->get($fullProduct->category_id);
echo $category ->category_name;
2. The view to edit is "order / listing" in the backend template, so you can replace the desired column name and date by the desired content. To get all the product's names, you will have to do some requests to get the informations in the listing directly as they are not loaded by default.
Please Log in or Create an account to join the conversation.
11 years 4 months ago #202178
by pelo
Replied by pelo on topic code view order
Hi,
For the first ,
I tried but I must not put the code in the right place. The code appears on the order.
Please, between what line and what line, we must put the code ?
thanks
For the first ,
I tried but I must not put the code in the right place. The code appears on the order.
Please, between what line and what line, we must put the code ?
thanks
Please Log in or Create an account to join the conversation.
11 years 4 months ago #202183
by Xavier
Replied by Xavier on topic code view order
Hi,
1. To display the category of the product, it must be present in the table, else when you have many products in the cart from different categories, it will be unreadable.
So you have to put the code before:
And the code to use is something like:
ps: it can be optimized by moving the php code:
Before the foreach.
1. To display the category of the product, it must be present in the table, else when you have many products in the cart from different categories, it will be unreadable.
So you have to put the code before:
Code:
<tr class="row<?php echo $k; ?>">
Code:
<tr class="row<?php echo $k; ?>">
<?php
$productClass = hikashop_get('class.product');
$categoryClass = hikashop_get('class.category');
$fullProduct = $productClass->get($row->product_id);
$category = $categoryClass->get($fullProduct->category_id);
?>
<td colspan="5"><?php echo $category ->category_name; ?></td>
</tr>
ps: it can be optimized by moving the php code:
Code:
$productClass = hikashop_get('class.product');
$categoryClass = hikashop_get('class.category');
Please Log in or Create an account to join the conversation.
Time to create page: 0.253 seconds