Variables for items_list view

Phoca Cart - complex e-commerce extension
HaroldScott
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Jul 2024, 22:02

Variables for items_list view

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Variables for items_list view

Post 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
If you find Phoca extensions useful, please support the project
HaroldScott
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Jul 2024, 22:02

Re: Variables for items_list view

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Variables for items_list view

Post 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.
If you find Phoca extensions useful, please support the project
HaroldScott
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Jul 2024, 22:02

Re: Variables for items_list view

Post by HaroldScott »

Jan,

Actually, I had not thought of that. I could give that a shot and see how it works.
HaroldScott
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Jul 2024, 22:02

Re: Variables for items_list view

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Variables for items_list view

Post 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
If you find Phoca extensions useful, please support the project
Post Reply