6 replies [Last post]
drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Was this information Helpful?

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.

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Where to Change 'Out of Stock' Button text ?

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

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Where to Change 'Out of Stock' Button text ?

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.

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: Re: Where to Change 'Out of Stock' Button text ?

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!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Where to Change 'Out of Stock' Button text ?

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.

benrudolph's picture
Offline
Joined: 10/28/2008
Juice: 2
Out Of Stock Redirect?

Where/what would i change to redirect the user to another page if an item is out of stock? For example my client would like it to redirect to the contact page.

Juanzo@drupal.org's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 79
Re: Out Of Stock Redirect?

The best solution for this, IMHO, is to allow clients to be notified once stock comes back online. I've suscribed to this thread to see if someone has any ideas on how to implement this.