How to reference a custom field in the vendor table on Front end order/show.php

  • Posts: 14
  • Thank you received: 1
3 years 7 months ago #323379

-- HikaShop version -- : 4.3.0
-- HikaMarket version -- : 3.1.1
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.3.16
-- Browser(s) name and version -- : firefox 78.0.2 on macOS 10.15.5

I have a custom field I added to my vendor table that I want to access the value of that field on order/show.php so it appears on the invoice they can view and print in the My Store Account section.

How do I retrieve the value of that field in order/show.php? The field is called 'abn' and I put a value in that field for a specific vendor in HikaMarket->vendors page.

Thank you so much for your assistance.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
3 years 7 months ago #323389

Hello,

It depends where you want to display it exactly and "how".

1 - You can retrieve the current HikaMarket vendor and display the value of the field somewhere in the view (that you need to override).
But it will mean that if the main vendor access the order, it won't contain the value of the other vendor.

2 - You can read the order details to read the "order_vendor_id" information and then load the corresponding vendor.
Then, from the vendor object, you will have access to the value of the field you want to display.

Both solution requires some PHP development.
It is possible to use the HikaShop and HikaMarket classes in order to not perform SQL queries, such as the " hikamarket::get('class.vendor') " which own a "get()" function to retrieve the object of a specific vendor.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: TheSiriusLibrary

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

Moderators: Obsidev
Time to create page: 0.055 seconds
Powered by Kunena Forum