Forums / Addon Shipping Modules / Product Delivery by Postcode (PDP) - [Support]

Product Delivery by Postcode (PDP) - [Support]

Views: 35,458

Results 101 to 118 of 118
29 Aug 2017, 3:32 AM
#101
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Product Delivery by Postcode (PDP) - [Support]

ewaite:

..... I pasted the code in just as described in this post and set the $ value to 250 the same as my free shipping option, but the local delivery option still shows up in delivery options. ...

Sorry, don't quite understand what you mean, can you elaborate please.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Aug 2017, 3:34 AM
#102
ewaite avatar

ewaite

New Zenner

Join Date:
Jan 2006
Location:
Dayton, Ohio USA
Posts:
56
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

[QUOTE=frank18;1260614]Assuming your minimum order value is $100

In the file includes/modules/shipping/localdelivery.php

insert

// bof: show local delivery when cart total is $100 or more 
      if (!IS_ADMIN_FLAG) { 
        if ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() > 100) { 
          $this->enabled = true; 
        } 
      } 
// eof: show local delivery when cart total is $100 or more

right after this line

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

Would there be a reason that this would not work in Version 1.5.5e. It is a clean install with just a couple plug ins added. The Local Delivery and Free Shipping work just as advertised, I am just trying to limit when Local delivery is available as an option. I pasted the code in just as described in this post and set the $ value to 250 the same as my free shipping option, but the local delivery option still shows up in delivery options no matter what the $ value of the order is.

Any help would be appreciated,
Thanks

29 Aug 2017, 3:39 AM
#103
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

[QUOTE=ewaite;1334955]> frank18:

Assuming your minimum order value is $100

In the file includes/modules/shipping/localdelivery.php

insert

// bof: show local delivery when cart total is $100 or more
if (!IS_ADMIN_FLAG) {
if ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() > 100) {
$this->enabled = true;
}
}
// eof: show local delivery when cart total is $100 or more

