Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free domestic shipping - not international


Yikes

Recommended Posts

Morning!

 

 

What I have been trying to do (and others, as well, but with similar luck) is to limit the free shipping to the store country.

 

There are two avenues I have been following, but I need help.

 

The first:

 

I noticed a bit of code in includes/modules/order_total/ot_shipping.php that might be a clue.

 

function process() {

      global $order, $currencies;

 

      if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {

        switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

          case 'national':

            if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;

          case 'international':

            if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = false; break;

          case 'both':

            $pass = true; break;

          default:

            $pass = false; break;

        }

 

I have tried playing around with the international case settings, but am not getting anywhere. Is this bit of code a possible way to limit free shipping, or am I just out there?

 

 

The second:

I have been been fiddling around with freeamount shipping -- which allows a free shipping option when a threshold purchase amount is met. (freeamountv2-p1)

 

In the freeamount.php file, this code appears:

 

function quote($method = '') {

      global $cart;

 

  if (( $cart->show_total() < MODULE_SHIPPING_FREECOUNT_AMOUNT ) && MODULE_SHIPPING_FREECOUNT_DISPLAY == 'False')

  return;

 

      $this->quotes = array('id' => $this->code,

                            'module' => MODULE_SHIPPING_FREECOUNT_TEXT_TITLE);

 

      if ( $cart->show_total() < MODULE_SHIPPING_FREECOUNT_AMOUNT )

        $this->quotes['error'] = MODULE_SHIPPING_FREECOUNT_TEXT_WAY;

      else

  $this->quotes['methods'] = array(array('id'    => $this->code,

                                              'title' => MODULE_SHIPPING_FREECOUNT_TEXT_WAY,

                                              'cost'  => 0));

 

I have tried adding another condition:

OR ($order->delivery['country_id'] != STORE_COUNTRY) in a couple of places and all that happens is I get one of three results: (1) no display whatsoever for domestic or international customers about the free shipping, (2) display for all customers but not selectable (the "error" option), or (3) all customers can use free shipping, regardless of country.

 

Well, I know a lot of people are still hoping for a solution to this, and I <i>hope</i> I have given someone an idea -- someone with a little more php savvy than myself! ;)

 

Best,

Yikes!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...