Jump to content

YePix

Members
  • Content count

    319
  • Joined

  • Last visited

  • Days Won

    1

YePix last won the day on March 28 2019

YePix had the most liked content!

2 Followers

Profile Information

  • Real Name
    Peter
  • Gender
    Male
  • Location
    Germany

Recent Profile Visitors

25,232 profile views
  1. YePix

    quantity monitoring

    This should always reduce the counter of the purchased quantity of products from the assigned category by the purchased number. Set up like the download counter. Could someone take a look at whether this code can be built into the checkout_process.php? for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { $stock_categories_query = tep_db_query("select c.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 where p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if (tep_db_num_rows($stock_categories_query) > 0) { $st_cat_values = tep_db_fetch_array($stock_categories_query); $stock_cat_left = $st_cat_values['categories_product_qty']; tep_db_query("update " . TABLE_CATEGORIES . " set categories_product_qty = '" . (int)$stock_cat_left . "' - " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . (int)$st_cat_values['products_id'] . "'"); if ( ($stock_cat_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . (int)$st_cat_values['products_id'] . "' and products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); tep_db_query("update " . TABLE_CATEGORIES . " set categories_status = '0' where categories_id = '" . (int)$st_cat_values['categories_id'] . "'"); } } }
  2. YePix

    quantity monitoring

    I have the problem that I cannot test it because I only have 1 database and for this reason my system must not fail. I think, however, that it is not too much effort to calculate the quantities from the categories to products as described above and to subtract the purchased products. this instruction and query in the checkout_process.php should solve it. I just need someone who takes a quick look at it and tells me whether it can be implemented this way. for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { $stock_categories_query = tep_db_query("select p.products_id, p.products_quantity, 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 where p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_categories_query) > 0) { $st_cat_values = tep_db_fetch_array($stock_categories_query); $stock_cat_left = $st_cat_values['categories_product_qty']; tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_product_qty = '" . (int)$stock_cat_left . "' where products_id = '" . (int)$st_cat_values['products_id'] . "' and products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_cat_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . (int)$st_cat_values['products_id'] . "' and products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } }
  3. YePix

    quantity monitoring

    I already realize that it is a bit more complex. But I don't have the time to sit down and click around on the categories and products. Everything has to run automatically for me because my products are prepared in real time and if something is no longer available it has to be switched off immediately. I thank you anyway for the suggestion.
  4. 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.
  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. YePix

    quantity monitoring

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

    quantity monitoring

    I thank you for the approach. I will now try to build it up in more detail.
  8. 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.
  9. YePix

    osCommerce v4 demo

    💪 Thanks
  10. YePix

    osCommerce v4 demo

    I'm very, very, very interested toooooooooo 😆
  11. YePix

    Switch off the product

    Thanks 👍
  12. YePix

    Switch off the product

    Hello everyone, I would like to add an end date to my products. Any product that exceeds this end date should switch itself off automatically. Here I have the query that I want to add to the application_top.php, which sets the product status to 0 but I'm not sure if it fits. I ask because I have no way to test it and I can't afford to make any mistakes in my shop. Could someone take a look at it and give me some advice on whether it works that way? thank you in advance. // Set the product status by out of available to 0 if (isset($_GET['products_id'])) { tep_db_query('update ' . TABLE_PRODUCTS . ' set products_status = '0' where products_id = '" . (int)$_GET['products_id'] . "' and products_out_available > curdate()'); }
  13. auf allen Seiten mit einem Kaufbutton folgendes vor der Buttonsektion einfügen: <?php if ($product_info['products_quantity'] > '0'){?> folgendes nach der Buttonsektion einfügen: <?php }?> Beachte aber die Bezeichnung der Abfragen auf in den einzelnen Dateien. product_info.php ist => $product_info['products_quantity'] zuständig. hierbei ist => $product_info die Variable der Abfrage. Bei den Anderen Dateien ändert sich diese.
  14. YePix

    Capture Fake Accounts IPs

    Google recapcha is not recommended. This joke query can be bypassed as easily as any other program. I therefore recommend using something that really checks whether it is a human or a robot. You can test it yourself. When the message appears whether you are human, wait 3 to 5 seconds and only then click the confirmation. every time you will succeed in reaching your goal without further testing. Captscha is garbage and not seriously useful.
  15. YePix

    Where is templates ?

    Hi, before you worry about the template, you should whip up your shop. The violations of applicable EU law are so flawed that you could pay a warning of at least 5 to 10 thousand euros.
×