Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 47
  1. #31
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Does the product_id have to be there though? What if I've no way of knowing what they're intending to buy?

  2. #32
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Would this work on it's own?

    if ($_SESSION['customer_id'] == 4959) {

  3. #33
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Quote Originally Posted by limelites View Post
    Would this work on it's own?

    if ($_SESSION['customer_id'] == 4959) {

    Confirmed, this does work well. Can I pick your brains one last time on this topic and ask, what is the correct syntax for this?

    if ($_SESSION['customer_id'] == 4959 AND 1234 AND 2345 AND 3456) .... . .. . etc?

    So, if I want to enable PayPal for three or four customers at a time?

  4. #34
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Quote Originally Posted by limelites View Post
    Confirmed, this does work well. Can I pick your brains one last time on this topic and ask, what is the correct syntax for this?

    if ($_SESSION['customer_id'] == 4959 AND 1234 AND 2345 AND 3456) .... . .. . etc?

    So, if I want to enable PayPal for three or four customers at a time?
    There are several way of doing this, but this is probably the easiest to follow/understand:

    Code:
    if ( ($_SESSION['customer_id'] == 4959)  ||   ($_SESSION['customer_id'] == 1234)    ||   ($_SESSION['customer_id'] == 3456) ) { 
    
    Do stuff ;
    
    }
    If there are a LOT of customers you wish to check for, then placing them in an array and using a loop structure would be a better solution:

    Code:
    $customerIDs = array(4959, 1234, 4567, 9999) ;
    
    $i = 0 ; $flag = 0 ; 
    while ($i < sizeof($customerIDs)) { 
    
    if ($_SESSION['customer_id'] == $customerIDs[$i])  $flag = 1 ; 
    
    $i++ ; 
    
    }
    
    if ($flag == 1)  { 
    
    echo "We have a match" ; 
    }

    Cheers
    Rod

  5. #35
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    or you could try...


    PHP Code:
    if (in_array($_SESSION['customer_id'], array(4959123445679999))) {

    do 
    something;



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

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    limelites, why do you keep changing the rules? First it was a certain product, then it was a certain product with another certain product, now it's for a certain customer.

    If the rules keep changing, why not just have NO rules, and turn the module off when you're not needing it, and turn it back ON again for a few hours when you've got a certain customer who needs/wants to use it?

    It seems like you're making your business far more complicated than it needs to be.
    .

    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.

  7. #37
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Thanks RodG and Gilby. Both solutions work well and have been implemented on the website. Perfect!

    It's complicated Dr.Byte, I know. The rules change usually as the situation changes. At first we had customers wishing to pay for specific items with PayPal so my initial thought was obviously enabling PayPal for a certain product only. Yesterday, I had one individual customer wanting to pay with PayPal on an unkonwn product. Now, at this moment in time I have three new customers wanting to pay with PayPal. My thoughts have obviously now moved towards allowing specific customers to use it (which in hindsight would have been best anyway).

    I'd hate to enable PayPal on the off chance that a customer is going to be online at any give time. When a customer asks to pay with PayPal then there's no telling when they'll actually be there, ready to proceed to the checkout. If I were to enable it on the off-chance that they're likely to checkout in the next hour then who's to say other customers won't use it too? What if it takes the customer a few days to get back? By that time dozens of customers have used it. It's much better this way as I really hate PayPal and we only take PayPal payments if we're specifically asked. Their fees are outrageous and I've had bad experiences with them in the past when we traded on eBay. I don't like giving them any of our business as I'd be quite happy if everyone else did the same.

    Anyway, look on the bright side. Now anyone searching this forum will find how to enable PayPal for either/or specific products or specific customers :)
    Last edited by limelites; 30 Apr 2013 at 07:33 AM.

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

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Quote Originally Posted by limelites View Post
    I really hate PayPal and we only take PayPal payments if we're specifically asked.
    ...
    I don't like giving them any of our business ...
    Those statements sound like you're focused on what *you* want instead of what your *customers* want. That's a delicate line to walk. Most professionals would advise you to openly offer the options that your customers want to use, not to penalize your customers because you have a certain bent against a particular thing your customers happen to prefer. After all, isn't one of your goals to get your customers to pay as easily and conveniently as is possible for them?

    NOTE: I am NOT inviting a philosophical debate here on whether one should accept PayPal or not. And I don't think the rest of the world needs you to post any of the gory details of your bad experiences. Please don't do that.
    I'm merely pointing out what feels like a flaw in your focus. Take it or leave it. I don't care which way you choose ... just wanted to draw your attention to it from the customers' angle. Don't take this discussion in the direction of hating/loving certain providers. That doesn't do anybody any good. Again, I was ONLY pointing out an observation.
    .

    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.

  9. #39
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Quote Originally Posted by gilby View Post
    or you could try...


    PHP Code:
    if (in_array($_SESSION['customer_id'], array(4959123445679999))) {

    do 
    something;


    I like this one better than both mine. :)

    This reminds me a little of my very early days in computing, where we used to have little competitions to see who could write the most efficient or interesting code for a very specific task.

    My best effort was a one line code of BASIC on a CommodoreC128 that produced a TV style test pattern on screen (consisting of a square grid background, with a circle overlay, and the 7 standard color bars).

    My things have changed since then. :)

    Cheers
    Rod

  10. #40
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Enable PayPal but Only when Product ID 1234 is in cart?

    Thanks Dr.Byte and don't worry, I won't be opening that can of worms. I appreciate what you're saying but it's not a decision I took lightly. We take all major credit/debit cards which seems to work well as we're super busy and sales are really pouring in so there are no complaints in that department. If someone has a PayPal account then the chances are they'll have a debit or credit card too :)

    I have my own personal reasons for not taking PayPal but I also have good, business reasons. (1) I don't like their outrageous fees. (2) I don't like leaving my company open to fraudsters who use PayPal rules to their benefit and run PayPal reversals on us whenever they think they'll get away with it. (3) I don't like the stigma associated with PayPal as soon as customers see it they assume you're some shoddy eBay seller with a website.

    PayPal has a bad reputation amongst buyers as well as sellers. I don't think I'm the only consumer who assumes that a website taking PayPal is usually a website that's been put together by a less than professional company. Most large companies don't take PayPal. You ever asked yourself why?

    Like you, I don't really want to get into a big debate about the pros and cons of taking PayPal but I thought I'd let you know my professional reasons. Personal reasons aside :)

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. disable flat rate shipping for paypal only (but enable for googlecheckout)
    By btman in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 14 Jul 2009, 05:51 AM
  2. When I enable Featured products, only one product is displayed.
    By creativearc in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 6 May 2008, 01:30 AM
  3. Product info shifts left when mouse over nav buttons, but only in IE !
    By bigbadbob in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Mar 2008, 08:32 AM
  4. Show quantity in cart only when the product is already in shopping cart
    By e81ny in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 8 Sep 2007, 03:34 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