Message not showing on some products

V teku Objavljeno pred 2 letoma/leti Plačilo ob prevzemu
V teku Plačilo ob prevzemu

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;

}

WordPress PHP WooCommerce HTML CSS

ID projekta: #31025006

Več o projektu

33 predlogov Oddaljen projekt Aktiven pred 2 letoma/leti

Dodeljeno:

(546 mnenj)
9.0

33 freelancerjev ponuja v povprečju za $115 na tem delu

shahid864

Hello, I am ready to help you on Message not showing on some products, I want to discuss starting right now after having the full details, I have 10+ years of experience in web development and maintaining websites. Tha Več

$66 AUD v 1 dnevu
(774 ocen)
7.5
gauravgargcs

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.

$140 AUD v 7 dneh
(150 ocen)
7.5
VileGnosis

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 Več

$60 AUD v 1 dnevu
(249 ocen)
7.0
Lavlu

Hello Sir, I understand project scope but having few questions that needs to be clear in more detail. Please let me know if we can discuss the requirement over chat or call. Will provide free support for my Work. Loo Več

$140 AUD v 2 dneh
(53 ocen)
7.1
websicon

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

$50 AUD v 2 dneh
(61 ocen)
6.1
QbikThino

Hi there! I am Mahedi, a full stack developer. I have checked your screenshot and I'm certain I can do this job perfectly. I have 9+ years of experience in HTML, CSS, Bootstrap, Grid, Flex, Material UI, PHP, Laravel, Več

$100 AUD v 7 dneh
(58 ocen)
6.1
chdlivemasters

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...

$50 AUD v 2 dneh
(44 ocen)
6.0
DestinyGuider

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.

$99 AUD v 1 dnevu
(65 ocen)
5.7
MarkoNikovic

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 Več

$140 AUD v 7 dneh
(33 ocen)
5.9
saaz109

Hello, how are you doing today? I have read your serious suggestion carefully. I am an expert in PHP, MySQL, WordPress, Custom WordPress Plugins and Themes Development, Modifying WordPress Core, WordPress Hooks, Short Več

$140 AUD v 2 dneh
(56 ocen)
5.8
anayapallavi

I can fix this problem and i can start right now. Thanks.

$60 AUD v 2 dneh
(45 ocen)
5.5
Makakkikhan

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 Več

$200 AUD v 1 dnevu
(42 ocen)
4.6
netforcelabs

★★★ 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 Več

$250 AUD v 7 dneh
(7 ocen)
4.6
rizwange4

Hi there, I'm a professional WordPress Developer, having vast experience in WordPress Themes & plugins customization & development, I have read your project description carefully & I'm sure about to deliver the project Več

$90 AUD v 2 dneh
(26 ocen)
4.0
sachinranakasmp7

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 Več

$110 AUD v 7 dneh
(7 ocen)
3.1
iOSNitish

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.

$30 AUD v 7 dneh
(2 ocen)
1.2
heenanebliu

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 Več

$180 AUD v 3 dneh
(1 Ocena)
1.1
fahaduddin392

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 = __( Več

$30 AUD v 7 dneh
(0 ocen)
0.0
electronlgroup2

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

$140 AUD v 7 dneh
(0 ocen)
0.0