Home Forums WoodMart support forum Gravity forms CART

Gravity forms CART

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #205456

    subitoweb
    Participant

    Hello,
    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 link

    https://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 you

    The 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 you

    #205464

    subitoweb
    Participant

    I realized now that the file did not comply with the policies, I attach the format of the script in txt
    thank you

    #205469

    subitoweb
    Participant

    Point 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

    #205568

    Artem Temos
    Keymaster

    Hello,

    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

    #205591

    subitoweb
    Participant

    Sure,

    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();

    #205598

    Artem Temos
    Keymaster

    Sorry, 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.

    #205602

    subitoweb
    Participant

    Thanks, 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 you

    #205608

    Artem Temos
    Keymaster

    Sorry, 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

    #205680

    subitoweb
    Participant

    OK thanks

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Gravity forms CART’ is closed to new replies.