Access the Product Id?

  • Posts: 1
  • Thank you received: 0
12 years 2 months ago #62876

Hi, I hope you can help.

I have written a module which is to be included in Hikashop product page by using {loadposition xxxx}. This all works fine so far but I could do with retrieving some specific product data from a custom field I have added in the admin tool. However, to do this I need to know the product id that the module is being displayed in so I can make the relevant database calls.

Can anyone tell me how I can retrieve the current product id for the page that is being displayed?

Thanks in advance,

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #62969

Hi

To retrieve the product id of the displayed page, you can use "hikashop_getCID('product_id');" or "$this->element->product_id".
You can see the view "product / show_default" to see how retrieve the product id.

The following user(s) said Thank You: Mountainstumble

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

  • Posts: 156
  • Thank you received: 0
8 years 1 month ago #252604

I got an error becuase I tried to import a Column: Shape, Weight, Lab, Treatment...etc...
How can I import these column or create custom_id?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 1 month ago #252637

Hi,

You can create new custom fields of the table "product" via the menu Display>Custom fields if you have the Essential or the Business edition.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum