Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Sep 2012
    Posts
    2
    Plugin Contributions
    0

    Default Adding a postcode check to checkout.

    Hello,

    I'm quite new to zen cart and website creating in general.
    I'm making a website (based on brighton pets template) that offers a delivery service but can only delivery to people within a certain range of travel.

    I already have a postcode checker on the site where people can enter their postcode and check if they are within our area (this is checked by a php script).

    However, I'd like to add this scripted check to the checkout so that it is not possible for people outside of the delivery area to complete their checkout.

    Can anyone point me in the right direction towards achieving this?

    Any help would be much appreciated.

    David

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Adding a postcode check to checkout.

    Add your custom code for verifying shipping addresses ... into your shipping module.

    The update_status() function there would be the best place. If the postcode doesn't pass the test, then set $this->enabled to false, and the module won't be available for checkout, thus preventing checkout.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2012
    Posts
    2
    Plugin Contributions
    0

    Default Re: Adding a postcode check to checkout.

    Thanks very much for the advice. I think that approach will work.
    Do you know how I can access the customers postcode information from within the shipping module's php file?

    Thanks again!

    David

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Adding a postcode check to checkout.

    $order->delivery['postcode']
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 2
    Last Post: 28 Jun 2012, 10:13 AM
  2. Check box not adding to price
    By Dave G in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 Sep 2009, 02:23 AM
  3. adding an check graphic to echeck section in checkout?
    By malice95 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Aug 2009, 06:53 AM
  4. Check Box in Checkout
    By Tagyourbaby in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Jul 2009, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg