Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2690638
Custom icon for Fly Cart
Closed

Comments

  • Neil Turner started the conversation

    Hi

    Great plugin by the way, I'm really pleased I chose it.

    How can I use a custom svg as the menu icon?

  •  767
    Janilyn replied

    Hi Neil,

    Thank you for contacting WPClever Support Forum. We've just been back from the Tet Holiday vacation (9-17th Feb). So today, I am able to reach and process your ticket.

    I have assigned one of our developers to help you with that. He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,222
    Dustin replied

    Hi Neil,

    Please try to add below CSS code to WP-Admin → Appearance → Customize → Additional CSS:

    .woofc-menu-item .woofc-menu-item-inner i {
        display: none;
    } .woofc-menu-item .woofc-menu-item-inner:before {
        content: '';
        display: inline-block;
        width: 20px;
        height: 20px;
        background-image: url(https://www.flaticon.com/svg/vstatic/svg/941/941565.svg?token=exp=1613812522~hmac=e9a4f6581db59f5e6b26dc7aa9fa5b58);
        background-position: center center;
        background-repeat: no-repeat;
    }

    And the result https://www.screencast.com/t/dK5UhmZ7

    You can change the SVG icon link in the above code as you want.

    Best regards,
    Dustin

  • Neil Turner replied

    Thats great, thanks.

    How can I trigger Fly Cart with javascript/jQuery


  •  1,222
    Dustin replied

    You can use these JS functions:

    woofc_show_cart();
    woofc_hide_cart();
    woofc_toggle_cart();

    Best regards,
    Dustin

  • Neil Turner replied

    Hi


    Thanks for that, I'm updating the cart via Ajax and then calling woofc_show_cart() but the cart does not include the latest additional item.
    Is there a way to force an update before showing the cart?

    and is there any JS documentation?

  •  1,222
    Dustin replied

    You can add this code after adding to the cart via AJAX:

    $( document.body ).trigger( 'added_to_cart' );
    

    Best regards,
    Dustin

  • Neil Turner replied

    Thanks Dustin but thats not working for me on this site, the Flycart isn't updateing befiore displaying
    https://marquesussex.co.uk/product/manx-tables

    My Ajax call is below

    jQuery.ajax({

    type: 'POST',
    url: '/wp-admin/admin-ajax.php?nocache=' + new Date().getTime(),
    cache:  false,
    dataType: 'text',
    async: false,
    data: {
    'action': 'ms_add_to_cart',
    'pid': pid,
    'vid': vid
    },
    success:function(data) {
    var cartcount = parseInt(jQuery(".woofc-menu-item-inner").attr("data-count")) + 1;
    jQuery(".woofc-menu-item-inner").attr("data-count",cartcount);
    console.log('Product added to cart');
    console.log(cartcount);
    jQuery( document.body ).trigger( 'added_to_cart' );
    woofc_show_cart();
    //woofc_hide_cart();
    //woofc_toggle_cart();

    },
    error:function(data) {
    console.log('Product NOT added to cart');
    }
    });

  • Neil Turner replied

    Hi

    Its OK I get it to work by adding this before the other trigger line

    jQuery(document.body).trigger('wc_fragment_refresh');

  •  1,222
    Dustin replied

    That is good news. Thank you!

    If you are satisfied with our plugin, please reward it with a full five-star ★★★★★ rating. https://wordpress.org/support/plugin/woo-fly-cart/reviews/?filter=5 Thank you in advance! <3

    Best regards,
    Dustin