Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centerboxes\new_products.php comparison to core query #130

Closed
torvista opened this issue Jul 8, 2022 · 1 comment
Closed

centerboxes\new_products.php comparison to core query #130

torvista opened this issue Jul 8, 2022 · 1 comment
Labels
change New feature or request fix provided A correction has been provided zc158 zc158 related issue
Milestone

Comments

@torvista
Copy link

torvista commented Jul 8, 2022

Regarding these two lines in the BS file:

while (!$new_products->EOF) {
if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);
/** bof products price */
$products_price = zen_get_products_display_price($new_products->fields['products_id']);

They are reversed to the core file (156/7/8):
https://github.com/zencart/zencart/blob/90a0a1f4a44f0d08712b9ab8e597d7054b8c949c/includes/modules/new_products.php#L67-L69

So one of them is "wrong"....

@lat9
Copy link
Owner

lat9 commented Jul 14, 2022

The ordering is actually inconsequential, since the two lines are dealing with separate elements. That said, the module is sorely in need of some refactoring and I'll put the order back to the core's version, albeit with PSR-12 formatting so that single-line if statement will be braced.

lat9 added a commit to lat9/zencart that referenced this issue Jul 15, 2022
... and readability.  Based on my looking at [this](lat9/ZCA-Bootstrap-Template#130) issue for the ZCA Bootstrap-4 template and getting the implementations "in line".
@lat9 lat9 added change New feature or request zc158 zc158 related issue fix provided A correction has been provided labels Jul 15, 2022
@lat9 lat9 added this to the v3.4.0 milestone Oct 15, 2022
@lat9 lat9 closed this as completed Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change New feature or request fix provided A correction has been provided zc158 zc158 related issue
Projects
None yet
Development

No branches or pull requests

2 participants