Product Backorder message issue for simple product

This topic has 6 replies, 2 voices, and was last updated 1 months, 3 weeks ago ago by Luca Rossi

  • Avatar: uday
    uday
    Participant
    March 10, 2024 at 12:54

    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/

    Please, contact administrator
    for this information.
    5 Answers
    Avatar: uday
    uday
    Participant
    March 10, 2024 at 19:00

    Added staging details user and pass as well

    problem is only for simple product

    Please contact administrator
    for this information.
    Avatar: uday
    uday
    Participant
    March 10, 2024 at 19:08

    Attached video

    Files is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    March 11, 2024 at 09:04

    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!

    Avatar: uday
    uday
    Participant
    March 11, 2024 at 14:24

    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

    Avatar: Justin
    Luca Rossi
    Support staff
    March 11, 2024 at 15:14

    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

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.