In order to integrate ez Form Calculator with WooCommerce, you can do one of the following options:
- Forms will add a single WooCommerce product to the cart
- Forms will add multiple WooCommerce products to the cart
- Multiple Forms will add multiple WooCommerce products to the cart (v220.127.116.11)
Before you’re going to integrate forms with WooCommerce, please check the following requirements:
- The option “Integrate with WooCommerce” is enabled in the global settings
- The “Add forms to products” option is enabled and…
- A global form ID is set or…
- a custom field named “ezfc_form_id” with form ID as value is set in the WooCommerce product(s). If you don’t see the custom fields view, click on “Screen options” at the top of the page and enable the “Custom fields” checkmark.
- If you want all form values to persist in the cart, you have to enable the option “Show selected values in checkout” in the global settings
- Not a requirement but good to know: if you want to use the current price of the product in the form, use the hidden element and enable the element option “Use_woocommerce_price”
If adding products to the cart fails (“Unable to add product #x to the cart”), make sure…
- … your product(s) exists at all (check the ID)
- … your product(s) have a price (0 works, too)
- … your product(s) are published (not set as draft)
- … you did not add the form via a shortcode (use a custom field named ezfc_form_id with the relevant form id as value)
1) Single Products
If you want to add a single product to the cart upon submission, open up the form options, click on the “WooCommerce” tab and enter the product ID here:
2) Multiple Products
In case you want to show a single form on all product pages, go to the Global settings page and click on the WooCommerce tab. You need to change the option Global form ID to the form ID you want to show.
2.1) Multiple Forms and Products
You also have the possibility to show individual forms for products. Add a custom field to WooCommerce products and name them ezfc_form_id along with the form ID as value.
If the form is not displayed in the right section of your page, you need to change the value of Global Settings > WooCommerce > Form display hook. A nice overview of compatible hooks can be seen on businnessbloomer.com