Jump to content

IF Else SQL Queries


kirk7880

Recommended Posts

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 for
Column 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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.