Home › Forums › WoodMart support forum › Gravity forms CART
Gravity forms CART
- This topic has 8 replies, 2 voices, and was last updated 4 years, 4 months ago by subitoweb.
-
AuthorPosts
-
June 22, 2020 at 4:30 pm #205456
subitowebParticipantHello,
I changed the template on the e-commerce site by activating your template. The site is combined with products with the gravity forms module and I have two problems:
The first concerns products with gravity forms with a multi-page module. Once clicked on the next, it returns to the cart, but the configuration is not completed, obviously it sends the message “no product selected”. On this I use a gravity forms woocommerce module, at the linkhttps://codecanyon.net/item/woocommerce-gravity-forms-product/19349744
I specify that in the previous template it worked well.
If it is not possible to intervene I asked the plugin developer for assistance, but maybe it depends on the WoodMart template.
Thank youThe second problem is given by hiding the items that generates gravity forms produced and I solved it by inserting this scrip in the fuction.php file, which allows me to select each block of gravity that I want to hide and, it worked well in the previous template, while if I insert the site stops on WoodMart. Is it possible to get assistance on this point? Thank you
I attach the script file (woo-gf-remove-fields.php) to hide the gravity blocks in the cart.
Thank youJune 22, 2020 at 5:03 pm #205464
subitowebParticipantI realized now that the file did not comply with the policies, I attach the format of the script in txt
thank youJune 22, 2020 at 6:06 pm #205469
subitowebParticipantPoint one solved, the resolution is missing where I can insert the attached script to disable some blocks of gravity forms from the woocommerce cart. Thanks
June 23, 2020 at 6:51 am #205568
Artem TemosKeymasterHello,
We are glad that you sorted your problem.
As for the second point, would you mind to clarify the problem and provide a bit more explanation so we can understand it and try to help?Kind Regards
June 23, 2020 at 7:29 am #205591
subitowebParticipantSure,
I am using gravity forms for woocommerce product sheets, I need to integrate this script in order to remove gravity forms blocks in the cart.
On the previous template I had inserted the script on the functions.php file and it worked correctly, while on your template the site is interrupted.
So I ask you for assistance on where to itegrate, so it is easy to subsequently intervene for template updates.
Thank you
Script to be integrated as described above:
<?php
/**
* WooCommerce Gravity Forms Add-on: Add support for removing a field from the product description in the cart.
*
*/
class WooGFRemoveFieldFromProductDescription {public function __construct() {
add_action( ‘gform_field_advanced_settings’, array( $this, ‘field_settings_ui’ ), 10, 2 );
add_action( ‘gform_editor_js’, array( $this, ‘field_settings_js’ ) );add_filter( ‘woocommerce_get_item_data’, array( $this, ‘modify_item_data’ ), 11, 2 );
add_action( ‘woocommerce_add_order_item_meta’, array( $this, ‘delete_order_item_meta’ ), 11, 2 );}
public function modify_item_data( $other_data, $cart_item ) {
$form_id = rgars( $cart_item, ‘_gravity_form_data/id’ );
if( ! $form_id )
return $other_data;$form = GFFormsModel::get_form_meta( $form_id );
foreach( $form[‘fields’] as $field ) {
if( ! rgar( $field, ‘wgfrfEnable’ ) )
continue;// reindex array for next loop
$other_data = array_values( $other_data );for( $i = count( $other_data ) – 1; $i >= 0; $i– ) {
if( $other_data[$i][‘name’] == GFCommon::get_label( $field ) )
unset( $other_data[$i] );
}}
return $other_data;
}public function delete_order_item_meta( $item_id, $cart_item ) {
$form_id = rgars( $cart_item, ‘_gravity_form_data/id’ );
if( ! $form_id )
return;$form = GFFormsModel::get_form_meta( $form_id );
foreach( $form[‘fields’] as $field ) {
if( ! rgar( $field, ‘wgfrfEnable’ ) )
continue;woocommerce_delete_order_item_meta( $item_id, GFCommon::get_label( $field ) );
}
}
public function field_settings_ui( $position ) {
if( $position != 450 )
return;?>
<li class=”wgfrf-enable-setting field_setting”>
<input type=”checkbox” id=”wgfrf-enable” value=”1″ onclick=”SetFieldProperty( ‘wgfrfEnable’, this.checked )”>
<label class=”inline” for=”wgfrf-enable”>
<?php _e( ‘Remove This Field From WooCommerce Cart Item Description’ ); ?>
</label><?php
}public function field_settings_js() {
?><script type=”text/javascript”>
(function($) {$(document).bind(‘gform_load_field_settings’, function(event, field, form) {
$(“#wgfrf-enable”).attr( ‘checked’, field.wgfrfEnable == true );
});for( inputType in fieldSettings ) {
if( fieldSettings.hasOwnProperty( inputType ) )
fieldSettings[inputType] += ‘, .wgfrf-enable-setting’;
}})(jQuery);
</script><?php
}}
new WooGFRemoveFieldFromProductDescription();
June 23, 2020 at 7:52 am #205598
Artem TemosKeymasterSorry, but it is an unofficial third-party code and we don’t know how it supposes to work. You can try to put it to the child theme but we don’t guarantee its 100% compatibility with our theme.
June 23, 2020 at 7:59 am #205602
subitowebParticipantThanks, I tried the child theme but it doesn’t work.
On the previous topic it worked, can’t you also give assistance for a fee? Thank youJune 23, 2020 at 8:11 am #205608
Artem TemosKeymasterSorry, but we are not available for custom development at the moment. We can suggest you to hire our partners to do this job https://wpkraken.io/?ref=xtemos.studio
June 23, 2020 at 10:48 am #205680
subitowebParticipantOK thanks
-
AuthorPosts
Tagged: Gravity Forms, woocommerce
The topic ‘Gravity forms CART’ is closed to new replies.
- You must be logged in to create new topics. Login / Register