Delivery options?

Locked

Started by billnally on 9 Sep 2006, 11:37 AM · Views: 2,994

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
9 Sep 2006, 11:37 AM
#1
billnally avatar

billnally

Zen Follower

Join Date:
Jan 2006
Posts:
251
Plugin Contributions:
0

Delivery options?

Hi all,
Thanks to Merlin I have added the Fedex mod to my existing Royal Mail and they are working great. I have set it up so that Royal Mail does the UK and Fedex does the EU.
My problem is that when I add to cart a product going to the UK Fedex doesn’t show on the page, which is the way I want it, but if I add to cart to the EU the Royal Mail option shows as an option at £0.00 and it can still be selected by a customer. I would rather it didn’t show up on an EU address.
I am grateful for any help
Thanks as all ways

9 Sep 2006, 2:05 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Delivery options?

You can build a function to manage the Shipping Modules based on additional criteria to more or less turn them off/on as needed ...

Currently ... you will see that the modules have a $this->enabled ... if that is false then the module does not run ...

Peek in flat.php ... you will see a function is used to control this for Free Shipping ...

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
      }

There is a catalog function zen_get_shipping_enabled and an admin function zen_get_shipping_enabled ...

The Admin function returns true ... as we are not "controlling" the module in the Admin ... so we just want it to run ...

You can make your own function based on anything you want to customize the shipping modules ...

      // disable only when entire cart is free shipping
  if (zen_get_my_shipping_test($this->code) {
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
      }
  }

The function zen_get_my_shipping_test you then write to return either true or false based on whatever critera based on the shipping module code that is passed to it ... setting the last result to true if nothing as returned false ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 4:11 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Delivery options?

You should see references to the $this->enabled

It may or may not include the code that controlls when it should show in regard to Free Shipping ...

All Shipping Modules should include this ... but not all developers of the modules look ahead to the changes in the core Zen Cart modules to see changes ...

Example:
Free Shipping has automatic adjustment on weight as weight is there or it is not ...

However, those that are based on item or price should us an additional adjustment that allows for Free Shipping for number of items and total price or the shipping is off ...

If you were to add the existing code ... be careful of how it reads, as you want just the IF statement added, not to change the actual line inside the IF ...

Compare flat.php to item.php to usps.php to see the differences ...

I have not looked at the Royal module so I don't have specifics for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 6:00 PM
#5
billnally avatar

billnally

Zen Follower

Join Date:
Jan 2006
Posts:
251
Plugin Contributions:
0

Re: Delivery options?

Yeah it does have a line for $this->enabled
$this->enabled = ((MODULE_SHIPPING_ROYALMAIL_STATUS == 'True') ? true : false);
I can’t see a mention of free delivery but I do have free delivery over £50 to the UK and Royal Mail doesn’t show up on that it also has a couple of lines about zones…

   //12 FEB 04 MBeedell	NO specified country (or *) then use this zone for all shipping rates
  if ($dest_zone == 0) {
	for ($i=1; $i<=$this->num_zones; $i++) {
	  $countries_table = constant('MODULE_SHIPPING_ROYALMAIL_ZONES_COUNTRIES_' . $i);
	  if ($countries_table == '' or $countries_table == '*') {
	    $dest_zone = $i;
	    break;
	  }
	}
  }
  if ($dest_zone == 0) {
    $error = true;
  } else {
    $shipping = -1;

But it all means nothing to me, sorry

9 Sep 2006, 6:39 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Delivery options?

The override on the Free Shipping that you are using is controlled via the Order Total Module ... Shipping ...

There are other methods to have Free Shipping such as:

0 weight when 0 weight means Free Shipping

Product is marked Always Free Shipping

Product is Virtual

For this, there is the function added to the shipping module to control:

$this->enabled = ((MODULE_SHIPPING_ROYALMAIL_STATUS == 'True') ? true : false);

So to get technical, in your case that line should read:

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
       $this->enabled = ((MODULE_SHIPPING_ROYALMAIL_STATUS == 'True') ? true : false);
      }

This would turn off the Royal Mail when a Product is marked as Always Free Shipping or a zillion other reasons ... and you would have installed the Shipping Modules Free Shipping freeshipper

That would only show when the shipping is Free and the other shipping modules should be turned off ...

Next, you have an additional condition or criteria for when to offer Royal Mail ...

This is where you can make your own function to work in a similar manner ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 8:52 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Delivery options?

Without taking the time to download the Royal Mail and figuring all this out for you ... it is really hard to break this down further ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Sep 2006, 3:29 PM
#10
billnally avatar

billnally

Zen Follower

Join Date:
Jan 2006
Posts:
251
Plugin Contributions:
0

Re: Delivery options?

Thanks again for all the help and just to let you know I think I’ve fixed it.
I was looking over this bit again (it starts on line 67)

12 FEB 04 MBeedell NO specified country (or ) then use this zone for all shipping rates
if ($dest_zone == 0) {
for ($i=1; $i<=$this->num_zones; $i++) {
$countries_table = constant('MODULE_SHIPPING_ROYALMAIL_ZONES_COUNTRIES_' . $i);
if ($countries_table == '' or $countries_table == '
') {
$dest_zone = $i;
break;
}
}
}

It seemed to say that if the zone wasn’t accepted to return a 0 so I commented out the lot and it sorted it. Now it just comes up with “No shipping available to the selected country”
Thanks again for all your help