Message not showing on some products
$30-250 AUD
Paid on delivery
I have some code that is meant to show some text under add to cart button on every product
"Free Delivery in 2 - 4 Days.." (attached screenshot)
But on some product pages it doesn't show up. Can you make it show on all product pages?
Here it isn't showing: [login to view URL]
Here it is showing: [login to view URL]
Here is the code:
add_filter('woocommerce_get_availability_text', 'customizing_stock_availability_text', 1, 2);
function customizing_stock_availability_text($availability, $product) {
if (!$product->is_in_stock()) {
$availability = __('Sold Out: Back in stock August 2021. Enter your email to be notified', 'woocommerce');
} elseif ($product->managing_stock() && $product->is_on_backorder(1)) {
$availability = $product->backorders_require_notification() ? __('Available on backorder', 'woocommerce') : '';
} elseif ($product->managing_stock()) {
$availability = __('<a style="text-decoration: none;" href="delivery-and-returns/"><b>FREE</b> Delivery in 2 - 4 bus. days if you spend $85 (otherwise just $9) </a><div style="clear:both;"></div><hr>', 'woocommerce');
$stock_amount = $product->get_stock_quantity();
switch (get_option('woocommerce_stock_format')) {
case 'low_amount' :
if ($stock_amount <= get_option('woocommerce_notify_low_stock_amount')) {
/* translators: %s: stock amount */
$availability = sprintf(__('Only %s Available!', 'woocommerce'), wc_format_stock_quantity_for_display($stock_amount, $product));
}
break;
case '' :
/* translators: %s: stock amount */
$availability = sprintf(__('%s Available!', 'woocommerce'), wc_format_stock_quantity_for_display($stock_amount, $product));
break;
}
if ($product->backorders_allowed() && $product->backorders_require_notification()) {
$availability .= ' ' . __('(can be backordered)', 'woocommerce');
}
} else {
$availability = '';
}
return $availability;
}
Project ID: #31025006
About the project
Awarded to:
33 freelancers are bidding on average $115 for this job
Hello, I understand your project requirements, I can fix your issues which you mentioned In Your work description , Please come on chat so we can share your work, Thanks Gaurav D.
I can make your message appear on all pages. My average project completion time is within 3-5 hours on the same day. The skills I have include PHP, HTML5, CSS3, JavaScript, jQuery, WordPress Themes & Plugins, Web Scrap More
Dear Client, I am an experienced PHP developer and will fix your message issue on your Wordpress website. Let's have chat to discuss. Thank you
Hello, I can code some text under add to cart button on every product. I am available to start work on your website. I will do it very fast. Lets start...
do you want same text on every product or you want dynamic text to be displayed? i am ready to start now Have read your description on project very carefully.
Hello Greetings of the day! I read your description and have rich experience in wordpress so i can finish your project in short time I’m looking forward to hearing from you soon. Thank you for considering my cover l More
Hi i will make the text "Free Delivery in 2 - 4 Days.." to all product page. I have 8+ year professional experience in web Designing and development. Please check my reviews to see my results, My first priority is my c More
★★★ FREE ONE MONTH SUPPORT AFTER PROJECT COMPLETION ★★★ I will help to resolve issues of your website according to your requirements. Please share the exact details. I have been working as a WordPress developer and w More
Hi, I have 8+ years in UI/UX Designer & Front End Developer. I can do this job Perfectly. I can start immediately. My skills:|| Graphic Design || HTML || CSS || SASS || LESS || JQuery || JavaScrip, Bootstrap || Wo More
Hey! I'll fix this issue in few hours in just $30, why waste money somewhere else? Pay me after your work is complete. Send me a message to get it done on time. Thanks for your consideration.
Hi, After reviewing your complete job description along with the code and your site, I can surely help you to add the specific content under every product on your site. I have hands-on experience with WordPress WooCo More
add_filter('woocommerce_get_availability_text', 'customizing_stock_availability_text', 1, 2); function customizing_stock_availability_text($availability, $product) { if (!$product->is_in_stock()) { $availability = __( More
Hi We are in website development with WordPress since 10 years. We Can Do your project perfectly. Please let us know if you want a very good job Best regards