Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    234
    Plugin Contributions
    0

    Default Binding a payment module to more than one country zone ID

    Hi, Im using the eway payment module for credit card, it has an option in the admin to set it to function for one zone - or none at all.

    Id like to make a small change to the file for it to work within two country zones.

    If Im reading the code correctly, its checking the ‘geo zones’ against the db and deciding whether to allow the module based on what country is chosen in the admin. (and as mentioned above, the option in the admin only lets you chose one country or none at all)

    Could someone please help me rewrite this to allow the module to be based on one or more zones?

    PHP Code:
    // class methods

        
    function update_status() {
          global 
    $order$db;

          if ( (
    $this->enabled == true) && ((int)MODULE_PAYMENT_EWAY_ZONE 0) ) {
            
    $check_flag false;
            
    $check $db->Execute("SELECT zone_id FROM " TABLE_ZONES_TO_GEO_ZONES " WHERE geo_zone_id = '" MODULE_PAYMENT_EWAY_ZONE "' AND zone_country_id = '" $order->billing['country']['id'] . "' ORDER BY zone_id");
            while (!
    $check->EOF) {
              if (
    $check->fields['zone_id'] < 1) {
                
    $check_flag true;
                break;
              } elseif (
    $check->fields['zone_id'] == $order->billing['zone_id']) {
                
    $check_flag true;
                break;
              }
              
    $check->MoveNext();
            }

            if (
    $check_flag == false) {
              
    $this->enabled false;
            }
          }
        } 
    Cheers,

    Scott.
    Donation made. Enjoy those donuts! :-)

  2. #2
    Join Date
    Jan 2004
    Posts
    66,378
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Binding a payment module to more than one country zone ID

    Simply create *another* zone definition that contains *both* sets of zones you want it to work for. Then set *that* new zone in the payment module's zone restrictions.
    .

    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
    Dec 2009
    Posts
    234
    Plugin Contributions
    0

    Default Re: Binding a payment module to more than one country zone ID

    Hi DrByte, I wasnt aware that zones could actually be manipulated in that way. I'll give it a go thanks!
    Donation made. Enjoy those donuts! :-)

  4. #4
    Join Date
    Dec 2009
    Posts
    234
    Plugin Contributions
    0

    Default Re: Binding a payment module to more than one country zone ID

    Thanks Dr Byte, that did the trick.

    Just one interesting thing.. when there is only one shipping method available to a user it has a pre-selected radio button next to that one shipping option.

    For the payment module, in my case Im only allowing Paypal for certain countries - the payment module was visible as I was checking out but not 'selected' by way of a radio button or checkbox.

    I know that doesnt stop me from checking out, but I must admit, it really threw me for a few minutes - I could see the payment method and thought (incorrectly) that I had no way of selecting it.

    Just my 2c
    Donation made. Enjoy those donuts! :-)

 

 

Similar Threads

  1. Adding more than 3 Zones in Zone Rate module?
    By gabstero in forum Addon Shipping Modules
    Replies: 5
    Last Post: 3 Mar 2014, 10:54 PM
  2. Specifying more than one zone per tax rate
    By nipinuk in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 6 Aug 2009, 02:19 PM
  3. More than one shipping zone
    By LoveToBeCraftin in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Aug 2008, 10:02 PM
  4. Free shipping for more than one zone (but not all zones)
    By yonghs in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Aug 2008, 05:56 PM
  5. More than one Image Module
    By kyates in forum Customization from the Admin
    Replies: 1
    Last Post: 14 Apr 2008, 11:36 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR