Customize listing_price.php with custom fields

  • Posts: 24
  • Thank you received: 0
8 years 7 months ago #254529

Hello. I'm a php expert developer and I would like to handle the views as I want.

I don't know if this is the correct place for ask this kind of request but I try.

I'm modifying the product view called LISTING_PRICE.PHP: I want to handle some informations as a function of a CUSTOM FIELD compiled by the user. Infact I created a specific custom field for the user and I want to use its value for show into the LISTING_PRICE view an information.

Can you share to me the code for extract and list custom fields value?

Thanks for your support.

Bye

MatteoS

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

  • Posts: 26253
  • Thank you received: 4040
  • MODERATOR
8 years 7 months ago #254566

Hi,

All product custom fields are stored in the "product" table and available in "product" objects.
And you just have to know the namekey of your custom field to access it in the object.

In views like "listing_price", you should have access to the current product thanks to " $this->row ".
Depending the context and the view it can also be available through " $this->element ".

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.

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

  • Posts: 24
  • Thank you received: 0
8 years 7 months ago #254617

Jerome wrote: Hi,

All product custom fields are stored in the "product" table and available in "product" objects.
And you just have to know the namekey of your custom field to access it in the object.

In views like "listing_price", you should have access to the current product thanks to " $this->row ".
Depending the context and the view it can also be available through " $this->element ".
Regards,


Really thank you !!!
I used $this->element->FIELD_NAME and it works correctly.

Thanks.

Bye.

MatteoS

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

Time to create page: 0.055 seconds
Powered by Kunena Forum