Using One-Page Checkout with PDP (Product Delivery By Postcode) Shipping Module
If you are using my shipping module 'Product Delivery By Postcode (PDP)' https://www.zen-cart.com/showthread....-(PDP)-Support ) you need to make 2 additions to the One-Page Checkout module.
1. File includes/modules/pages/checkout_one/header_php.php
After line 203 insert
PHP Code:
// bof postcode allowed (PDP)
$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))) {
// continue as normal
} else {
$localdelivery = false;
}
if (in_array($check_delivery_postcode,explode(",", MODULE_SHIPPING_STOREPICKUP_POSTCODE))) {
// continue as normal
} else {
$storepickup = false;
}
// eof postcode allowed (PDP)
2. File includes/templates/template_default/tpl_checkout_one_default.php
Find
Code:
<h2 id="checkoutShippingHeadingMethod"><?php echo TITLE_NO_SHIPPING_AVAILABLE; ?></h2>
<div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_NO_SHIPPING_AVAILABLE; ?></div>
and change to
PHP Code:
<h2 id="checkoutShippingHeadingMethod"><?php echo TITLE_NO_SHIPPING_AVAILABLE; ?></h2>
<!--bof local delivery only alert -->
<div id="cartLocalText">
<?php
// check if product marked local delivery only is in cart
global $cart ;
$chk_local_delivery_only = $_SESSION['cart']->in_cart_check('product_is_local_delivery','1');
if ($chk_local_delivery_only) {
echo TEXT_PRODUCT_LOCAL_DELIVERY_ONLY;
}
?>
</div>
<!--eof local delivery only alert -->
<div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_NO_SHIPPING_AVAILABLE; ?></div>
Cheers / Frank
Bookmarks