scamp Posted November 3, 2002 Share Posted November 3, 2002 I have just implemented a product status listing to a live store. It is a continuation of Product Listing Stock Status 1.0.0 by Ross Lapkoff. What it does - :idea: Displays product listing in main product_listing.php (in-stock -out of stock, pre-order - theorecticaly you could have a infinite number of status fields based on a set status ID. 0, 1, 2 ,3 etc ) Displays product_status in product_new.php (main page not box) Displays product status in product_info.php Displays product status in advanced_search.php Sort by product status. cart remains unchanged. Product does not disappear when status hits 0 You can see it hear (please this is a live store so if you place an order please indictate that your are from OSC and testing so that I can delete the order- btw it also has multiple add to cart installed as well) If I can get it to work with the new snap shot and interest is there I will roll it into a contribution. Can you let me know what people think, not the store just the mod. Much thanks regards Seb the url is http://www.palaldincomics.com Quote Link to comment Share on other sites More sharing options...
scamp Posted November 3, 2002 Author Share Posted November 3, 2002 :oops: that should be http://www.paladincomics.com fat fingers that's my excuse :oops: regards Seb Quote Link to comment Share on other sites More sharing options...
CC Posted November 3, 2002 Share Posted November 3, 2002 Hi Scamp I would definately be interested in putting it in product_listing.php I have it on product_info.php, but need to get it onto the listing. Cant wait to hear from you. PM me with details please, if there is little response, I am very very interested. Cheers scamp. CC. Quote Link to comment Share on other sites More sharing options...
mattice Posted November 3, 2002 Share Posted November 3, 2002 I would definately be interested in putting it in product_listing.phpI have it on product_info.php, but need to get it onto the listing. create a function that gets the status and spits it out, call in in product_listing in the loop that formats the output... Quote "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
CC Posted November 3, 2002 Share Posted November 3, 2002 Matice Wrote: create a function that gets the status and spits it out, call in in product_listing in the loop that formats the output... Mattice, thnx for the help, but in the words of Dr. Evil: "R-i-i-i-i-i-i-i-i-i-i-i-ght" Sorry mate, but I dont follow that completely... I am still learning on the php front, so if you can make that clearer in anyway I would be immensely happy... I can see the layout of php_listing.php, but then I am a tad lost as to what code needs to be put in place to add the stock indication on the list... Can you simplifu for me some more, or show me sort of what I need? Cheers buddy. CC. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2002 Share Posted November 3, 2002 That is just the thing I am looking for :) If you could give me a few hints on the code that would be greatly appreciated (i can also help you test it at the same time:)) I am running a snapshot from july. ahh, to finally put an end to the 'do you still sell xxxxx , as i can't see it on your site now' email. Many thanks in advance. Matt [email protected] Quote Link to comment Share on other sites More sharing options...
CC Posted November 4, 2002 Share Posted November 4, 2002 Hey Seb I know it has only been a short time, but any chance you couold tell us if you are planning on putting together a contribution for this? I am sure loads of ppl will need this in the long run, and I for one would love to have it now... :wink: Cheers CC. Quote Link to comment Share on other sites More sharing options...
scamp Posted November 4, 2002 Author Share Posted November 4, 2002 As I quoted in the original post this mod is not all my original work and I must give credit to Ross Lapkoff for the bulk of the work. For those just wanting the main listing to show stock status his contribution is here http://www.oscommerce.com/downloads.php/co...ions,135/type,5 it will require a little bit of hacking to slip in to the current standard but it is all there. I wanted to show the status on every product page so I simply continued the mod onto the other pages. There seems to be a large amount of interest as my inbox keeps filling up with mail from webmasters that I don't know :o so I will download the current snapshot and see if I can make a contribution from it (my current code is full of other mods and sorting it out would be a nightmare) It will be a week or two though before I can get to it as we are now into a busy period for the next week or so. For those that can't wait drop me a line and I will add you to the list and forward you the files as I do them. :lol: Regards Seb Hey Seb I know it has only been a short time, but any chance you couold tell us if you are planning on putting together a contribution for this? I am sure loads of ppl will need this in the long run, and I for one would love to have it now... :wink: Cheers CC. Quote Link to comment Share on other sites More sharing options...
CC Posted November 4, 2002 Share Posted November 4, 2002 Does anyone know how I could integrate this bit of code alone into product_listing.php: <?php$prod_quantity = tep_get_products_stock($products_id); switch ($prod_quantity) { case 0: print "Out of Stock"; break; case 1: print "1 in stock"; break; case 2: print "2 in stock"; break; case 3: print "3 in stock"; break; case 4: print "4 in stock"; break; default: print "5+ in stock"; } ?> I have tried to integrate it but only end up getting parse errors, yet I cant see what the problem would be... I'm lost a tad when it come to arrays etc... This code works for me in product_info.php, I would just like it to also show in the listings. Gimme a shout if you can help please... Cheers CC. Quote Link to comment Share on other sites More sharing options...
mattice Posted November 4, 2002 Share Posted November 4, 2002 CC, I have not seen the code but if you create a function in /catalog/includes/functions/general.php that does (theoretically) this: function tep_get_product_status($products_id) { $status_query = tep_db_query("select product_status from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $status = tep_db_fetch_array($status_query); return $status[0]; } Then in your product_listing page you call $status = tep_get_product_status($product_id); and echo the $status where you want it. It's not the cleanest but it will work. BTW This example isn't tested, just an example to get the idea. I'm quite sure it will give errors.... Mattice Quote "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
CC Posted November 4, 2002 Share Posted November 4, 2002 Thanks for this matey. And thanks for the PM. I am gonna have a go at this, when I get it working I will post back some info on it. This is a great start for me, especially cos I am very stuck at the mo. :wink: Cheers mate. CC. Quote Link to comment Share on other sites More sharing options...
CC Posted November 4, 2002 Share Posted November 4, 2002 BTW Mattice Does code like that just role off the tongue for you like second nature? Or have you got a massive book that you use as a reference?? Cos how you just come up with that I will never know... Or is that just standard stuff you would have a used a million times? I just wonder - Cos I am baffled by you guys who know this so well! Excellent work mate, pat on the back for you! :wink: I guess www.php.net is one of the best places to look right? Anyhow - Well done again. I dont want to wander off topic, so if anyone else has input on this stock listing in product_listing please shout out! CC. Quote Link to comment Share on other sites More sharing options...
scamp Posted November 23, 2002 Author Share Posted November 23, 2002 Hey Seb I know it has only been a short time, but any chance you couold tell us if you are planning on putting together a contribution for this? I am sure loads of ppl will need this in the long run, and I for one would love to have it now... :wink: Cheers CC. Hi, I finaly found some time and will be finishing this hack mostly this afternoon early tomorrow, I am looking for someone to proof read the hack (my documentation skills are rusty). If you are still interested would you be kind enogh to let me know either reply email or post a message in the thread and I will forward the file to you for comment(s) prior to posting the contribution. Regards Seb PS I attempted to send a PM to your account but the forum threw back an error, and there is nothing in my sent box so if I have doubled up - applogies. Quote Link to comment Share on other sites More sharing options...
Graveyard666 Posted February 25, 2004 Share Posted February 25, 2004 does this contrib work with MS2.2?? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 2, 2004 Share Posted March 2, 2004 Hey Seb I know it has only been a short time, but any chance you couold tell us if you are planning on putting together a contribution for this? I am sure loads of ppl will need this in the long run, and I for one would love to have it now... ?:wink: ? Cheers CC. Hi, I finaly found some time and will be finishing this hack mostly this afternoon early tomorrow, I am looking for someone to proof read the hack (my documentation skills are rusty). If you are still interested would you be kind enogh to let me know either reply email or post a message in the thread and I will forward the file to you for comment(s) prior to posting the contribution. Regards Seb PS I attempted to send a PM to your account but the forum threw back an error, and there is nothing in my sent box so if I have doubled up - applogies. ok, glad i found this before i started recreating the wheel. i download the product listing 1.0.0 but after reading the contents, soon found it wasn't for osc2.2ms2 anyway, this is something i need and I do have a test server to run it on. i can even clean up the documentation for you... please post or send it to me when you can. thanks. Quote Link to comment 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.