Post by NoJoke » Wed Jan 18, 2012 4:51 am

Is it possible to hide UPS Ground when a product is eligible for free shipping?
Last edited by NoJoke on Thu Jan 26, 2012 8:53 am, edited 3 times in total.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by NoJoke » Fri Jan 20, 2012 5:30 am

Is there anyway to complete this or am I hoping to high?

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by NoJoke » Mon Jan 23, 2012 2:06 am

I know that /catalog/model/shipping/ups.php has the code in in that needs to be hidden. The code in that file that controls ups ground is :

Code: Select all

$service_code = array(
				// US Origin
				'US' => array(
					'01' => $this->language->get('text_us_origin_01'),
					'02' => $this->language->get('text_us_origin_02'),
					'03' => $this->language->get('text_us_origin_03'),

What can I add to that to disable '03' if free shipping is enabled on a certain product that is checked out. Because I am going to be using the Free Shipping Module for free ground shipping on products and there is no need for both to be displayed if the product has free ground shipping.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 10:17 am

Hey, you could always do this:

*Edit: Nevermind, realised this was only removing the language loading*
Last edited by OpenCart Addons on Mon Jan 23, 2012 10:39 am, edited 1 time in total.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Mon Jan 23, 2012 10:18 am

would this still work if i am not using the subtotal and it as a per item basis?

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by NoJoke » Mon Jan 23, 2012 10:28 am

I changed the code to do what I think I want it to do for me, however, even if the code above is impletmented the option does name does dissappear but not the price. If there is no free ship the shipping option name is gone.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 10:37 am

Hey NoJoke,

What module are you using to get free shipping on a certain product?


Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Mon Jan 23, 2012 10:40 am

I am using cart version 1.4.9.6 and it comes with the software and it is just the free shipping module that is in the extensions.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 10:44 am

Okay, I will take a look.

You will have to put the previous mentioned changes back, as they're only referencing the language loading. Didn't even realise it when I was writing it. Also, I was making reference to v1.5.1.3 so I'm not sure if anything has changed since v1.4.9.6

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Mon Jan 23, 2012 10:56 am

Basically I am using the free shipping module as free ground shipping, thus UPS ground does not need to be displayed if the product being checked out has free shipping.

Instead of using the subtotal method currently we are selecting the products that we want to have free shipping.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 11:00 am

In catalog / model / shipping / ups.php

Find:

Code: Select all

if ($this->config->get('ups_' . strtolower($this->config->get('ups_origin')) . '_' . $code)) {
Replace With:

Code: Select all

if (strtolower($this->config->get('ups_origin')) == 'us' && $code == '03') {
							if ($this->config->get('free_product')) {
								$products = unserialize($this->config->get('free_product'));

								foreach ($this->cart->getProducts() as $product) {
									if (in_array($product['product_id'], $products)) {
										if ($this->config->get('free_inclusive')) {
											$free_status = true;
											break;
										} else {
											$status = false;
										}
									} else {
										if (!$this->config->get('free_inclusive')) {
											$free_status = true;
											break;
										} else {
											$free_status = false;
											break;
										}
									}
								}
							}
						} else {
							$free_status = false;
						}
						
						if ($this->config->get('ups_' . strtolower($this->config->get('ups_origin')) . '_' . $code) && !$free_status) {
Last edited by OpenCart Addons on Mon Jan 23, 2012 11:23 am, edited 2 times in total.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by OpenCart Addons » Mon Jan 23, 2012 11:01 am

NoJoke wrote:Basically I am using the free shipping module as free ground shipping, thus UPS ground does not need to be displayed if the product being checked out has free shipping.

Instead of using the subtotal method currently we are selecting the products that we want to have free shipping.
How are you selecting them? Are you just selecting that no shipping is required on those products?

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Mon Jan 23, 2012 11:03 am

In the module there is a box that says :" Choose specific products that this shipping method will apply to, based on the inclusive setting. Select no products to apply method to entire cart."

So i select the products that I want free shipping on and it allows it to display those with free shipping

Where is the above code being placed at ( which file)?

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 11:09 am

Ah I see what you mean, give me a minute and I'll update the previous edit to include the proper changes.

Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by OpenCart Addons » Mon Jan 23, 2012 11:18 am

See the changes in the above post. This should turn off UPS Ground if a product qualifies for free shipping.

This is assuming the origin is US and the code is 03 (Which I believe is ground shipping).

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Mon Jan 23, 2012 11:20 am

I implemented the code above and it removes all of the UPS shipping options not just ground

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 11:24 am

Hey NoJoke,

Sorry, it's getting late so my brain isn't functioning fully. I updated the code above, try replacing it with that.

I forgot to call an else statement that would define $free_status = false; if the code wasn't ground.

Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Mon Jan 23, 2012 11:26 am

That works.. thanks for the help I appreciate it

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by OpenCart Addons » Mon Jan 23, 2012 11:27 am

No problem.

Sorry for all the messages back and forth. Like I said, my brain isn't cooperating right now.


Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by NoJoke » Tue Jan 24, 2012 3:32 pm

One quick thing that I am asking here.. it seems that when I am trying to set a zone to get this to not appear if they aren't in that zone isnt working.

It seems to be still allowing the free shipping for people that aren't in the zone. Not sure what is going on or if this has anything to do with that.

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am
Who is online

Users browsing this forum: No registered users and 2 guests