Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2008
    Posts
    9
    Plugin Contributions
    0

    Default can shipping type force payment type?

    I travel frequently to do trade shows. At these shows I offer a discount for preorders, with a down payment necessary.

    I can easily clone the free shipping module to make a 'pick up at the trade show' shipping method. And I can (probably) use the Installment Plan Payment Module to make a 'preorder discount + downpayment' payment method.

    What I would like, is if the customer selects regular shipping the payment screen will show payment options of credit card and money order but not preorder discount, and if the customer selects pickup as the shipping method the payment screen will show preorder discount but not credit card or money order.

    Will this even be possible? Or should I hunt for some other way to set this all up?

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

    Default Re: can shipping type force payment type?

    If you use the "Store Pickup" module for the trade show pickup, you could edit the update_status() function in the desired payment module so that it would disable itself if the shipping method is not set to "storepickup".

    Basically, adding a line akin to this (depending on a number of factors):
    Code:
            if ($_SESSION['shipping'] == 'storepickup_storepickup') $check_flag = false;
    
            if ($check_flag == false) {
              $this->enabled = false;
            }
    Something like that should point you in the right direction.
    .

    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
    Feb 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: can shipping type force payment type?

    First of all, thanks for cluing me in about the store pickup module. I hadn't even thought to check if there was one pre-built into zencart.

    The solution you gave doesn't ~quite~ work. That block of code is inside a check for zones. Since I am not using zones, it never executes that part of the code. If I set the flag before that block it will only get set back when the zones are checked.

    But now that I knew what to look for, I was able to find another thread that addressed the issue. http://www.zen-cart.com/forum/showthread.php?p=343559 Its the same general idea but instead of setting the flag, your setting the enables itself. Put that in right before the block of code that checks zones and it all works fine.

    Oh, and it should be $_SESSION['shipping']['id'] and not just $_SESSION['shipping']

    Another thread that helped with my solution was http://www.zen-cart.com/forum/showthread.php?t=77374

 

 

Similar Threads

  1. Can payment type be changed after order is final?
    By carol2848 in forum General Questions
    Replies: 2
    Last Post: 11 Apr 2011, 11:24 AM
  2. Replies: 2
    Last Post: 8 Apr 2011, 10:21 AM
  3. Link shipping to payment module type???
    By mikestaps in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 6 Jan 2011, 11:14 PM
  4. Payment method based on shipping type?
    By celticwebsolutions in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 12 Dec 2010, 11:25 AM
  5. force shipping type by item, limiting some product to certain countries
    By fishingmaniac in forum Built-in Shipping and Payment Modules
    Replies: 22
    Last Post: 7 Jan 2010, 12:02 AM

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