VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: sandomatyas on January 31, 2023, 17:52:24 PM

Title: BrowseProductCartattributeOnly
Post by: sandomatyas on January 31, 2023, 17:52:24 PM
Hello

As I found, there is a new hidden config in VirtueMart: BrowseProductCartattributeOnly and when it's true (as default), it loads only the cart attribute custom fields in category view. It's maybe for performance reasons but it broke my layout after update :)
Could you please move this setting to the GUI?
Or much more better: could you please consider adding a new switch to the custom field itself which could determine which fields should be loaded in browse layouts?
Or a dropdown:
where should it loaded: productdetails/browse/both
Title: Re: BrowseProductCartattributeOnly
Post by: sandomatyas on July 27, 2023, 15:04:40 PM
Hello guys.
Any thoughts on this?
Title: Re: BrowseProductCartattributeOnly
Post by: GJC Web Design on July 28, 2023, 11:12:32 AM
+1 for this suggestion
Title: Re: BrowseProductCartattributeOnly
Post by: Studio 42 on July 30, 2023, 12:35:13 PM
+1 for this suggestion
Title: Re: BrowseProductCartattributeOnly
Post by: Milbo on August 11, 2023, 22:53:39 PM
Where should it be added, which tab. No Problem to add it, it is just a line and the translation, but where?
Title: Re: BrowseProductCartattributeOnly
Post by: sandomatyas on August 16, 2023, 07:14:44 AM
Quote from: Milbo on August 11, 2023, 22:53:39 PM
Where should it be added, which tab. No Problem to add it, it is just a line and the translation, but where?

If it's global, then to Configuration / Shopfront / Product Listing? There is a "Show product customfields in browse views" radio button, so it's a bit confusing.
This is the easy way, but I highly suggest to add it to the custom field itself, after cart attribute/cart input/searchable. It could be much more clean. In my case I run a site with ~90 custom fields, most of them are plugin based. In category view I need only 4 of them. It would be much more efficient to generate only the fields I really need than all of them.
Title: Re: BrowseProductCartattributeOnly
Post by: GJC Web Design on August 16, 2023, 11:12:47 AM
+ 1 again for selectable in the custom field
Title: Re: BrowseProductCartattributeOnly
Post by: Milbo on August 17, 2023, 16:09:14 PM
Per customfield? Hmmm, that would change the whole loading, but interesting idea.
Title: Re: BrowseProductCartattributeOnly
Post by: Studio 42 on August 18, 2023, 14:03:29 PM
The logic is very simple i think.
Using a field and filter in the query for eg.
I do not have test if using != is faster in a query.
BUt having 3 values 0,1,2
0-allways
1-not in product view only
2- not in category view only
And using as filter
AND loadinview!=X depending the view should be faste to filter
BUt a problem can be in case of a module displayed in product or in category view, but this is the case currently too

Title: Re: BrowseProductCartattributeOnly
Post by: Milbo on August 21, 2023, 20:20:00 PM
lol, I know what you mean, but it your way is the gauche thinking.
I follow the simpe rule to use positive wording. So I think, the simpelst is to add an extra checkbox "show in product listing". The problem here is just to update the old ones. But we could use the current hidden config and update the old customfields, in the updater. So if you have set BrowseProductCartattributeOnly, it sets the "is_input" and "is_cart_attribute" automatically to "show in product listing".
There should be then also a logic, which disables the "add to cart" button, if you do not show the "is_input" on the browse list.


Title: Re: BrowseProductCartattributeOnly
Post by: Studio 42 on August 23, 2023, 15:55:25 PM
I use sometime "is_input" in my plugins to know if i display a form field or a string.
So i'm not sure, it's a good idea to use this
And some customer needed already a render of a string for eg. A tag 'Made in france',  in the browser view
Title: Re: BrowseProductCartattributeOnly
Post by: Milbo on September 11, 2023, 21:53:05 PM
Yes that is the right way, currently. As intended by me.

But we could just add an extra boolean "showInBrowse" or so. And handle that clean over the new boolean. And for the migration we just use the current setting. I really like this idea. Per customfield, that makes it super transparent.