kirk7880 Posted March 1, 2006 Share Posted March 1, 2006 I am using joomla with virtue-mart shopping cart and i need to have the products listed for one day only. Basically, A client will sell one "type" of products (example: a lot of pc screens (1500)). When the items are sold for the day, shop closed. The item needs to be removed at 11:59 PM and activate the new Products for the following day, BUT!!! Only if the lot for today was sold out. In other words, If all 1500 PC screen is not sold, the item carry over to the next day until the inventory is sold out.Table name: [b]jos_vm_product[/b] <-- Need to check this table forColumn name: [b]product_publish[/b] (Values: Y,N) <-- If [[b]product_publish='Y'[/b]] [i]check[/i]Column name: [b]product_in_stock[/b] (Values: "Empty_String" [i]or[/i] Numerical Value) <-- If [b]product_in_stock[/b] [IS empty] [[i]UPDATE[/i] the Value of Column name: [[b]product_publish='Y'[/b] [i]TO[/i] [b]product_publish='N'[/b]]Once the currently published item is unpublished ([b]product_publish='N'[/b]) then the Next item needs to be published. Primary keys is "[b]product_id[/b]." I assume i would need to know the current "product_id" of the item to be "[b]unpublished[/b]" so i can sequence the order of items next in line to be published. This is killing me!Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/3873-if-else-sql-queries/ Share on other sites More sharing options...
fenway Posted March 2, 2006 Share Posted March 2, 2006 I don't understand how you're going to determine the "next" product to publish. Quote Link to comment https://forums.phpfreaks.com/topic/3873-if-else-sql-queries/#findComment-13463 Share on other sites More sharing options...
kirk7880 Posted March 2, 2006 Author Share Posted March 2, 2006 Hello,Each product that's listed has a primary key (product_id). I guess i would need the "product_id" of the current item being unpublished and do ++ somehow to get the next product in line. I have no clue what i'm talking about here... so i could be 1000% wrong. Quote Link to comment https://forums.phpfreaks.com/topic/3873-if-else-sql-queries/#findComment-13470 Share on other sites More sharing options...
fenway Posted March 2, 2006 Share Posted March 2, 2006 So it's determined by UID alone? That's unusual. Sounds like the "product_publish" flag can be programatically determined at run-time -- simply find the lowest UID that not "out of stock". Quote Link to comment https://forums.phpfreaks.com/topic/3873-if-else-sql-queries/#findComment-13557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.