> 
> right after this line
> 
> ```php
$this->enabled = ((MODULE_SHIPPING_LOCALDELIVERY_STATUS == 'True') ? true : false);

Would there be a reason that this would not work in Version 1.5.5e. It is a clean install with just a couple plug ins added. The Local Delivery and Free Shipping work just as advertised, I am just trying to limit when Local delivery is available as an option. I pasted the code in just as described in this post and set the $ value to 250 the same as my free shipping option, but the local delivery option still shows up in delivery options no matter what the $ value of the order is.

Any help would be appreciated,
Thanks

It will show up if the total in your cart is **more than $100. **Or - in your case - more than $250.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Aug 2017, 3:42 AM
#104
ewaite avatar

ewaite

New Zenner

Join Date:
Jan 2006
Location:
Dayton, Ohio USA
Posts:
56
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

I have my Free shipping option set at >=250 , I would also like to set the "Local Delivery" option to only be available for specific orders >=250. The local delivery is showing as an option for any order placed within my accepted local postal codes. It is working as designed, I am just trying to make it less available.

29 Aug 2017, 3:48 AM
#105
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

ewaite:

I have my Free shipping option set at >=250 , I would also like to set the "Local Delivery" option to only be available for specific orders >=250. The local delivery is showing as an option for any order placed within my accepted local postal codes. It is working as designed, I am just trying to make it less available.

If you don't want localdelivery to show when the total in your cart is below a set amount then use this

// bof:  hide local delivery when cart total is less than $250 
      if (!IS_ADMIN_FLAG) { 
        if ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() < 250) { 
          $this->enabled = false; 
        } 
      } 
// eof: hide local delivery when cart total is less than $250  

That should do the trick for you.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Aug 2017, 12:14 PM
#106
ewaite avatar

ewaite

New Zenner

Join Date:
Jan 2006
Location:
Dayton, Ohio USA
Posts:
56
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

frank18:

If you don't want localdelivery to show when the total in your cart is below a set amount then use this

// bof: hide local delivery when cart total is less than $250
if (!IS_ADMIN_FLAG) {
if ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() < 250) {
$this->enabled = false;
}
}
// eof: hide local delivery when cart total is less than $250

> 
> That should do the trick for you.


That fixed it thanks frank18,

I tried changing that to false but I think I left the out the space.
9 Sep 2017, 12:43 AM
#107
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

If you are logged in as a customer "Store Pickup" will show on "Your Shopping Cart Contents" page when customer Postcode is NOT allowed.

Have Local delivery set to... False, not using

Have Store Pickup Shipping set to... True
Pickup Locations ...Walk In
Postcodes Allowed ...79701,79703,79704,79705,79706,79707,79713,79714,79720,79739,79741,79756,79759,79761,79762,79763,79764,79765,79766,79776,79777,79778,79782
Shipping Cost... 1.80
Tax Class --none--
Tax Basis... Shipping
Shipping Zone --none--
Sort Order... 0

Is "Store Pickup" supposed to show as available on "Your Shopping Cart Contents" page when you are logged in as a customer and customer is outside the pickup area?
My shopping cart TEXAS is showing "Store Pickup (Walk In)" available for customer in AB Canada.
Once you click on the "Checkout Page" "Store Pickup (Walk In)" is not available as it should be.

Does anyone know how to fix?

9 Sep 2017, 12:56 AM
#108
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

EZorb:

If you are logged in as a customer "Store Pickup" will show on "Your Shopping Cart Contents" page when customer Postcode is NOT allowed.

Have Local delivery set to... False, not using

Have Store Pickup Shipping set to... True
Pickup Locations ...Walk In
Postcodes Allowed ...79701,79703,79704,79705,79706,79707,79713,79714,79720,79739,79741,79756,79759,79761,79762,79763,79764,79765,79766,79776,79777,79778,79782
Shipping Cost... 1.80
Tax Class --none--
Tax Basis... Shipping
Shipping Zone --none--
Sort Order... 0

Is "Store Pickup" supposed to show as available on "Your Shopping Cart Contents" page when you are logged in as a customer and customer is outside the pickup area?
My shopping cart TEXAS is showing "Store Pickup (Walk In)" available for customer in AB Canada.
Once you click on the "Checkout Page" "Store Pickup (Walk In)" is not available as it should be.

Does anyone know how to fix?

The shipping estimator page has been left unchanged, so, yes it will show there even if an address way outside the defined local delivery (store pickup) range is selected in the dropdown.

If that is an issue, you would need to hack into a ZC core file, namely includes/modules/shipping_estimator.php .

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Sep 2017, 2:23 AM
#109
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

frank18:

The shipping estimator page has been left unchanged, so, yes it will show there even if an address way outside the defined local delivery (store pickup) range is selected in the dropdown.

If that is an issue, you would need to hack into a ZC core file, namely includes/modules/shipping_estimator.php .

It just makes your Plugin look a little strange to offer Store Pick when customer is too far away to pick up. **Shouldn't the core be changed permanently? **Didn't the original plugin also do this?
Anyway it does not cause this problem on the Checkout page, thank you for that.

9 Sep 2017, 2:30 AM
#110
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

EZorb:

It just makes your Plugin look a little strange to offer Store Pick when customer is too far away to pick up. **Shouldn't the core be changed permanently? **Didn't the original plugin also do this?
Anyway it does not cause this problem on the Checkout page, thank you for that.

Could also be done in includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php which is not a core file. Need to look into that if/when I get some spare time (scarce these days).

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Sep 2017, 2:50 AM
#111
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

frank18:

Could also be done in includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php which is not a core file. Need to look into that if/when I get some spare time (scarce these days).

I think the ZenCart Core Gods should ask you if they could replace the original with your plugin that is now a very useful plugin. Thank goodness we have started to moved from the green-cart to a very professional looking responsive shopping cart. Just my two cents.

9 Sep 2017, 10:44 AM
#112
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

@Ezorb

Larry, if you need to get this working, open includes/modules/shipping_estimator.php and find (around line 139):

  $shipping_modules = new shipping; 
  $quotes = $shipping_modules->quote();

now BACKUP!

Change that to

  $shipping_modules = new shipping;
  
// bof show/hide Store Pickup or Local Delivery Only module (PDP) -- frank18 20170909
  $check_delivery_postcode = $order->delivery['postcode'];

  // shorten UK / Canada postcodes to use first part only
  $check_delivery_postcode = zen_get_UKPostcodeFirstPart($check_delivery_postcode);

    // now check db for allowed postcodes and enable / disable relevant shipping modules
      if (!in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_LOCALDELIVERY_POSTCODE))) {
         $localdelivery = false;
      }
      
      if (!in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_STOREPICKUP_POSTCODE))) {
         $storepickup = false;
      }
// eof show/hide Store Pickup or Local Delivery Only module (PDP) -- frank18 20170909
  
  $quotes = $shipping_modules->quote();

I tested this and it works fine on the shopping cart page.

Cheers / Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Sep 2017, 7:03 PM
#113
ezorb avatar

ezorb

Zen Follower

Join Date:
Apr 2006
Location:
Midland TX
Posts:
426
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

frank18:

@Ezorb

Larry, if you need to get this working, open includes/modules/shipping_estimator.php and find (around line 139):

$shipping_modules = new shipping;
$quotes = $shipping_modules->quote();

> 
> now BACKUP!
> 
> Change that to
> 
> ```php
  $shipping_modules = new shipping;
  
