gravity form disappears with variation selection in woocommerce - php

I am using woocommerce with Mystile. I have variations of a product but also need the product customized. I have not figured out a way to handle product customization to meet my needs with woocommerce so I am also using gravity forms.
The problem I am experiencing is that when a single product is displayed and the user clicks on the variation option “choose an option” the add to cart disappears (I understand this is by design –which makes sense) but the gravity form on the page also disappears. I would like the gravity form not disappear. Does anyone have an idea how to fix this?
Thanks.

Related

Dynamically pass a Product ID as the main Product Field on a Gravity Form (Product Add On)

I've got a great form set up to allow the building of a complex product and then add it to the cart (using the GForms Product Add on). All lif this is perfect on the actual Woocommerce product page.
What I'd love to do is have this form embedded on a page and populate the Product ID dynamically, so that the form still picks up the product details and will add the new Item to the cart just as it does on a shop page. Having it on its own page (or on any page of the site) will allow us to offer a larger, focused experience to select all the options.
I've been looking into the code and the docs but I can't seem to make it work. The code references product_id everywhere, but the dynamic field option is name. So is this possible? Thanks!
If the data you are attempting to map is simple then the following snippet plus Gravity Forms default {embed_post} and {custom_field} merge tags can get you there:
https://gravitywiz.com/dynamic-products-via-post-meta/
If your data is more advanced (like mapping product attributes), check out Gravity Form Populate Anything:
https://gravitywiz.com/documentation/gravity-forms-populate-anything/

Removing td.actions from cart page

I need to remove td.actions from a WooCommerce cart page via PHP. The table contains a Coupon field, and a Update Basket button. I searched around, but only found ways to hide using CSS. Any help is more than appreciated.

Add Custom Input Field on Woocommerce Cart Page

I've been developing a WooCommerce site and I have a task where I have stuck. I need to add an extra custom input field into the cart items table.
Like for example, if a person orders '2000 youtube views' package, then right below the item name, I want the user to input his Youtube video URL.
I know I can add custom input fields on Product Page and can simply make them display on the Cart Page. But I want to take user input data onto the Cart Page. Each cart item will have a custom input field. So far, I have researched a lot but didn't have any success for my solution. All I found that to print the custom input field data onto the cart page added on the Product Page.
Any help would be appreciated
I've had this problem also. I've solved it with this. Adding the fields on the cart page like you did but with jQuery receive those values and dynamicly transfer them with a GET request, ( adding them to the submit button ) and $_GET fill them in the checkout page in a hidden input type.

Woocommerce create order from form outside of woocommerce

I have a need to create an advanced product with various discounts and conditional statements. I have tried several plugins including Gravity Forms Product Add Ons and various others but they dont seem to do what I need them to.
My need is I want to have a form the user fills out and I can handle all conditionals and when they hit the Add to cart button it will add their order to cart. I could use create order but not sure because it needs a product ID and I am kind of creating the product on the fly for each customer. I could also create the product as this thread suggests then add to cart but I fear if I manually create a product for each customer that we will have an absurd amount of products.
What would be the best way to create a form and then once filled out and submitted the total and details are sent to cart?
This link was a good resource but doesnt go into detail about the product id or how to do the form. Any guidance on the best way to tackle this?
UPDATE:
Here is a wireframe of what I want to do demonstrating the dynamic text boxes and discount rules. The deposits I am using the Woocommerce Deposits plugin. Just not sure the best way to do this.

Unable to display custom fields on archived-product.php WooCommerce Wordpress

I have this problem about my WordPress integration. My problem starts when I start customizing the woo commerce plugin. I make some custom fields using ACF Plugin. My problem is I am not able to display such custom fields on the archived-product.php.
archived-product.php is the shop page right ? But after making some custom fields and point it to ( page == shop ) and calling the custom field with the following code:
<?php the_field('top_image_banner_sub_pages'); ?>
The custom field is still not visible on the archived-product.php. My question is how do I call my custom field so that it would be visible in my shop field ? Your answers are highly appreciated. Thanks a lot Sir/Mam.
Using ACF for this page is a fine idea. I think your problem is your fields are on your "Shop" page, but in actuality the Shop page that WooCommerce is rendering is not associated with the Shop page ID.
The page that is loading is 'archived-product.php' as you mentioned. So you need to tell ACF exactly where to look by entering the ID of your page. So your code should look like this:
<?php the_field('top_image_banner_sub_pages', 123); ?>
Where 123 is replaced by the ID of your Shop page.
Dont use Acf for product custom fields.. please use custom fields of wordpress.
For add meta
https://codex.wordpress.org/Function_Reference/add_post_meta
For get meta
https://codex.wordpress.org/Function_Reference/get_post_meta

Categories