News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

BrowseProductCartattributeOnly

Started by sandomatyas, January 31, 2023, 17:52:24 PM

Previous topic - Next topic

sandomatyas

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

sandomatyas

Hello guys.
Any thoughts on this?

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42


Milbo

Where should it be added, which tab. No Problem to add it, it is just a line and the translation, but where?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sandomatyas

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.

GJC Web Design

+ 1 again for selectable in the custom field
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

Per customfield? Hmmm, that would change the whole loading, but interesting idea.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

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


Milbo

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.


Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

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

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/