Where to Change 'Out of Stock' Button text ?

Posts: 18
Joined: 05/08/2008

Hi, am sure the answer for this quite simple but I just can't find it. I'd like to alter my 'Out of Stock' text on buttons for sold out products to say 'Sold' - where can I alter this?

Ideally, i'd prefer for sold out products not to show up at all in my products View - is there a good way around this?

Thanks.

Posts: 18
Joined: 05/08/2008

To answer my own question, found in uc_inventory_api.module (around line 213):

$form['submit']['#value'] = t('Out of Stock');

However if anyone has any idea about my other point (not showing out of stock items at all in a View) I'd be very grateful to hear what the current best way around this is.

Thanks

Posts: 4747
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Check out this patch - http://drupal.org/node/248100

I thought we had committed it, but it looks like it got passed over. Will see about putting it in later today.

Posts: 18
Joined: 05/08/2008

Thanks Ryan, I've not actually patched before - is this going to be committed to the module so i can just update that? Or will I need to add the patch? I'd prefer to do it locally and test a la:

http://drupal.org/node/34422#comment-75030

I know this is probably a dumb question but I have compared the patch code alongside that from uc_stock.module and it all appears different - can I just add the patch code to the end of the original file? Does it not replace original code, but add fresh code for using Views is I guess what I'm asking.

Thank you for you time!

Posts: 4747
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

That's the idea, but in my testing I noticed a few things that weren't finished yet. I'll be committing the patch to core soon and you can test it out from there. Otherwise, just copy/paste the patch (only the + lines) into the end of your uc_stock.module and remove the +'s.