Page 2 of 2

Re: [MOD] Stop Free Shipping dropping other options

Posted: Tue Jul 16, 2013 8:31 pm
by Martin
chamster wrote:Not quite the same issue I'm having but the closest discussion I could find. My issue has to do with fixed shipping costs. Our shop gives free shipping on orders over $75. But some of our products are oversized and have a fixed shipping cost, which we want to charge even if the order is over $75. The problem is that if an item with a fixed shipping cost is over $75, then the free shipping automatically kicks in and overrides the fixed shipping cost, and the only shipping option for the customer at checkout is free shipping.

We need it to be the other way around, i.e. for oversized items we want the fixed shipping cost to override the (free shipping over $75) default.
Am I right in thinking that the free shipping is coming from the discount rules or are you using a shipping module (Eg: Ship by Order Total) that handles things?

Either way should be resolvable one way or another.

Re: [MOD] Stop Free Shipping dropping other options

Posted: Tue Jul 16, 2013 9:58 pm
by chamster
Am I right in thinking that the free shipping is coming from the discount rules or are you using a shipping module (Eg: Ship by Order Total) that handles things?
The free shipping is set up as a shipping zone. You can see a screenshot of that zone's settings here:

Image

Re: [MOD] Stop Free Shipping dropping other options

Posted: Mon Jul 22, 2013 6:35 pm
by chamster
Hi Martin,
So shouldn't we be able to achieve what we want (fixed shipping override free shipping) when using the free shipping over $75 as a shipping zone? Or are we better off taking a different approach to doing the free shipping? Thanks!
Bob

Re: [MOD] Stop Free Shipping dropping other options

Posted: Fri Aug 02, 2019 9:29 pm
by Martin
Minor mod to add to this one.
  1. Screen for any services that do not contain [T], [S] or [TS] in service description
  2. Discount by 1.50 (of default currency) any remaining T/S/TS services
Open: class.quote.address.shipping.php

Find:

Code: Select all

		while ($method = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$quotes = $this->getShippingMethodQuotes($method, $enableRealTime);

			if ($quotes) {
				$shippingQuotes = array_merge($shippingQuotes, $quotes);
			}
		}
Replace with:

Code: Select all

		while ($method = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$quotes = $this->getShippingMethodQuotes($method, $enableRealTime);

			if ($quotes) {

//MOD Remove all except tracked/signed options if free shipping enabled
                if(is_array($freeShippingQuotes)) {
                    $new_quotes = array();
                    foreach($quotes as $tq) {
                        if(preg_match("/\[[TS]+\]/",$tq['description'],$tqm)) {
                            $tq['price'] -= 1.5;    // Discount by £1.50
                            $new_quotes[] = $tq;
                        }
                    }
                    $quotes = $new_quotes;
                }
//MOD END
				$shippingQuotes = array_merge($shippingQuotes, $quotes);
			}
		}