• Is there a shortcode to insert the signup form manually? I’d like to add it to a custom notice on products that are on back order assuming that it would still work in such a scenario?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    you can use this shortcode

    [ywcwtl_form product_id=””]

    you can use it for a specific product (use the product_id arg).
    Try this and let me know if sounds good for you.

    Have a nice day
    YITH

    Thread Starter hwamart

    (@hwamart)

    Thanks, if used should this shortcode display on any specific product or only products that also meet the criteria for the waiting list?

    As it is not working for me!

    Thread Starter hwamart

    (@hwamart)

    Also does the shortcode only work on the premium version?

    Plugin Author YITHEMES

    (@yithemes)

    Hello there,
    the provided shortcode works on free version so i think there is a problem on your side. Could you send me a link where i can check this?

    Thread Starter hwamart

    (@hwamart)

    https://hwamart-b6e.eu.mywoocart.com/product/8954/heavy-duty-2m-stand/

    I’m using the following code:

    function add_backorder_waiting(){
    	global $product;
        if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) {
    	echo do_shortcode('[ywcwtl_form product_id="'.$product->get_ID().'"]');
    	echo "Backorder";
    	}
    
    }
    add_action( 'woocommerce_before_add_to_cart_button', 'add_backorder_waiting', 10 );

    As you can see it is inserting the second echo backorder just to test the rest but the short code is not working.

    https://prnt.sc/pk1yzh

    this link is an out of stock product where the plugin is working fine
    https://hwamart-b6e.eu.mywoocart.com/product/8977/aluminium-padded-flight-case-53cmx36cmx37cm/

    Plugin Author YITHEMES

    (@yithemes)

    Hi,
    the ywcwtl_form shortcode checks if the product is out-of-stock and, only in this case, the waiting list is shown.
    In your case the product is in “backorder”, so the waiting list will be not shown.

    Please try simply to
    1. edit your code snippet as follows:

    function customization_add_waiting_list(){
    	echo do_shortcode('[ywcwtl_form]');
    }
    add_action( 'woocommerce_before_add_to_cart_button', 'customization_add_waiting_list' );

    2. set the stock status of your product to “Out of stock”.

    This way you’ll be able to see the waiting list form ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Shortcode + Backorder’ is closed to new replies.