Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shopping cart performance enhancements (#6011)
* Shopping cart performance enhancements Reformatting - Use null coalescing (??) operator where indicated - Use short array syntax - No one-line conditionals - No one-line multiple assignments Refactoring - Since the `contents` property is keyed on a 'uprid', change the `$products_id` key to be `$uprid` on foreach traversals of that array. - Limit MySQL updates to a single row for unique operations. - Use `===` where warranted. - Use `zen_define_default` where warranted. - Use `strpos` instead of `preg_match` when checking for gift-certificates in the cart. - Remove redundant code. - Use `zen_get_product_details` where warranted to get maximum cached queries. Results in a roughly 50% reduction in time taken to add/remove/update a product as well as the cart's overall calculations! Corrections - `calculate` didn't process a 'base' product pricing if a product wasn't found, but *did* process the attributes! Should the product be removed from the cart if this condition is found? * Updating based on review comments
- Loading branch information