zencart / zencart

Zen Cart® is a full-function e-commerce application for your website.
https://github.com/zencart/zencart/releases
Other
375 stars 233 forks source link

Brands: Information sidebox or categories sidebox? #4156

Closed lat9 closed 2 years ago

lat9 commented 3 years ago

The updates for the brands page now includes that page in the information sidebox:

https://github.com/zencart/zencart/blob/514fa65a39f1911a4d37407cb8ad5da0b3d1ad34/includes/modules/sideboxes/information.php#L15

Wouldn't that be better 'placed' in the categories sidebox?

drbyte commented 3 years ago

I hesitate to be the first to respond lest the following comment be misread as an edict. It's just my opinion:

Yes it could be added to the categories sidebox as well if one wanted to.

I tend to avoid touching the categories sidebox because it's so cluttered with non-category things already, as well as all kinds of switches nobody ever uses.

lat9 commented 3 years ago

Understood; I'd also considered the necessity of an on/off switch in the admin and that added complexity isn't warranted.

Should, however, that link be displayed if the store has no manufacturers defined? (I know that's a drift from this issue's title).

drbyte commented 3 years ago

Should, however, that link be displayed if the store has no manufacturers defined?

Good point. I think the "test" for that belongs in a core file that's loaded much earlier in the process, where it can be a cached result. Better performance that way, and less "logic" inside a template file. Not sure where best to put that. Lots of things could/should use such a thing.

lat9 commented 2 years ago

I'm (currently) thinking to create an /includes/init_includes/init_common_elements.php that could -- for this issue -- determine whether any manufacturers are (a) defined and (b) have associated products, setting a boolean flag if the condition is found.

That flag could be overridden by store-specific processing and would be used for both the information sidebox (to determine whether the link to the "Brands" page should be displayed and by the brands page's processing to determine whether additional rendering output should be created.