Page 1 of 1

Variables for items_list view

Posted: 22 Jul 2024, 16:25
by HaroldScott
Hello,
I have added 2 text fields to the products database table. I can get them on the item view fine. I was hoping that someone may help in guiding me to the right place to declare my variables for the fields for the items_list layout view. I cannot figure that one out.
Thanks in advance

Re: Variables for items_list view

Posted: 26 Jul 2024, 17:43
by Jan
Hi, where exactly do you get the problem:

1) first you need to load them from the database (so most probably you need to change the query in items view)
2) then you can display them in items view

Isn't it easier to use some additional fields: https://www.phoca.cz/documentation/115- ... phoca-cart

Jan

Re: Variables for items_list view

Posted: 27 Jul 2024, 19:09
by HaroldScott
Hello,

I agree that it would be easier to use the other fields, but none of them worked for me because I don't want the user to choose. These two fields are for informational purposes and are really necessary for the frontend.

Yes, I do need to retrieve the fields from the database for the items_list layout. This is what I was looking for - the place (file) where I would do that. I already have them in the item view and would like it to be the same for the list view. https://dlejproducts.pro/images/item_view.png

Re: Variables for items_list view

Posted: 29 Jul 2024, 15:04
by Jan
There is even another option, to use some existing field for this which you are not using for your purposes. E.g. EAN field, etc.

Re: Variables for items_list view

Posted: 31 Jul 2024, 17:35
by HaroldScott
Jan,

Actually, I had not thought of that. I could give that a shot and see how it works.

Re: Variables for items_list view

Posted: 01 Aug 2024, 17:35
by HaroldScott
These will not work for me either. I just really need to know where to declare my database fields for the layout view.

Re: Variables for items_list view

Posted: 05 Aug 2024, 16:56
by Jan
Hi, this can be different, it depends which which file the layout is called. If this is from view (e.g. category view), then such fields need to be loaded in category view model.

Jan