Community Forums

Hide UPS Ground [Solved]

Support for Shipping extensions

Hide UPS Ground [Solved]

Postby NoJoke » Tue Jan 17, 2012 8:51 pm

Is it possible to hide UPS Ground when a product is eligible for free shipping?
Last edited by NoJoke on Thu Jan 26, 2012 12:53 am, edited 3 times in total.
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby NoJoke » Thu Jan 19, 2012 9:30 pm

Is there anyway to complete this or am I hoping to high?
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby NoJoke » Sun Jan 22, 2012 6:06 pm

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.
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 2: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 2:39 am, edited 1 time in total.
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 2:18 am

would this still work if i am not using the subtotal and it as a per item basis?
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 2: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.
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 2:37 am

Hey NoJoke,

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


Joel.
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 2: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.
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 2: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
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 2: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.
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 3: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 3:23 am, edited 2 times in total.
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 3: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?
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 3: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)?
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 3: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.
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 3: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).
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 3:20 am

I implemented the code above and it removes all of the UPS shipping options not just ground
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 3: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.
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground

Postby NoJoke » Mon Jan 23, 2012 3:26 am

That works.. thanks for the help I appreciate it
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Re: Hide UPS Ground

Postby OpenCart Addons » Mon Jan 23, 2012 3:27 am

No problem.

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


Joel.
User avatar
OpenCart Addons
 
Posts: 511
Joined: Thu Nov 24, 2011 2:51 am

Re: Hide UPS Ground [Solved? Maybe]

Postby NoJoke » Tue Jan 24, 2012 7:32 am

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.
NoJoke
 
Posts: 162
Joined: Thu Oct 13, 2011 9:37 pm

Next

Return to Shipping

Who is online

Users browsing this forum: No registered users and 1 guest

Hosted by Arvixe Web Hosting