Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

when the items are in the shopping cart, i need to calculate overall postage for the heaviest item. i already have the weights set up in the table rate.

 

for example if there are 3 items in the cart with postage costs of 3.99, 4.99 and 6.99. i need it to work out a flat rate of 6.99 for all 3 items instead of adding them together 15.97.

 

if you cant do it please dont post comments, i just need it done this way so it works with my supplier.

 

any questions, just ask.

  • 4 weeks later...
Posted

In catalog/includes/modules/shipping/table.php find

		$order_total = $shipping_weight;
	for ($i=1; $i <= sizeof($order->products); $i++ ){
	  if ( $order->products[$i]['weight'] == '0' ) {
		$this->quotes['error'] = '';
		return $this->quotes;		
	  }
	}

 

replace with

		$order_total = 0;
	for ($i=1; $i <= sizeof($order->products); $i++ ){
	  if ( $order->products[$i]['weight'] > $order_total ) {
		$order_total = $order->products[$i]['weight'];
	  }
	}

	for ($i=1; $i <= sizeof($order->products); $i++ ){
	  if ( $order->products[$i]['weight'] == '0' ) {
		$this->quotes['error'] = '';
		return $this->quotes;		
	  }
	}

Untested, but I think this will do the trick for you !

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...