Support » Plugin: WC Fields Factory » Make field editable on cart

  • Hi,
    I would like to edit the fields on cart. I think this option:

    Make this field editable on cart. Screenshot: https://cl.ly/0P1J2k122i2G

    Is what i need, but when i click in Yes, it doesn’t work. I can’t edit the fields in cart page.

    Can you help me?

    Thanks!

Viewing 9 replies - 16 through 24 (of 24 total)
  • Matt

    (@msjanoah)

    I have it working again, and it’s working consistently. I used the same method in my earlier post, but you can’t use “name” as a field, because that creates a coding conflict.

    Thread Starter Lidia

    (@lydiamunoz)

    Hi Matt,

    I have achieved something, but it works only sometimes, I do not understand why. But for example in a textarea type field it never works.

    Have you tried it?

    Thanks.

    Matt

    (@msjanoah)

    No, I haven’t tried a text area field…

    Thread Starter Lidia

    (@lydiamunoz)

    Well, the editable fields in the cart did not work for me, I had to touch the code to make it work … I do not know how you got it …

    Matt

    (@msjanoah)

    Well, it stopped working again for no reason. I didn’t change any settings, and I’m ready to give up.

    Would you mind sharing the code that you changed? I’m afraid that my coding abilities are limited to CSS and basic HTML…

    Thanks

    Thread Starter Lidia

    (@lydiamunoz)

    Yes,
    I edited the file: wc-fields-factory/assets/js/wccpf-front-end.js

    Around line 25:

    var prodId = ahd_get_data(target, “product_id” );
    var product_cart_id = ahd_get_data(target, “cart_id” );
    //var product = target.closest( “tr.cart_item” ).find( “.wcff_get_referance_data” );
    //var prodId = product.data( “product_id” );
    var field_name = target.data( “field” );
    //var product_cart_id = product.data( “cart_id” );

    Around line 48 i commented 2 lines and add this:

    var prodId = ahd_get_data(target, “product_id” );
    var product_cart_id = ahd_get_data(target, “cart_id” );
    //var prodId = target.closest( “tr.cart_item” ).find( “.wcff_get_referance_data” ).data( “product_id” );
    //var product_cart_id = target.closest( “tr.cart_item” ).find( “.wcff_get_referance_data” ).data( “cart_id” );

    And in line 399:

    function ahd_get_data(ahd_target, ahd_data) {

    ahd_elemento = ahd_target.closest(‘div.row’).find(‘.delete-item’);
    if (ahd_data ==”product_id”) {
    ahd_return = ahd_elemento.find(“a”).data(“product_id”);

    } else if (ahd_data ==”cart_id”) {

    ahd_str = ahd_elemento.find(“a”).attr(“href”); separador1=”remove_item=”; separador2=”&”;
    ahd_return = ahd_str.substring(ahd_str.indexOf(separador1) + separador1.length,ahd_str.indexOf(separador2));
    }

    return ahd_return;
    }

    I can send you the file but i dont know how attach a file here…

    Thanks.

    Matt

    (@msjanoah)

    Cool – Can you share the file through google drive or dropbox or msjanoah@yahoo.com?

    Thanks again!
    Matt

    Thread Starter Lidia

    (@lydiamunoz)

    Done, I sent you to msjanoah@yahoo.com
    Thanks.

    Matt

    (@msjanoah)

    Hi – Thank you. I received it, but I couldn’t get it to work.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Make field editable on cart’ is closed to new replies.