This topic has 6 replies, 3 voices, and was last updated 11 months, 1 weeks ago ago by Andrew Mitchell
function change_specific_availability_text( $availability ) {
if ($availability[ ‘class’ ] == ‘available-on-backorder’) {
$availability[ ‘availability’ ] = __( ‘This product or product color selected is in central ware house will take additional 4 or 5 days to disptach’, ” );
}
return $availability;
}
add_filter( ‘woocommerce_get_availability’, ‘change_specific_availability_text’, 10, 1 );
if the product is on back order i just want to notify user that it takes time instead showing message “Available on back order”
Dear Uday,
We hope this message finds you well.
We suggest utilizing the code snippet provided below to achieve the desired functionality:
function change_specific_availability_text( $availability, $product ) {
if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) {
$availability = $product->backorders_require_notification() ? __( 'Availability Notice: The selected product or color is located in our central warehouse and may require an additional 4 to 5 days for dispatch.', 'woocommerce' ) : '';
} elseif ( ! $product->managing_stock() && $product->is_on_backorder( 1 ) ) {
$availability = __( 'Availability Notice: The selected product or color is located in our central warehouse and may require an additional 4 to 5 days for dispatch.', 'woocommerce' );
}
return $availability;
}
add_filter( 'woocommerce_get_availability_text', 'change_specific_availability_text', 999, 2 );
Please implement this code to adjust the availability text for products that are on backorder.
Should you require any further assistance, please do not hesitate to contact us.
Best regards,
The 8Theme Team
This is fine but color of text is green, but i want to make it bold and red color for better visibitly to customer like a warning. (Any small Code snippet to make it happen)
Hi @uday,
Please add the following CSS codes under Theme Options > Theme Custom CSS > Global CSS:
p.stock.available-on-backorder.step-1 {
color: red;
font-weight: bold;
}
One more small thing : https://www.***.com/product/korean-necklace-set-125/ in this one go to gold color and see the message should be shown in green as item is in stock dont know why it is showing in red color.( I want to make it green as item is in stock)
The color can be changed under Theme Options > WooCommerce(Shop) > Shop Elements > Advanced Product Stock:
Best regards,
The 8Theme Team
Dear uday,
In the spirit of gratitude, we want to express our appreciation for your trust in our products. As a valued customer, your experience matters greatly. Would you consider sharing it by giving our theme a deserving 5-star rating on ThemeForest?
Click here to share your thoughts: https://themeforest.net/downloads
Being part of our community means a lot, and your feedback contributes immensely.
Best Regards,
The 8Theme Team
The issue related to '‘this code is working for old theme which i had but with this new theme it is not working’' has been successfully resolved, and the topic is now closed for further responses