Dislplay custom field on cart page

  • Posts: 162
  • Thank you received: 0
6 years 3 months ago #286013

-- HikaShop version -- : 3.2.2

Hi,

how can I pull from the database a custom field value to diplay it on the cart page(cart/show.php)?

For example on product listing page I do it with this code: $this->row->product_column_name.

thanks!

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

  • Posts: 12953
  • Thank you received: 1778
6 years 3 months ago #286016

Hello,

It will actually depends on how you have set the "Table" option, if you custom field is part of the "Product" table it should already be displayed.
Else, you'll have to directly do a database request to load and display its value.

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

  • Posts: 162
  • Thank you received: 0
6 years 3 months ago #286080

Hi,

yes it is part of the product table. It's an Ajax image field. The field label is displayed but the value not. I prefer to not do a new database query if it is not needed.

thanks!

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
6 years 3 months ago #286083

Hi,

Here is a thread which talks about that:
www.hikashop.com/forum/development/88397...tom-field-image.html
Note that in cart / show.php the product variable is $cart_product and not $this->element or $this->row

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

Time to create page: 0.074 seconds
Powered by Kunena Forum