Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    30
    Plugin Contributions
    1

    Default I want No PAYPAL for PARCEL POST shipping option.

    Hi Everyone,
    Was wondering if someone could help me out with a small problem i cant work out.

    I want to disable paypal for one shipping type only.
    Is there a way to do this simply or will i have to mod some php??

    www.glossi.com.au

    Also some constructive criticism always goes a long way.

    -Jai

  2. #2
    Join Date
    May 2006
    Posts
    30
    Plugin Contributions
    1

    Default Re: No PAYPAL for PARCEL POST shipping option.

    The line i'm looking at in the paypal module is

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


    just a little unsure what to do with it

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: No PAYPAL for PARCEL POST shipping option.

    In that same file, a few lines lower, is a function for update_status(). Add your shipping-module check there by adding the new code shown:
    Code:
      function update_status() {
        global $order, $db;
    
        if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_ZONE > 0) ) {
          $check_flag = false;
          $check_query = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
          while (!$check_query->EOF) {
            if ($check_query->fields['zone_id'] < 1) {
              $check_flag = true;
              break;
            } elseif ($check_query->fields['zone_id'] == $order->billing['zone_id']) {
              $check_flag = true;
              break;
            }
            $check_query->MoveNext();
          }
    
          // disable for certain shipping module only:
          if ($_SESSION['shipping'] == 'name_of_code_from_shipping_module') $check_flag = false;
    
          if ($check_flag == false) {
            $this->enabled = false;
          }
        }
      }
    For name_of_code_from_shipping_module check the $this->code = 'blahblah' line near the top of the shipping module file that represents the shipping module you're wanting to restrict for.
    Granted, if your shipping module generates various different $_SESSION['shipping'] values depending on which offered service the customer selects, you may have to alter the logic in that "if" statement to accomodate.
    .

    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.

  4. #4
    Join Date
    May 2006
    Posts
    30
    Plugin Contributions
    1

    Default Re: I want No PAYPAL for PARCEL POST shipping option.

    Thanks for the reply DrByte.

    I am slightly understanding these functions, and this is the following code i have.

    PHP Code:
        function update_status() {
        global 
    $order$db;

        if ( (
    $this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_ZONE 0) ) {
          
    $check_flag false;
          
    $check_query $db->Execute("select zone_id from " TABLE_ZONES_TO_GEO_ZONES " where geo_zone_id = '" MODULE_PAYMENT_PAYPAL_ZONE "' and zone_country_id = '" $order->billing['country']['id'] . "' order by zone_id");
          while (!
    $check_query->EOF) {
            if (
    $check_query->fields['zone_id'] < 1) {
              
    $check_flag true;
              break;
            } elseif (
    $check_query->fields['zone_id'] == $order->billing['zone_id']) {
              
    $check_flag true;
              break;
            }
            
    $check_query->MoveNext();
          }

          
    // disable for certain shipping module only:
          
    if ($_SESSION['shipping'] == 'auspost'$check_flag false;

          if (
    $check_flag == false) {
            
    $this->enabled false;
          }
        } 
    But for some reason, the paypal module is still showing up after i click continue with "auspost" selected.

 

 

Similar Threads

  1. v150 I want to inclue a shipping fee option for air of $25.00 what am I to do
    By RonGin in forum Addon Shipping Modules
    Replies: 6
    Last Post: 9 Dec 2013, 01:59 AM
  2. International Parcel post issue
    By stevebrett in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 26 Jan 2011, 10:55 PM
  3. Want to skip coupon option for PayPal Express Checkout users
    By emtecmedia in forum PayPal Express Checkout support
    Replies: 0
    Last Post: 28 Jan 2009, 06:38 AM
  4. USPS Parcel Post Rate question
    By dhan99 in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 13 Aug 2007, 01:00 AM

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