This topic has 6 replies, 2 voices, and was last updated 9 months, 1 weeks ago ago by Luca Rossi
Earlier you gave some tips to integrate my old code to new which shows message when product is in back order.
https://www.mynkas.com/product/korean-necklace-set-125/ >>> Select black color.
“Availability Notice: The selected product or color is located in our central warehouse and may require an additional 4 to 5 days for dispatch.”
for simple product the message is not being shown as expected can you help on this
https://www.mynkas.com/product/white-star-artificalset-chokar-set-112/
Added staging details user and pass as well
problem is only for simple product
Attached video
Hi @uday,
To show the backorder message on simple product pages, please add the following code under functions.php file locates in your child theme:
add_action('woocommerce_product_meta_start', 'xstore_display_jetengine_meta_data', 25);
function xstore_display_jetengine_meta_data() {
global $product;
if($product->is_type('simple')){
$availability = $product->get_availability();
?>
<div class="woocommerce-variation-availability">
<p class="<?php echo $availability['class']; ?>">
<?php echo $availability['availability']; ?>
</p>
</div>
<?php
}
}
Hope it helps!
https://www.mynkas.com/product/white-star-artificalset-chokar-set-112/
i am seeing amessage at the end of product after add to compare
but i need to show message after the price next line , i want to make color red of the message
Dear Uday,
We kindly request that you update the existing code with the following snippet:
add_action('woocommerce_after_template_part', 'xstore_woocommerce_product_meta_start', 25);
function xstore_woocommerce_product_meta_start($template_name) {
global $product;
if($template_name == '/single-product/price.php' && is_singular('product') && $product->is_type('simple')){
$availability = $product->get_availability();
?>
<div class="woocommerce-variation-availability">
<p class="<?php echo $availability['class']; ?>">
<?php echo $availability['availability']; ?>
</p>
</div>
<?php
}
}
Additionally, please insert the following custom CSS code into the Theme Options under Theme Custom CSS > Global CSS:
.elementor-widget-woocommerce-product-etheme_price .woocommerce-variation-availability p.available-on-backorder.step-1 {
color: red;
margin-top: 10px;
}
Your attention to this matter is greatly appreciated. Should you have any questions or require further assistance, please do not hesitate to reach out.
Best regards,
The 8Theme Team
You must be logged in to reply to this topic.Log in/Sign up