-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Updates for strict-types #6157
Updates for strict-types #6157
Conversation
But then in strict types mode, explode on the next line complains when it is fed an integer...I've got functions_products and the shopping cart class using strict types mode and there are ("only") half a dozen places where casting is needed to clear all the errors (when a product is added to the cart). |
Right. Remember, |
While I may the only one beating ZC with this stick, there are really very few places left where ZC falls foul of this/it's nearly ready for a stricter world. Be nice to clear them. |
Tested with several non-attribute products, with fractional quantities. Errors not thrown. You probably have some specific products that warrant testing this with, though. |
Simple products give no errors. Product with attributes: zencart/includes/classes/shopping_cart.php Line 316 in e6bce46
|
Thanks. I'll reset my demo data later and check this
|
Lots more updates made. |
In my limited testing, with the shopping_cart class, functions_products and functions_general_shared all using strict types, I could checkout with simple and attributed products with no rounding errors. Only two simple errors:
$limit being passed as string instead of int. zencart/includes/functions/functions_general_shared.php Lines 191 to 197 in e6bce46
$key being passed to stripslashes as an int instead of a string |
This is because elsewhere (some of) those values were cast to int for other reasons. |
string|int
for zen_get_prid
Fixes #6082