Skip to main content

Category display in order's at admin panel

More
13 years 3 months ago - 13 years 3 months ago #111982 by reeker
Hello, i need to display a product category in orders at admin panel, already tryed a lot of code, but still doesnt work :( How to do it? Thanks.
Last edit: 13 years 3 months ago by reeker.

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

More
13 years 3 months ago #112054 by Eliot
Hi there,

First you have to load the categories because they are not present in this form. Just add this code:
Code:
foreach($this->order->products as $k => $product){ $ids[]=$product->product_id; } $db = JFactory::getDBO(); $query='SELECT * FROM '.hikashop_table('product_category').' as pc LEFT JOIN '.hikashop_table('category').' as c ON c.category_id=pc.category_id WHERE product_id IN ('.implode(',',$ids).')'; $db->setQuery($query); $categories = $db->loadObjectList('product_id');

before this line:
Code:
foreach($this->order->products as $k => $product) {

Then add these lines:
Code:
<td class="hikashop_order_item_category_value"><?php echo $categories[$product->product_id]->category_name;?></td>

before:
Code:
<td class="hikashop_order_item_edit_value" style="text-align:center">

And
Code:
<th class="hikashop_order_item_category_title title titletoggle"><?php echo JText::_('CATEGORY'); ?></th>

before:
Code:
<th colspan="2" class="hikashop_order_item_remove_title title"><?php echo JText::_('ACTIONS'); ?></th>
The following user(s) said Thank You: reeker

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

More
13 years 3 months ago #112199 by reeker
Thabk you very much :) Maybe you can help me with individual discount prices for every user?

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

More
13 years 3 months ago #112202 by nicolas
You can create a user group for each user via the joomla user management and then restrict each discount to each user group. Then, based on the user group of the user the discount will be selected by Hikashop automatically

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

More
13 years 3 months ago #112207 by reeker
Thanks, but now i use a free version of Hikashop :(

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

More
13 years 3 months ago #112234 by Eliot
Since it's the only solution, you will understand that we can't help you anymore :)

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

More
13 years 3 months ago - 13 years 2 months ago #112355 by reeker
I need help again :) This category display solution doesnt work at checkout page in product listing, please can you help me with that?
Also, how to edit code of $amount for payment? ive made a discount system, but it does not affilate on payment amount :(
Last edit: 13 years 2 months ago by reeker.

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

More
13 years 2 months ago #112422 by nicolas
The code Xavier provided was for the order details page.
So it's normal that it doesn't do anything for the checkout.
You will need to do similar changes in the file "cart" of the view "checkout" of your frontend template via the menu Display->Views for that.

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

More
13 years 2 months ago #112423 by reeker
Already applied this changes, but its just doesnt work :(

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

More
13 years 2 months ago #112440 by nicolas
Can you attach the content of the cart file so that we can see the changes you made ?

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

Time to create page: 0.184 seconds
Powered by Kunena Forum