bobsi18 Posted June 20, 2006 Share Posted June 20, 2006 (edited) Hi there... I've just been mucking around with my cart and have noticed a small problem on the shopping cart page. I have the 'add weight to product attributes' contribution installed... I have a product A that comes in 3 sizes: SMALL, MEDIUM and LARGE. Small weighs 1kg, medium weighs 2kg and large weighs 3kg. If I add a size small to my cart, weight is shown as 1kg. fine. If I take that out and instead add a size medium to my cart, weight is shown as 2kg. fine. Same thing again for size large (3kg). Now if I mix things in the cart, e.g. 1 x small plus 1 x medium, weight shows as 4kg (which obviously isn't fine!). I've narrowed it down to the small size being the problem, and only if other things are in the cart. In my product info area, I have defined the weight as 2kg, in the attributes area I have split it up into small (1kg), medium (2kg) and large (3kg). I think the 'default' weight is over-riding the attribute weight ONLY when there is a mix of different weights in the cart. Has anyone encountered this? I hope I've explained it well enough, kinda hard to put it to paper. If I change the default weight to the lowest possible weight for the product (eg 1kg), it seems to be ok, but I don't particularily want to go and change all the products I've entered (about 300 products would need changing). So, if anyone has had this happen or has any ideas, I'd love to hear them :) Thanks ~bobsi18~ Edited June 20, 2006 by bobsi18 Quote Link to comment Share on other sites More sharing options...
bobsi18 Posted June 20, 2006 Author Share Posted June 20, 2006 Please help me out here... I'm going round and round in circles... I've narrowed it down to the includes/classes/shopping_cart.php page (i think)...particularily to this bit of code: if(!empty($attribute_price['options_values_weight'])) { // [email protected] // add-weight-to-product-attributes mod: if ($attribute_price['options_values_weight'] > '0') { $this->weight += (($qty * $attribute_price['options_values_weight'])-($qty * $products_weight)); } else { $this->weight += ($qty * $products_weight); } } // END if(!empty($attribute_price['options_values_weight Basically, the weight if it's only one of a product in the cart, it's fine. It's when I add two different sizes of the same product that the problem occurs - the weight defaults back to 'default' weight, not the one I set for the attributes. Has anyone heard of this happening? Thanks, ~bobsi18~ Quote Link to comment Share on other sites More sharing options...
bobsi18 Posted June 20, 2006 Author Share Posted June 20, 2006 got it... i had that section of code in the wrong place, needed to be moved up one set of curly brackets... oh well, it was a long day :) ~bobsi18~ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.