Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Disable Out Of Stock Products After 24Hrs Not Hide But Actually Disabling It Rate Topic   - - - - -

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 03 January 2021 - 02:09 AM #1

how to disable out of stock products after 24hrs not hide but actually Disabling it



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22001 posts

Posted 04 January 2021 - 06:17 AM #2

CS-Cart does not store timestamp of the moment when the product was sold out. So additional development work is required to do it.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 04 January 2021 - 02:01 PM #3

How can i disabled out of stock products from php?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22001 posts

Posted 04 January 2021 - 02:04 PM #4

For example, 

db_query("UPDATE ?:products SET status = ?s WHERE amount <= ?i", 'D', 0);

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 04 January 2021 - 07:41 PM #5

Thanks, so no easy way to set a time stamp when product go out of stock?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12075 posts

Posted 04 January 2021 - 09:07 PM #6

Status of a product (active, hidden, disabled) is not changed for out of stock items. The settings control what's to happen for out of stock items defined as quantity (amount) <= 0.  I.e. whether to be displayed or not, whether they can be added to the cart, etc.  Not sure what the 'timestamp' has to do with whether a product is is-stock or not.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 04 January 2021 - 09:16 PM #7

I want to change status of products to hidden after it's out of stock, but i want this to happen after 24hrs



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12075 posts

Posted 04 January 2021 - 09:18 PM #8

Would require an addon or modification to do so.  Researching the best way to do this is most of the work.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22001 posts

Posted 05 January 2021 - 06:52 AM #9

Thanks, so no easy way to set a time stamp when product go out of stock?

 

There is no easy way. You should use hooks in the fn_update_product_amount function (app/functions/fn.cart.php)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 05 January 2021 - 06:38 PM #10

There is no easy way. You should use hooks in the fn_update_product_amount function (app/functions/fn.cart.php)

 

Can i clone this {"SELECT viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id} the aim is  clear the cloned product views and leave actual product views one

 
 
i tried changing viewed to prd_viewed but it didn't work;
 

{"SELECT viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id}



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22001 posts

Posted 06 January 2021 - 06:23 AM #11

 

Can i clone this {"SELECT viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id} the aim is  clear the cloned product views and leave actual product views one

 
 
i tried changing viewed to prd_viewed but it didn't work;
 

{"SELECT viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id}

 

 

Your message is not quite clear. Please clarify


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 06 January 2021 - 03:12 PM #12

I want to create a duplicate column for product count as prd_views

 

then be able to update it to zero without wiping the actual product views stored on the column viewed

 

This will show the product views

{"SELECT viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id}

 

I want to have a clone of the above that gets from column prd_viewed in stead of viewed

{"SELECT prd_viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id}

 

Then be able to update prd_viewed count using php



 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 318 posts

Posted 06 January 2021 - 03:15 PM #13

{"UPDATE prd_viewed FROM ?:product_popularity WHERE product_id = ?i"|db_get_field:$product.product_id} set the count to zero