[SOLVED] Add discount code on order listing

  • Posts: 300
  • Thank you received: 6
  • Hikaserial Standard Hikaserial Subscription Hikashop Business
9 months 2 weeks ago #293317

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.8
-- PHP version -- : 7.2.5
-- Browser(s) name and version -- : various, all updated - Chrome is primary

I would like to have the discount code added to the order listing page, next to the Partner ID on the right side. However, I am having difficulty in finding the 'view'. I looked at 'listing' but could not find the "order_partner_id" field on the page. Can you tell me what view I need to edit?

Last edit: 9 months 2 weeks ago by LukeDouglas.

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

  • Posts: 65077
  • Thank you received: 9449
  • MODERATOR
9 months 2 weeks ago #293318

Hi,

It's indeed the file "listing" of the view "order" that you want to edit. Make sure that you're editing it for your backend template and not your front end template as otherwise, it would be the order history of the customer on the frontend you're editing.
You can use such code:
<?php echo $row->order_discount_code; ?>
Note however that the partner information isn't there. It's added dynamically by the HikaShop affiliate plugin thanks to the triggers of HikaShop.
If you really want to add it to the partner column, you would have to add your code in the function showField of the file plugins/system/hikashopaffiliate/hikashopaffiliate.php
But I would recommend adding it to order/ listing.php view file, in another column. Otherwise, you'll have to reapply your change after each update of HikaShop.

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

  • Posts: 300
  • Thank you received: 6
  • Hikaserial Standard Hikaserial Subscription Hikashop Business
9 months 2 weeks ago #293376

Nicolas,

Thanks. Worked like a charm!

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

Time to create page: 0.057 seconds
Powered by Kunena Forum