• Resolved doshisahil

    (@doshisahil)


    The plugin is breaking the add to cart button on my website. Please advise what can be done.
    You can check the homepage for the issue.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Ashok G

    (@wpashokg)

    what’s the problem that you’re facing ?

    Thread Starter doshisahil

    (@doshisahil)

    The add to cart button was an icon. Once the plugin is activated the icon becomes the word add to cart and that too, the text is displaced. Please check out the homepage once and just scroll over the products in the homepage. You will see for yourself. Thanks!

    Plugin Author Ashok G

    (@wpashokg)

    can you deactivate my plugin for a while, and notify me

    • This reply was modified 4 years, 6 months ago by Ashok G.
    Thread Starter doshisahil

    (@doshisahil)

    Done. Please check

    Plugin Author Ashok G

    (@wpashokg)

    add_filter('woocommerce_loop_add_to_cart_link','__wcmmax_add2cart');
    function __wcmmax_add2cart($link) {
      global $product;
      $product_id = $product->id;
      $product_sku = $product->get_sku();
        $mmaxEnable = get_post_meta($product_id, '_wc_mmax_prd_opt_enable', true);
        $minQty     = get_post_meta($product_id, '_wc_mmax_min', true);
      $ajax_cart_en = 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' );
        if ($ajax_cart_en &&  $mmaxEnable == 0) { $ajax_class = 'ajax_add_to_cart'; }
       $link = sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="button %s product_type_%s %s">%s</a>',
            esc_url( $product->add_to_cart_url().'&quantity='.$minQty ),
            esc_attr( $product->id ),
            esc_attr( $product->get_sku() ),
            esc_attr( isset( $minQty ) ? $minQty : 1 ),
            $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
            esc_attr( $product->product_type ),
            esc_attr( $ajax_class ),
             '<i class="p-icon icon-bag2" data-rel="tooltip" title="Add to cart"></i>' 
        );
      return $link;
    }

    add the above piece of code at the bottom of theme functions i.e., in the functions.php in your activated theme. after activating the plugin

    • This reply was modified 4 years, 6 months ago by Ashok G.
    Thread Starter doshisahil

    (@doshisahil)

    Worked like a charm. Thanks a lot!

    Plugin Author Ashok G

    (@wpashokg)

    you’re welcome

    Thread Starter doshisahil

    (@doshisahil)

    Hi!

    So, the plugin broke the add to cart button again. But on another page. Please check.

    I am providing the page URL and the credentials to login to that page. Its a custom login page and I have a custom User role that needs to be checked when you login.

    Thread Starter doshisahil

    (@doshisahil)

    URL: https://24by7.store/bulk-customer-login
    Username for Login: [email protected]
    Password: Pushttie@11

    • This reply was modified 4 years, 6 months ago by doshisahil.
    Plugin Author Ashok G

    (@wpashokg)

    for the product which min max is enabled ajax add to cart will not work.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Plugin is breaking add to cart on website’ is closed to new replies.