Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Ship by Quantity?


tinyvibes

Recommended Posts

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

Link to comment
Share on other sites

Use the table rate module.

Just where it cheks for price get the cart qty and replace there.

 

Satish

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

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

Link to comment
Share on other sites

Alternatively make everything have a weight of 1.

 

Then you can ship by wt.

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

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())");

Link to comment
Share on other sites

There was me thinking wt on the product table was a standard field.

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

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.

Link to comment
Share on other sites

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 by natrium42
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...