Hi there,
I’ve changed the text of the ‘out of stock’ message in the shop, and I’d like to add an email link in that text so customers can email us to check availability of an out of stock item.
Any idea how I can add a clickable email link to the out of stock message text?
Thanks!
URL: http://goodrotations.co/shop/bicycles/adventure-bicycles/all-terrain/surly-wednesday/
Hi nokostudio!
use normal html code, for example:
<a href="mailto: (Email address hidden if logged out) ">Fritz Eierschale, (Email address hidden if logged out) </a>
Best regards,
Andy
Perfect, thanks!
Hello again,
Odd, I added the link, which worked for a while, but now the out of stock message show the html code instead of the active link:
http://goodrotations.co/shop/bikepacking-adventure/eating-drinking/msr-whisperlight-universal/
Any idea why that might be happening?
Thanks!
Hi,
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Thanks,
Rikard
Hi there, temp user access for you.
Thanks!
Hi!
Please add this in the functions.php file:
/**
* Change In Stock / Out of Stock Text
*/
add_filter( 'woocommerce_stock_html', 'woocommerce_stock_html_mod', 10, 1);
function woocommerce_stock_html_mod($availability_html) {
global $product;
// Change Out of Stock Text
if ( $product->stock_status == 'outofstock' ) {
$availability_html = "Sorry, sold out! <a href='mailto: (Email address hidden if logged out) '>Email us</a> for availability";
}
return $availability_html;
}
EDIT: We modified the code a bit.
Regards,
Ismael