heliumdream Posted December 23, 2016 Share Posted December 23, 2016 (edited) $quantity += $product['cart_quantity']; I'm updating some code for a client, related to an Order Fee module that has been extended to handle fee quantities. Counting the cart quantity of each product isn't quite what we're after. I need a solution for counting the total number of products instances - accounting for multiple combinations and any instances of those combinations that might have customization attached. I tried a number of methods, and won't include any of my botched attempts. I also looked at the order controller php and shopping cart tpl logic and architecture for clues, and still couldn't quite get it. Attached is a screenshot, just to perfectly illustrate our needs. We would like this particular cart to reflect 4 fees. One fee per customization instance. In the screenshot I incremented the counter using a foreach statement to step thru a value found with getProductCustomization. I had limited success counting the number of customizations, but couldn't account for multiple combinations properly. Hopefully someone can illuminate the situation. Thank you. Edited December 29, 2016 by heliumdream (see edit history) Link to comment Share on other sites More sharing options...
heliumdream Posted December 29, 2016 Author Share Posted December 29, 2016 $customization = $context->cart->getProductCustomization($product_key)more or less i already had what was needed.iterating thru each product, multiple combinations would cause the customization count to trigger more than once...so i added a catch to stop things if the loop already ran on a particular product_id. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now