Jump to content

tymcode

Members
  • Content count

    7
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Mike Jennings
  1. I have QTPro 4.1 in a typically modded osC install. When I'm tracking attribute stock, it's not correctly decrementing the option stock levels. I've caught it in the act a couple times, like tonight when buying via check/money order. If I have several of the same items with different options, one of them doesn't decrement. Last night, a customer bought those same four options, and the only one that decremented at all was a fifth option. I checked the other orders, unsold carts etc. I've been swimming around in this bug for a long long time now, over a year. It's threatening my marriage at this point; driving my wife crazy as people order products we do not have, and as we appear to sell out of a product we have more of. It's long past my abilities as a PHP coder to debug myself. I've waited this long because I've been trying to find a reproduceable case. I've read loads about this on the net but nothing that appeared to be directly applicable. My wife wants to scrap the whole site or even close the shop if I don't come up with something. I may have to take vacation time from my day job to rebuild the site from scratch. Where do I begin to look? Should I have it write out a log file whenever it decrements the products_attributes_stock, dumping what it thinks is the attributes_stock_left and whatever else I can think of? --Mike Jennings
  2. tymcode

    All Customers Report

    I copied and pasted from the Web page. I suspect adding an addslashes() in just the right place would fix it. I never figured out why it skips my non-North American customers. Something to do with the Zone system, I expect.
  3. tymcode

    All Customers Report

    I think I know why your list was not completely exported -- I just had the same thing happen to mine, and it gurfed on the apostrophe in one of the addresses ("O'Farrell"). I fixed this in the mirror_out function but I am a clumsy programmer and I'm sure someone could do a much tidier job. I also noticed that it only shows my US and Canadian customers and skips the other foreign customers. I can't fix that at all -- the zone system is a little too clever for me to hack at this point.
  4. tymcode

    [Contribution] Wishlist v1.2 - Extended

    Aha! In the QT Pro forum I found this: In catalog/includes/application_top.php, replace this: $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); // Read array of options and values for attributes in id[] if (isset ($id)) { foreach($id as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } } break; with this: $goto = basename($PHP_SELF); switch ($HTTP_POST_VARS['wishlist_action']) { // Customer wants to update the product quantity in their shopping cart case 'add_wishlist' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) { if ($HTTP_POST_VARS['products_id']) { if ($customer_id > 0) { // Queries below replace old product instead of adding to queatity. tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )"); tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); //++++ QT Pro: Begin Changed code $attributes=array(); if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); foreach ($attrlist as $attr) { list($oid, $oval)=explode('-',$attr); if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) $attributes[$oid]=$oval; } } if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { foreach ($HTTP_POST_VARS['id'] as $key=>$val) { if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) $attributes=$attributes + $HTTP_POST_VARS['id']; } } // Read array of options and values for attributes in id[] foreach($attributes as $att_option=>$att_value) { // Add to customers_wishlist_attributes table tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )"); } } } } break; The one over there had an extra closing brace before the break that I had to remove, but once that was done the problem was fixed. Thank God for ralphday because I can't make head or tail of how QT Pro works. --Mike Jennings
  5. tymcode

    [Contribution] Wishlist v1.2 - Extended

    Since I added QT Pro 4.1, product attributes don't get added into the wishlist created using Wishlists. This leads to all kinds of havoc. Thanks to osCommerce, I'm learning a lot about PHP and getting pretty good at customizing the store. But QT Pro's under-the hood stuff is bewildering to me -- I'm only good enough to realize that my array and regular expression chops aren't nearly good enough to figure out how it works. Has anyone figured out how to update the customers_wishlist_attributes table using the QT Pro engine? --Mike
×