// bof show/hide Store Pickup or Local Delivery Only module (PDP) -- frank18 20170909
  $check_delivery_postcode = $order->delivery['postcode'];

  // shorten UK / Canada postcodes to use first part only
  $check_delivery_postcode = zen_get_UKPostcodeFirstPart($check_delivery_postcode);

    // now check db for allowed postcodes and enable / disable relevant shipping modules
      if (!in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_LOCALDELIVERY_POSTCODE))) {
         $localdelivery = false;
      }
      
      if (!in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_STOREPICKUP_POSTCODE))) {
         $storepickup = false;
      }
// eof show/hide Store Pickup or Local Delivery Only module (PDP) -- frank18 20170909
  
  $quotes = $shipping_modules->quote();

I tested this and it works fine on the shopping cart page.

Cheers / Frank

Works Great Frank. Thank you very much for taking the time.

To all installing Franks fix don't forget to install in My Custom Template folder.

Larry

10 Sep 2017, 1:32 AM
#114
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

EZorb:

Works Great Frank. Thank you very much for taking the time.

To all installing Franks fix don't forget to install in My Custom Template folder.

Larry

Thanks Larry, forgot to mention that.

So, to clarify, open includes/modules/shipping_estimator.php, make the changes as per above and save the modified file to includes/modules/YOUR_TEMPLATE/shipping_estimator.php

This way you override the core file without making changes to that core file.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

10 Sep 2017, 3:39 AM
#115
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

I have submitted version 1.5.0 for approval. It contains the changes suggested in posts #112 and #114 of this thread. Also removed the manual sql install file and added its content to includes/modules/shipping/localdelivery.php.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

17 Sep 2017, 8:47 PM
#116
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Product Delivery by Postcode (PDP) - [Support]

PDP 1.5.0 is now available for download from https://www.zen-cart.com/downloads.php?do=file&id=1702

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

8 Aug 2019, 9:47 PM
#117
cottageoven avatar

cottageoven

New Zenner

Join Date:
Jul 2019
Location:
Florida
Posts:
13
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

Is this module dead?

I have downloaded it and it says that it is built around a module called "Local Delivery" which MUST be installed for it to work, but I can't find a "Local Delivery" module anywhere and the last post in this support thread was almost two years ago.

If this module can no longer be made to work because the dependency cannot be satisfied, then is there anything in the current version or currently working modules that would give the capability of "Local Delivery" and NOT "Shipping"? My business is a cottage-food business and is not allowed to ship, but IS allowed to deliver, so I cannot use any shipping options the way things are currently configured.

Thanks.

11 Apr 2020, 7:00 AM
#118
sydmich avatar

sydmich

New Zenner

Join Date:
Jun 2007
Location:
Australia
Posts:
60
Plugin Contributions:
0

Re: Product Delivery by Postcode (PDP) - [Support]

Hi, I have just done a fresh install of zc version 1.5.6 and using the new bootstrap template. Does anyone know if this PDP works on this version?
I really need to set specific products to local delivery as seperate shipping rates applies to these products that are local delivery only. Any help appreciated.