Guest hlfunk Posted September 24, 2006 Share Posted September 24, 2006 I have a number of products all of which have 3 options for size. The product weight for each of the options is different. In my specific case the weights are 8, 13, and 70 pounds. My problem is how to configure shipping cost by weght. Thanks in advance for your responses. Quote Link to comment Share on other sites More sharing options...
Guest PMinteractive Posted September 25, 2006 Share Posted September 25, 2006 Have you looked through cubecart.org for a mod that might help with this? Quote Link to comment Share on other sites More sharing options...
Guest hlfunk Posted September 25, 2006 Share Posted September 25, 2006 Have you looked through cubecart.org for a mod that might help with this? Yes, I did that first before posting to the forum. Thank you for your interest. HLF Quote Link to comment Share on other sites More sharing options...
Guest PMinteractive Posted September 26, 2006 Share Posted September 26, 2006 Ok, perhaps you could add an extra column to 'CubeCart_options_bot', called 'option_weight'. This will contain the weight for that particular option. Each row represents a specific product/option combination so you might want to look into modifying the admin interface to let you add your weight values that way instead of modifying rows in the database. Now you need to modify the cart to take into account your new weight information. Somewhere around line 423 of /includes/content/cart.inc.php you will find this code: $option = $db->select("SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ".$glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `".$glob['dbprefix']."CubeCart_options_bot` INNER JOIN `".$glob['dbprefix']."CubeCart_options_mid` ON ".$glob['dbprefix']."CubeCart_options_mid.value_id = ".$glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `".$glob['dbprefix']."CubeCart_options_top` ON ".$glob['dbprefix']."CubeCart_options_bot.option_id = ".$glob['dbprefix']."CubeCart_options_top.option_id WHERE assign_id = ".$value); replace it with: // Mod to pull 'option_weight' from table $option = $db->select("SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_weight, ".$glob['dbprefix']."CubeCart_options_bot.option_id, ".$glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `".$glob['dbprefix']."CubeCart_options_bot` INNER JOIN `".$glob['dbprefix']."CubeCart_options_mid` ON ".$glob['dbprefix']."CubeCart_options_mid.value_id = ".$glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `".$glob['dbprefix']."CubeCart_options_top` ON ".$glob['dbprefix']."CubeCart_options_bot.option_id = ".$glob['dbprefix']."CubeCart_options_top.option_id WHERE assign_id = ".$value); $mod_option_weight = $option['option_weight']; Next, find this code around line 530: // work out weight if($product[0]['prodWeight']>0 && $product[0]['digital']==0){ $totalWeight = ($product[0]['prodWeight'] * $quantity) + $totalWeight; } and replace it with: // mod to work out weight of options - OVERRIDES MAIN PRODUCT WEIGHT IF SET if ($mod_option_weight > 0 && $product[0]['digital']==0) { $totalWeight = ($mod_option_weight * $quantity) + $totalWeight; } elseif($product[0]['prodWeight']>0 && $product[0]['digital']==0){ $totalWeight = ($product[0]['prodWeight'] * $quantity) + $totalWeight; } Then all you should need to do is set up the standard 'By Weight' shipping options and its all good. I haven't actually tried any of this, so let me know if you run into any problems. Good luck Quote Link to comment Share on other sites More sharing options...
Guest hlfunk Posted September 26, 2006 Share Posted September 26, 2006 Ok, perhaps you could add an extra column to 'CubeCart_options_bot', called 'option_weight'. This will [ ...and more deleted.] Then all you should need to do is set up the standard 'By Weight' shipping options and its all good. I haven't actually tried any of this, so let me know if you run into any problems. Good luck Thank you. HLF Quote Link to comment Share on other sites More sharing options...
aris1234 Posted November 22, 2006 Share Posted November 22, 2006 Has anyone tried this mod? 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.