Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product status listing


scamp

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

create a function that gets the status and spits it out, call in in product_listing in the loop that formats the output...

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...
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.

Link to comment
Share on other sites

  • 1 year later...
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.

Link to comment
Share on other sites

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...