lat9 / usu

Ultimate SEO URLs for Zen Cart
GNU General Public License v3.0
1 stars 5 forks source link

break out of while loop #45

Closed proseLA closed 3 years ago

proseLA commented 3 years ago

https://github.com/lat9/usu/blob/2adeec5f0132ba0c25b29a4c91e6c8a4060ca28f/YOUR_ADMIN/includes/functions/extra_functions/usu.php#L68-L71

this function has potential for processing savings. once $in_cat is set to true, could we not break out of the while loop?

it seems it could also be done around line 83 with an else statement as well (would need 2 breaks; could potentially do another if to prevent reading of the next parent category as well):

https://github.com/lat9/usu/blob/2adeec5f0132ba0c25b29a4c91e6c8a4060ca28f/YOUR_ADMIN/includes/functions/extra_functions/usu.php#L78-L84

or am i wrong here?

lat9 commented 3 years ago

I agree with your assessment, but note that the zen_product_in_category function is provided if-and-only-if that function's not already present (i.e. the base Zen Cart version is < zc157) and the code for that function is essentially that present in zc157c.

How about a PR to the Zen Cart base instead?

proseLA commented 3 years ago

i had not noticed that there! i noticed it on edit_orders....

i agree, i'll take a look over at the ZC base.

best.

proseLA commented 3 years ago

done. and merged.

lat9 commented 3 years ago

Thanks, @proseLA!