Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. Jack_mcs

    quantity monitoring

    What you are trying to do is not a small job and is beyond the scope of support threads, in my opinion, but here is a way to do it. 1 - Get is a comma separate list of all of the product ID's in a category to give something like this. You can get the list from the products_to_categories table using the category ID to check. $product_ids = '1,2'3'; 2 - In the categories box, use code like this to get the minimum quantity of all of the products: SELECT MIN(products_quantity) FROM products where products_id in (' . $product_list . '); 3 - Change the category tree file so check the above result and if it is 0, returns 0, then don't add that category to the listing. 4 - Cycle through the products in the above list and set the status to 0. Note that if you do this, it will remove them from the site and that will affect SEO, if that matters. Otherwise, set their quantities to 0 and change the product page to not allow adding to cart when the quantity is 0.
  3. YePix

    quantity monitoring

    Yes, each product has to be monitored in a category. Exact example. Category A Product 1 Quantity 10 Product B quantity 10 Product C quantity 10 Category A Available quantity 3 If product A is sold twice and product B is sold once, the amount available in category A must also be deducted automatically. If category A available quantity is set to 0, this category A and all of its products must be set to status 0.
  4. Jack_mcs

    quantity monitoring

    Assuming you have standard tables,. there isn't a categories_products_qty field. I assume by "category counter" you are referring to the product count that is shown in the categories box. If so, that number is calculated each time the page loads, which is why it is not recommended to be used. There also isn't a field to show or hide a category. You would need to edit the category_tree.php class file to check for products in the category to show or hide it. You should also install one of the call for prices addons that will mark products with a price of 0 as not available.
  5. YePix

    quantity monitoring

    I'm not quite sure, but could someone see if it was right? If a product is purchased from a category, that the amount is automatically deducted from the amount from the category counter and, if the product is 0, the category and all the products it contains are set to status 0? $products_ordered = ''; for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename, ptc.categories_product_qty FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON p.products_id = ptc.products_id LEFT JOIN " . TABLE_CATEGORIES . " c ON c.categories_id = ptc.categories_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id = pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id = pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = (isset($order->products[$i]['attributes'])) ? $order->products[$i]['attributes'] : ''; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . (int)$products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . (int)$products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { if (tep_not_null($stock_values['categories_product_qty'])){ $stock_left = $stock_values['categories_product_qty'] - $order->products[$i]['qty']; }else{ $stock_left = $stock_values['products_quantity']; } } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_product_qty = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_values['categories_product_qty'] < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " c set p.products_status = '0' where p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "' and c.categories_status = '0' where c.categories_id = '" . (int)$stock_query['ptc.categories_id'] . "' and products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } } }
  6. Jack_mcs

    quantity monitoring

    There isn't a function for it. It is part of the code in checkout_process.php and paypal_standard.php (and maybe other payment modules). Search for stock in those files to find it.
  7. Last week
  8. YePix

    quantity monitoring

    where is the function that is responsible for the product quantity that subtracts the purchased products from the inventory?
  9. YePix

    quantity monitoring

    I thank you for the approach. I will now try to build it up in more detail.
  10. Jack_mcs

    quantity monitoring

    The QTPro addon does this for attributes if you can have all of the parts as attributes. If they are all different products, then you would need to check them on page load. So if there are 100 sandwiches showing but you only have 20 breads, you could have something like $db_query = tep_db_query("select count(*) as ttl from breads"); $db = tep_db_fetch_array($db_query); if ($db['ttl']) < 100) { tep_db_query("update sandwiches set quantity = " . $db['ttl']); } But that can cause problems since it might change the amount for another customer that has already entered more than the limit.
  11. No, it shouldn't be left is as is. You can leave it in but change the '1' to '0'. Otherwise all of your visitors will see errors.
  12. okay i have put this back to true...like this: and i can stil create an account and put an item in the cart! yesssπŸŽ‰πŸ˜
  13. Gzip is important so try it now with it turned on.
  14. omg. πŸ˜ƒπŸ˜ƒπŸ˜ƒ it's working!!! i can create an account AND put an item in the cart! it was probably those cache and gzip settings! thank you soooooooo much! πŸ’ so if i put that error reporting code in aplication-top. will next time something goes wrong an error or something occur? so that i can find out what it is? If yes... i am going to change that line (i couldn't find an Error_log) Because i have much more testing to do. IDeal for instant. but that is for an next time. I have had Enought braintraining for today🀣
  15. It will run on 7.4 It has error reporting set to suppress errors. Most of the errors will be of the type: 1) The each() function is deprecated. 2) Methods with the same name as their class will not be constructors in a future version of PHP; I have a file set with most (or much) of these php updates done, if anyone is interested.
  16. Is there an error_log file in the shop directory? If there is, it might indicate the problem. If not, try replacing the error_reporting line in includes/application_top.php with the following. Then try creating and account and see if any errors are displayed. error_reporting(1); ini_set('display_errors','1'); And clear the sessions table in the database and turn off the cache and gzip settings in admin.
  17. i thought that Oscommerce 2.3.4 wasn't compatible with php 7+ πŸ€”
  18. You can also look through this:
  19. Can you up your php version to 7+ ?
  20. This version: thanks.... i made the changes to the files as you have shown in the edited files you send. THanx for the advise. As you already probably thougt....it did not fix my problem, But at least my files are having those mistakes fixed.😁 so. i put my edited file her again. Hoping that someone would be able to see what to do to so that customers would be able to create an account and put items in the shoppingcart. Both still isn't possible.πŸ˜” this is the include/configure.php file as it is in the moment. define('HTTP_SERVER', 'https://www.sandraspetsparadise.nl'); define('HTTPS_SERVER', 'https://www.sandraspetsparadise.nl'); define('ENABLE_SSL', true); define('HTTP_COOKIE_DOMAIN', 'www.sandraspetsparadise.nl'); define('HTTPS_COOKIE_DOMAIN', 'www.sandraspetsparadise.nl'); define('HTTP_COOKIE_PATH', '/shop/'); define('HTTPS_COOKIE_PATH', '/shop/'); define('DIR_WS_HTTP_CATALOG', '/shop/'); define('DIR_WS_HTTPS_CATALOG', '/shop/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', '/var/www/vhosts/sandraspetsparadise.nl/httpdocs/shop/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); and this the admin/include/configure.php: define('HTTP_SERVER', 'https://www.sandraspetsparadise.nl'); define('HTTP_CATALOG_SERVER', 'https://www.sandraspetsparadise.nl'); define('HTTPS_CATALOG_SERVER', 'https://www.sandraspetsparadise.nl'); define('ENABLE_SSL_CATALOG', 'true'); define('DIR_FS_DOCUMENT_ROOT', '/var/www/vhosts/sandraspetsparadise.nl/httpdocs/shop/'); define('DIR_WS_HTTPS_CATALOG', '/shop/'); define('DIR_WS_ADMIN', '/shop/admin/'); define('DIR_FS_ADMIN', '/var/www/vhosts/sandraspetsparadise.nl/httpdocs/shop/admin/'); define('DIR_WS_CATALOG', '/shop/'); define('DIR_FS_CATALOG', '/var/www/vhosts/sandraspetsparadise.nl/httpdocs/shop/'); define('DIR_WS_IMAGES', '/shop/images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); define('HTTPS_SERVER', 'https://www.sandraspetsparadise.nl'); define('ENABLE_SSL', true); define('HTTP_COOKIE_DOMAIN', ''); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/shop/'); define('HTTPS_COOKIE_PATH', '/shop/'); define('DIR_WS_HTTPS_ADMIN', '/shop/admin/'); 🀞hoping someone can help
  21. YePix

    quantity monitoring

    Hi folks, I really need a product monitoring function. The point is that individual products are counted with the product inventory, but I need it as a category. If I have 10 different sandwiches in a category and each is specified with 10 pieces of product, it would be 100 pieces in total. But if I only have 20 breads in stock, it won't work. Can someone give me an idea of how I can manage to install a counter in the category where 20 pieces are specified and these are also automatically counted down when purchasing a product from this category. when the level reaches 0, this category and all products should be switched off automatically. I thank you in advance for a little help.
  22. osCommerce-Official

    osCommerce v4 demo

    Hi Violet, not a problem at all, there will be one this week, will post about it shortly.
  23. Thomas789

    MySQL connection issue when using custom domain

    Have you tried using define('DB_SERVER', '127.0.0.1:3306'); in includes/configure.php instead of localhost ?
  24. Jack_mcs

    Automatically send data feed to Froogle

    A new version has been uploaded with these changes: Added a localfeed option. Corrected code for php warnings.
  25. On the osCommerce website https://www.oscommerce.com/ hosting company Hostiso https://hostiso.com/ is prominently featured as one of the partners of osCommerce. Does anyone have first hand experience with them? Their company setup is slightly obscure: they claim the be based in Switzerland, but their company is actually a LLC registered in the US, and they seem to be using mostly Leaseweb servers in Germany (their own website is hosted in Germany as well). I can't find many conclusive recent reviews regarding their hosting though.
  26. ruden

    Install OsCommerce 2.3.4.1 new installation

    @businesspromotion Install v2.3.5 https://github.com/ruden/vanilla-oscommerce
  27. needs_a_nap

    osCommerce v4 demo

    Sorry I missed a demo! Posting this reply solely for the purpose of getting notified if it happens again Violet
  1. Load more activity
×