Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    3
    Plugin Contributions
    0

    Default Payment module allowed depending on weight?

    We have shipping rates set up based on product weight (and 5 different shipping Zones).

    Our customers have 2 payment module choices (money order and cod), and because of the extra fees we get charged for using cod we'd like to only allow it for shipments over a certain weight.

    THis might not make complete sense, but there are more boring details about Norwegian Postal Services I don't really want to go into right now...


    The gist of what we want is:

    Over 500 grams total weight = choice of 2 payment methods
    Under 500 grams total weight = only one payment method allowed (money order).

    Is this possible?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Payment module allowed depending on weight?

    Two ways to tackle this:
    1. rewrite the code to set a handling fee for COD orders, which helps you recover the costs of COD shipping.
    2. rewrite the code to detect the weight of items in the cart and enable/disable COD based on the value

    To use #2 above, edit the modules/payment/cod.php file:
    around line 61 you see:
    Code:
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
    add a few lines of code below it, starting on line 65:
    Code:
          if ($_SESSION['cart']->weight < 500) {
            $this->enabled = false;
          }
    This says ... if the weight of the items in the cart is under 500, then disable this module (in this case, COD).
    Change the "500" to whatever suits your needs.
    .

    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
    Nov 2005
    Posts
    43
    Plugin Contributions
    0

    Default Re: Payment module allowed depending on weight?

    I added this code to my 1.3.0.2 shop and it worked perfectly. However I´m now upgrading to 1.3.6 and the code doesn´t seem to result in enable/disable COD like it does in 1.3.0.2.

    Any ideas if the code should be adapted to zen 1.3.6? Thanks.

 

 

Similar Threads

  1. Shipping Weight Payment Module
    By outeredge2 in forum Addon Shipping Modules
    Replies: 14
    Last Post: 22 Jul 2010, 11:08 PM
  2. Transfirst Payment Module + Shipping Weight
    By kaiyiwong in forum Addon Payment Modules
    Replies: 0
    Last Post: 24 Jun 2009, 10:50 PM
  3. Payment module allowed depending on shipping option?
    By bondee in forum General Questions
    Replies: 0
    Last Post: 25 Oct 2007, 11:46 PM
  4. HELP with payment module - Allowed memory size of 8388608 bytes exhausted
    By Nick_Sonick in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 20 Jun 2007, 04:47 PM
  5. Delivery and payment options depending on weight
    By carol in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 9 Nov 2006, 04:03 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