Hello there,
Good Day!!
We’re here to assist you with this one.
Shortcode for Subscribe Form:
[cwginstock_subscribe_form product_id=’304′ variation_id=’314′] //product_id and variation_id are parameters.
i) For simple products enter the ID of the simple product type that you want to display on the subscribe form.
[cwginstock_subscribe_form product_id=’304′]
ii) For a variable product, enter the id of both the parent id and the variation id.
[cwginstock_subscribe_form product_id=’304′ variation_id=’314′]
Thanks.
Hi !
Thank you for your reply but we have more than 300 products.
Is it possible to have only one shortcode ?
Thank you again,
Aude
Maybe could you provide me a hook ?
Hello there,
Good Day!!
We suggest you add the following code to your custom template product page, where it retrieves the product ID and variation ID:
echo do_shortcode(“[cwginstock_subscribe_form product_id=”.$product_id.” variation_id=”.$variation_id.”]”);
Thanks.
Hi there,
Thank you so much.
But I try to add shortcode on product template but form does not display.
Thank you again and have a nice day,
Aude
Hi there,
What hook you use on the product page?
I would need to know what action they hook into.
Thank you in advance,
Aude
Hello there,
The hook ‘woocommerce_simple_add_to_cart’ is used to display a subscription form. You can find this hook in the file ‘class-product.php’.
Thanks.