Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Super_Invoice - Check customer orders count (background check)

    Hello all,

    I am close but no cigar on checking the customers orders and if greater than 1, then no action.

    Trouble I am having is getting the history of orders. Here is the code I have so far...

    PHP Code:
           $customers_orders $db->Execute("select o.orders_id, o.date_purchased
                                              from " 
    TABLE_ORDERS " o
                                              where customers_id = '" 
    . (int)$order_check->customers_id "'");
           
    $no_history = ($customers_orders->recordCount() = 1); 
    I am getting " Fatal error: Can't use method return value in write context " referring to the last line above. Any guidance would be appreciated!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Super_Invoice - Check customer orders count (background check)

    recordCount() should be RecordCount() and = should be ==

    But what are you really trying to test? If there is only 1 Order? Or if there is at least 1 Order?
    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!

  3. #3
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Super_Invoice - Check customer orders count (background check)

    Thanks - silly little things overlooked! I will work on that right now.

    Basically checking to see if it is the customer's 1st (and only) order. That way we know they are a 1st time buyer and flag them if the order is over $x.

  4. #4
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Super_Invoice - Check customer orders count (background check)

    Works great! Thanks Ajeh
    here is what I did to check customer's orders and if only 1 order and 1st time buyer...

    PHP Code:
           $customers_orders $db->Execute("select o.orders_id, o.date_purchased
                                              from " 
    TABLE_ORDERS " o
                                              where customers_id = '" 
    . (int)$order_check->customers_id "'");
           
    $no_history = ($customers_orders->RecordCount() == 1); 
    Then on the super_invoice I used $no_history to flag the customer. Use any method or special heading of your choice.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Super_Invoice - Check customer orders count (background check)

    Thanks for the update that this is working for you and the explanation of its use for you ...
    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!

  6. #6
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Super_Invoice - Check customer orders count (background check)

    I came up with another feature though that is of use - order age.

    If the customer orders list is newer than 35 days. This is within credit card billing cycle for fraud and chargebacks.

    I tested this on a dev site - seemed to work. Hard to test completely on a dev site based on the others parameter checks I have.

    PHP Code:
           $customers_orders $db->Execute("select o.orders_id, o.date_purchased
                                              from " 
    TABLE_ORDERS " o
                                              where customers_id = '" 
    . (int)$order_check->customers_id "'");
           
           
    $days35fromnow strtotime("+35 days"strtotime("<date-from-db>"));
           
    $no_history = ($customers_orders->date_purchased >= $days35fromnow); 

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Super_Invoice - Check customer orders count (background check)

    At a glance ... you have an error:
    Code:
    $no_history = ($customers_orders->date_purchased >= $days35fromnow);
    This should be:
    Code:
    $no_history = ($customers_orders->fields['date_purchased'] >= $days35fromnow);
    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!

 

 

Similar Threads

  1. Replies: 1
    Last Post: 17 Jun 2014, 07:53 PM
  2. Extra Check boxes at check out
    By issy in forum General Questions
    Replies: 7
    Last Post: 9 Oct 2009, 01:35 PM
  3. What do I edit to remove Check from Check/Money Order payment?
    By GroovyThreads in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 10 Jan 2009, 03:11 AM
  4. Hide stock count and not check for out of stock
    By microbe in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 12 Feb 2008, 12:08 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR