Jump to content

Homepage Featured Products Modifcation: Replace "Add To Cart" with "Out Of Stock" link anchor text.


Recommended Posts

Whilst dabbling with the featured items module on the homepage I noticed one of the items Add to cart button was paler and disabled...

A quick check confirmed the item was entered as Out of stock. It kind of annoyed me that even though the button was disabled the anchor text over it still showed "Add to cart" and I quickly imagined a frustrated user clicking like mad on the Add to cart link while nothing happened so my question was:

How can I alter the link anchor text from "Add to Cart" to "Out of Stock" when the button is disabled?

Well, having spent half the day Googling and scouring this forum for an answer and getting nowhere fast I decided to have a look for the answer myself...

Voila! Go to:

modules/homefeatured/homefeatured.tpl

Check out line 22, the line to call the in stock state of play then below there is an {else} to assign the out of stock class and change the button state from the css

On line 24 you'll see this:

{l s='Add to cart' mod='homefeatured'}



Well that's it, swap the Add to Cart for Out of Stock like so:

{l s='Out of stock' mod='homefeatured'}



and that's it... job's a goodun! Now I'm just a tad miffed I spent so long looking elsewhere for an answer :o)

So now the disabled button also shows the wording Out of stock - if you want to alter the colour of the anchor text it's in the global.css file for the theme. I've modified my css a lot so I won't include a line number is it will no doubt be different but use the find function of your text editor to lookup: /* exclusive disabled button */

Hope that helps anyone out there wanting the same thing.

Share this post


Link to post
Share on other sites
  • 2 months later...

Thank you for this thread!

I have just started to learn this things and have been looking and looking to find out where to change this text! Finaly it is changed!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More