Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2007
    Location
    Manchester, England
    Posts
    168
    Plugin Contributions
    0

    Default Order Number: 0??

    Hi guys,

    I've developed a bespoke function for Zen Cart, where users are given 3 levels which interlink to two types of products. Each user level means they can only purchase a certain combination of products.

    For instance, if we had product type A and product type B:

    Level 1 can purchase A and B, but once
    Level 2 can purchase B
    Level 3 can purchase A and B forever.


    Anyway, to get to the point, for a reason I have really no idea about, when a level 1 or 2 customer buys a product, they get an email saying:

    "Thanks for shopping with us today!
    The following are the details of your order.
    ------------------------------------------------------
    Order Number: 0"

    Which struck me as really odd.


    I checked the database and noticed the order had indeed been added to the database, but it doesn't show up in the admin area! The 3rd level gets an email with the correct order ID, but that order doesnt show either.

    I just need to know, in general terms, what would prevent the order being pushed out of the database into the admin? For the time being, I'm using Cash on delivery and free shipping modules so I can test quickly.

    I had this working beatifully at one point. The only change I've made was re-populating the website with EasyPopulate. (I checked all the new columns I created were still there!).

    In addition to this craziness, the checkout success page displays the correct order number.

    Pardon the strange question.

    Tom
    Last edited by thomasharding; 28 Nov 2008 at 01:43 PM.

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

    Default Re: Order Number: 0??

    What orders_status value is stored in the orders table for the orders that aren't showing in the admin? If that number is 0 or doesn't match one of the numbers of orders_status records, the order won't show in the admin.

    As for Order number: 0 showing, you're probably not picking up the order number from the right place in whatever code you've written to handle the order creation.
    .

    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 2007
    Location
    Manchester, England
    Posts
    168
    Plugin Contributions
    0

    Default Re: Order Number: 0??

    Quote Originally Posted by DrByte View Post
    What orders_status value is stored in the orders table for the orders that aren't showing in the admin? If that number is 0 or doesn't match one of the numbers of orders_status records, the order won't show in the admin.

    As for Order number: 0 showing, you're probably not picking up the order number from the right place in whatever code you've written to handle the order creation.
    Ah.. the orders_status table has no records returned, yet I have 2 orders in both the orders_products and orders tables.

    Yeah, I'm not at all sure what I've done. The main script I edited is inside the functions_general.php.

    I created a new function called purchase_level in that file and in classes/order.php (just after the main data input array) I call that function which automatically updates the user level should they meet the criteria to upgrade.

    It's all a complex thing

  4. #4
    Join Date
    Sep 2007
    Location
    Manchester, England
    Posts
    168
    Plugin Contributions
    0

    Default Re: Order Number: 0??

    (Okay, worked it out :)

    it turns out that I called the function slap bang inbetween

    zen_db_perform(TABLE_ORDERS, $sql_data_array);

    And
    $zco_notifier->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_HEADER'....

    (Line 617 - 622)

    Which interrupted the process adding to the status table.

    Thanks for your help!)


    EDIT - Still not fully working - OK, the client gets notified the right order number, but still no update.

    Hmmmm

  5. #5
    Join Date
    Sep 2007
    Location
    Manchester, England
    Posts
    168
    Plugin Contributions
    0

    Default Re: Order Number: 0??

    Also (sorry to keep adding stuff here)

    I noticed it adds a new row into the status history table, but not the status table now.

    I'm befuddled. I can't think of any time inbetween this working and now where I've changed such a major piece of core coding..

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

    Default Re: Order Number: 0??

    The orders_status table should NEVER change its contents ... that's the list of order status options in the pulldown on the order details page in the admin. You don't want to be messing with that.

    But the orders_status FIELD in the "orders" table must have a value that matches an entry in the "orders_status" TABLE, or things won't show in the admin.

    Normally that happens automatically, unless you've changed the status that orders are getting set to when you're saving them.

    The orders_status_history is the list of all orders-status changes that have happened to the order ... hence the "history" part of the name.
    .

    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. #7
    Join Date
    Sep 2007
    Location
    Manchester, England
    Posts
    168
    Plugin Contributions
    0

    Default Re: Order Number: 0??

    OOOOOOOOOOOOOOOOOOOOOHHHHHHHHHHHHH!!!

    How was I allowed to get into Zen Cart coding, not knowing what the orders_status table was for??

    Thankyou very much! I just don't know what on earth I was thinking.

    May I make a suggestion: In the next major release of Zen Cart, could you change the name to something like status_orders? It would save a lot of n00bs like me a lot of time!

 

 

Similar Threads

  1. How can I change the order number for order page?
    By ttmb33 in forum Customization from the Admin
    Replies: 1
    Last Post: 9 May 2010, 07:50 PM
  2. start from say order number #1215 rather than order number 1
    By vandiermen in forum Managing Customers and Orders
    Replies: 4
    Last Post: 18 Mar 2009, 02:07 PM
  3. Creates duplicate order number but no order in cart
    By songenterprises in forum Managing Customers and Orders
    Replies: 1
    Last Post: 7 Nov 2007, 06:00 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