lat9 / ZCA-Bootstrap-Template

A Bootstrap-4 template for Zen Cart versions 1.5.8 through 2.1.0. Forked from https://github.com/zcadditions/ZCA-Bootstrap-Template-for-1.5.6-v2.0.0c. See the demo site, below, for additional information.
https://zc158.vinosdefrutastropicales.com/zc158/index.php?main_page=index
GNU General Public License v3.0
4 stars 14 forks source link

PHP Warning: Undefined array key "count" in sideboxes/tpl_categories.php #383

Closed torvista closed 4 months ago

torvista commented 4 months ago

strict reporting

-> PHP Warning: Undefined array key "count" in includes/templates/bootstrap/sideboxes/tpl_categories.php on line 21.

https://github.com/lat9/ZCA-Bootstrap-Template/blob/fa8fa1f0f4b6aca5b06dc5e9a9e31f085e29caf9/includes/templates/bootstrap/sideboxes/tpl_categories.php#L21

I needed to add an isset && to the check as the count field is not set if SHOW_COUNTS is false.

lat9 commented 4 months ago

Any idea as to the category structure that leads to that warning? I'm unable to reproduce with the Zen Cart default products/categories.

torvista commented 4 months ago

Vanilla ZC strict reporting enable categories sidebox drop in BS4 Admin, My Store, SHOW_COUNTS to false $zca_include_zero_product_categories = false;

possibly you are missing the last thing.

lat9 commented 4 months ago

Close, it's the setting of SHOW_COUNTS to 'false' the exposes the issue.