tinyvibes Posted January 27, 2009 Share Posted January 27, 2009 Can anyone recommend a simple shipping mod that allows me to ship by quantity of items in the cart? I know there are several but I can't seem to find one that allows me to ship global (using tax zones) and then calculate by quantity. Everything else seems to go by weight or price. Thanks for any guidance! Pete Quote Link to comment Share on other sites More sharing options...
satish Posted January 27, 2009 Share Posted January 27, 2009 Use the table rate module. Just where it cheks for price get the cart qty and replace there. Satish Quote Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does. Link to comment Share on other sites More sharing options...
tinyvibes Posted January 27, 2009 Author Share Posted January 27, 2009 Use the table rate module.Just where it cheks for price get the cart qty and replace there. Satish Ok, thanks. I have that but it doesn't give the option of quantity as a table method, only price and weight. Do you mean just select price and calculate a certain way? If for example 1-2 CDs is $5.95.... 3-4 CDs is $7.95.... etc. How would that work? Thanks Quote Link to comment Share on other sites More sharing options...
natrium42 Posted January 27, 2009 Share Posted January 27, 2009 He means to modify the code and where it checks for weight, check for quantity instead. Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted January 27, 2009 Share Posted January 27, 2009 Alternatively make everything have a weight of 1. Then you can ship by wt. Quote Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
tinyvibes Posted January 27, 2009 Author Share Posted January 27, 2009 Alternatively make everything have a weight of 1. Then you can ship by wt. Oh, I see. My products don't have weight associated and I can't add it (long story). So I am going to try and add the code for quantity. I think I just insert this into table.php but does anyone know if I need to alter another file? Thanks tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_ITEMTABLE3_COST', '$default_costs', 'The shipping cost is based on the total cost or weight of items or quantity of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())"); Quote Link to comment Share on other sites More sharing options...
natrium42 Posted January 27, 2009 Share Posted January 27, 2009 (edited) So you just changed the shown text and expect the computer to interpret it for you? XD What you need to do is modify the code in quote() in includes/modules/shipping/table.php. Edited January 27, 2009 by natrium42 Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted January 27, 2009 Share Posted January 27, 2009 There was me thinking wt on the product table was a standard field. Quote Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
tinyvibes Posted January 27, 2009 Author Share Posted January 27, 2009 So you just changed the shown text and expect the computer to interpret it for you? XD What you need to do is modify the code in quote() in includes/modules/shipping/table.php. Right. That is the file I am changing... just looking for the right line. I am new to PHP so thanks for any help. Quote Link to comment Share on other sites More sharing options...
natrium42 Posted January 27, 2009 Share Posted January 27, 2009 (edited) I haven't tested this, so there may be typos. Let me know if it doesn't help. Change line tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())"); to tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\',\'quantity\'), ', now())"); Change the following code if (MODULE_SHIPPING_TABLE_MODE == 'price') { $order_total = $cart->show_total(); } else { $order_total = $shipping_weight; } to if (MODULE_SHIPPING_TABLE_MODE == 'price') { $order_total = $cart->show_total(); } else if (MODULE_SHIPPING_TABLE_MODE == 'weight') { $order_total = $shipping_weight; } else { // quantity $order_total = 0; $products_array = $cart->get_products(); foreach($products_array as $product) { $order_total += $product['quantity']; } } Remove & install the module for the configuration change to take effect. Edited January 27, 2009 by natrium42 Quote Link to comment Share on other sites More sharing options...
tinyvibes Posted January 27, 2009 Author Share Posted January 27, 2009 Looks like that worked. Thanks mate! 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.