[Skip to main content](#vessel-content)

#   code view order

##

- **[pelo](/forum/user/31060-pelo "View pelo's Profile")**
- [![pelo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31060-pelo "View pelo's Profile") Topic Author
- [ Offline](/forum/user/31060-pelo)

Less More

- Posts: 4
- Thank you received: 0
-
-

11 years 6 months ago [\#199550](#199550) by [pelo](/forum/user/31060-pelo "View pelo's Profile")  *[code view order](/forum/35-orders-management/876547-code-view-order#199550 "-- 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")* was created by *[pelo](/forum/user/31060-pelo "View pelo's Profile")*

-- 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

- [ ![Image1.jpg](/forum/attachment/23972) ](/forum/attachment/23972 "Image1.jpg") [ ](/forum/attachment/23972?download=1 "Image1.jpg")
- [ ![image2.jpg](/forum/attachment/23973) ](/forum/attachment/23973 "image2.jpg") [ ](/forum/attachment/23973?download=1 "image2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NjU0Ny1jb2RlLXZpZXctb3JkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 6 months ago [\#199576](#199576) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[code view order](/forum/35-orders-management/876547-code-view-order#199576 "-- 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")*

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: Code:

$productClass = hikashop_get('class.product'); $categoryClass = hikashop_get('class.category'); $fullProduct = $productClass-&gt;get($row-&gt;product_id); $category = $categoryClass-&gt;get($fullProduct-&gt;category_id); echo $category -&gt;category_name;

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NjU0Ny1jb2RlLXZpZXctb3JkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[pelo](/forum/user/31060-pelo "View pelo's Profile")**
- [![pelo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31060-pelo "View pelo's Profile") Topic Author
- [ Offline](/forum/user/31060-pelo)

Less More

- Posts: 4
- Thank you received: 0
-
-

11 years 5 months ago [\#202178](#202178) by [pelo](/forum/user/31060-pelo "View pelo's Profile")  Replied by *[pelo](/forum/user/31060-pelo "View pelo's Profile")* on topic *[code view order](/forum/35-orders-management/876547-code-view-order#202178 "-- 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")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NjU0Ny1jb2RlLXZpZXctb3JkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 5 months ago [\#202183](#202183) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[code view order](/forum/35-orders-management/876547-code-view-order#202183 "-- 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")*

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: Code:

&lt;tr class="row&lt;?php echo $k; ?&gt;"&gt;

And the code to use is something like: Code:

&lt;tr class="row&lt;?php echo $k; ?&gt;"&gt; &lt;?php $productClass = hikashop_get('class.product'); $categoryClass = hikashop_get('class.category'); $fullProduct = $productClass-&gt;get($row-&gt;product_id); $category = $categoryClass-&gt;get($fullProduct-&gt;category_id); ?&gt; &lt;td colspan="5"&gt;&lt;?php echo $category -&gt;category_name; ?&gt;&lt;/td&gt; &lt;/tr&gt;

ps: it can be optimized by moving the php code: Code:

$productClass = hikashop_get('class.product'); $categoryClass = hikashop_get('class.category');

Before the foreach.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NjU0Ny1jb2RlLXZpZXctb3JkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.108 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
