Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Location
    Oz
    Posts
    31
    Plugin Contributions
    0

    Default Payment Choices based on Shipping

    Hi all
    I have searched through the forum for a solution but can't find anything. Help please.

    I have a situation where If a customer selects 'store pickup' option in shipping
    then goes to payment, I want to be able to have one payment method eg. 'Pay on Pickup'.

    I have setup the shipping and payment options but can't see how I can limit the payment options to this one option.
    or
    Not have the 'Pay on Pickup' show for customers that select any other shipping method.(probably closer to what i'm trying to say)

    Any Ideas or a nudge in the right direction would be most appreciated.

    Thanks

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

    Default Re: Payment Choices based on Shipping

    Assuming you "have" a payment method called "Pay on Pickup", you could restrict it to only be available/active when the "store pickup" shipping method is selected by setting this within the class constructor of the pay-on-pickup module:

    Code:
     $this->enabled = (($_SESSION['shipping']['title'] = 'storepickup') ? true : false);
    Haven't checked for sure, but I suspect the 'storepickup' reference might need to be 'storepickup_storepickup'
    .

    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
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Payment Choices based on Shipping

    Note: for clarity and to avoid issues between the Catalog and Admin, often times it is helpful to build a function to manage this test ...

    Then, add a matching function for the Admin where it returns true ... this allows the same function call to run on both the Catalog side and allow the Admin ... Modules ... Payments ... to run on the Admin ...

    You might peek at how the Shipping Modules manage this type of function ... peek at:
    /includes/modules/shipping/item.php
    PHP Code:
          // disable only when entire cart is free shipping
          
    if (zen_get_shipping_enabled($this->code)) {
            
    $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true false);
          } 
    Find the function zen_get_shipping_enabled in the Catalog and the function zen_get_shipping_enabled in the Admin and notice how they differ ...

    You are building something similar to manage the $this->enabled for the Payment modules ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jun 2006
    Location
    Oz
    Posts
    31
    Plugin Contributions
    0

    Default Re: Payment Choices based on Shipping

    What can I say... but THANK YOU.

    It worked Brilliantly DrByte and thanks Ajeh for your advice.

 

 

Similar Threads

  1. Shipping based on payment method
    By Prorad in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 30 Oct 2009, 01:43 PM
  2. Attribute choices appear based on previous selection
    By RilKen27 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 24 Oct 2009, 04:23 PM
  3. How can I restrict shipping choices based on kinds of products in the cart?
    By bladerogers in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 14 Sep 2009, 03:51 AM
  4. Payment based on shipping method?
    By Jeff G in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 23 Nov 2008, 10:48 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