Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    29
    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
    29
    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
    60,707
    Blog Entries
    4
    Plugin Contributions
    149

    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!
    Donations always welcome: www.zen-cart.com/donate

    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
    29
    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. Parcel Shipping Manager
    By shippingmanager in forum Addon Shipping Modules
    Replies: 15
    Last Post: 21 Apr 2010, 08:11 PM
  2. USPS Parcel Post Calculation Incorrect
    By elgrcg in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 27 Mar 2008, 03:22 AM
  3. 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
  •