• Resolved feedely

    (@feedely)


    Hi there,

    I’ve found the code snipped in the FAQ’s which should allow us to populate an availability date 7 days ahead of the current date, however it doesn’t appear to be working properly for us.

    I’ve checked that the products in question are set to Back Order, and that the availability date on them is blank – the snipped executes without logging any errors, however when I download the feed file (whether in CSV or XML format) the availability dates are not todays date + 7 days – it’s mostly giving me 12/12/2024. In the feed screenshot below some lines have different dates, this is where I’ve manually input them to try and get them to pull through.

    Any ideas greatly appreciated!

    Feed setup – https://pasteboard.co/w55EiKpjFbkN.png

    Snippet – https://pasteboard.co/f55xCUgn3Zge.png

    Feed – https://pasteboard.co/3IHu21iZ4yrN.png

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter feedely

    (@feedely)

    Apologies, I forgot to add that whilst all of these lines are set to “Backorder” in Woocommerce, the feed is showing them as “Preorder” – I’m unsure if this will be impacting anything and, if so, how to correct it.

    Thanks!

    Plugin Author Ohidul Islam

    (@wahid0003)

    Hi @feedely

    Please use the below snippet. It should work. Let me know if you need further help.

    /**
     * @param string      $availability_date
     * @param \WC_Product $product
     * @param array       $config Feed Configuration
     *
     * @return string
     */
    function woo_feed_filter_product_availability_date_callback( $availability_date, $product, $config ) {
    	if ($product->is_on_backorder() ) {
    		$availability_date = gmdate( 'c', strtotime( '+7 days' ) );
    	}
    	
    	return $availability_date;
    }
    add_filter( 'woo_feed_filter_product_availability_date', 'woo_feed_filter_product_availability_date_callback',10,3 ); 
    Plugin Support ansarybadal

    (@ansarybadal)

    Hi @feedely

    As we are not getting any further replies to this thread, we are considering and marking this topic resolved.

    Please, feel free to create another topic if you need further assistance.

    Thank you,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Backorder – Availability Date – Snippet not working’ is closed to new replies.