Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1071448

    Hi,

    I want to enable adding variation product directly from shop page. So far it’s working fine, here’s the guide I followed:
    https://stackoverflow.com/questions/51827835/how-to-add-to-cart-without-reloading-page-on-woocommerce/51828575#51828575

    There’s only one thing missing, it’s the loading sequence when you click “Add to Cart” (in my case, it’s “Buy Now” button). Enfold gives loading sequence, like:
    – reducing “Add to Cart” button opacity
    – loading spinner on product image
    – check mark after it’s successfully added
    – notification on cart, that product is added

    I want to add those sequence to my custom button. You can see for yourself at my site (link attached), if you search for “VARIABLE” product, the ones with select option to select variations, and you click “Buy Now”, it’ll just add the product directly, no loading sequence.

    Can you help?

    Thanks.

    #1072699

    Guys, it’s been 3 days now, no one? Really? I’m told you’re the best, that’s why I bought this theme for the support. So far my questions always got a “please hire a freelance” standard reply. Come on!

    For this question, surely you’ll have the answer, since I’ve checked with your files, and the loading sequence is in fact from Enfold, I just can’t get it to work with my custom button since I don’t know where to hook it at.

    This is from Enfold’s woocommerce-mod.js

    function product_add_to_cart_click()
    {
    	var jbody 		= jQuery('body'),
    		catalogue 	= jQuery('.av-catalogue-item'),
    		loader		= false;
    		
    	if(catalogue.length) loader	= jQuery.avia_utilities.loading(); 
    
    	jbody.on('click', '.add_to_cart_button', function(e)
    	{
    		var button = jQuery(this);
    		button.parents('.product:eq(0)').addClass('adding-to-cart-loading').removeClass('added-to-cart-check');
    		
    		if(button.is('.av-catalogue-item'))
    		{
    			loader.show();
    		}
    		
    		var $html = jQuery('html');
    		if( ! $html.hasClass( 'html_visible_cart' ) )
    		{
    			$html.addClass('html_visible_cart');
    		}
    		
    		//e.preventDefault();
    	});
    	
    	jbody.on( 'added_to_cart', function()
    	{
    		jQuery('.adding-to-cart-loading').removeClass('adding-to-cart-loading').addClass('added-to-cart-check');
    		
    		if(loader !== false)
    		{
    			loader.hide();
    		}
    	});
    	
    }

    I have tried adding my button class into that function, but still no loading sequence.

    Any help is appreciated.

    Thanks.

    #1073054

    Hi Arthapignet,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

    #1073114

    I’m not asking for customization or modification of the theme, I’m doing the modification myself. What I’m asking is how to hook on that function of yours (which I already point out at my previous post) to another element, in this case, a button.

    Thanks.

    #1075152

    Hi,

    There is no way to do that, with our existing hooks. This is what Victoria also meant :)

    Best regards,
    Basilis

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.