• Resolved imrulz

    (@imrulz)


    I added a section on my homepage to show popular products. But the plugin is working here. It was broken at first. then i fixed the css but the given value by the +/- button is not going to cart. Thanks in advance.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author taisho

    (@taisho)

    Hello,

    I would appreciate it if you could restore the CSS to the original state after plugin installation. Even in its current state, the display doesn’t look good. Being able to find out all the CSS settings that prevent the intended layout after the plugin installation would be helpful for me and I could apply it in the next releases.

    I see that both the JS script and CSS inline script are correctly loaded on this shop page. I will investigate why changing quantity doesn’t affect the HTML attribute responsible for passing quantity value after adding to cart.

    Best regards,

    Ryszard

    Plugin Author taisho

    (@taisho)

    I checked the website once more. While in my previous post I mentioned that scripts and CSS are correctly loaded on the shop page, I meant home page. Qty Increment Buttons for WooCommerce as it stands in plugin features supports product, cart, shop and category pages. The only reason why the buttons and quantity field show up on your home page that is not a shop page is because of custom changes.

    The code to change quantity is inline script and is significantly different from the original code. What does not work for you, is the quantity in the input field not being added to cart. That’s because the inline script that is normally added to shop and category pages, is not loaded on your home page at all. Even if you enqueued this script for your home page, keep in mind that there is no .archive class on your home page, so you would need a different selector to target the element on your home page. For now, I don’t plan to add Home page support.

    jQuery( ".woocommerce.archive" ).on( "click", ".quantity input", function() {
    	return false;
    });
    jQuery( ".woocommerce.archive" ).on( "change input", ".quantity .qty", function() {
    	var add_to_cart_button = jQuery( this ).parents( ".product" ).find( ".add_to_cart_button" );
    
    	// For AJAX add-to-cart actions
    	add_to_cart_button.data( "quantity", jQuery( this ).val() );
    
    	// For non-AJAX add-to-cart actions
    	add_to_cart_button.attr( "href", "?add-to-cart=" + add_to_cart_button.attr( "data-product_id" ) + "&quantity=" + jQuery( this ).val() );
    });

    Maybe changing to jQuery( ".woocommerce" ) and enqueuing on home page would be enough?

    In the next release of Qty Increment Buttons for WooCommerce, I’ll address 4 styling issues that my plugin has on your page (you would need to eliminate !important from min-width and max-width to make quantity input field affected by 2 of these changes.). I’ll try to release the next version this Monday.

    • This reply was modified 5 years, 4 months ago by taisho.
    • This reply was modified 5 years, 4 months ago by taisho.
    Plugin Author taisho

    (@taisho)

    I’ve just released the 2.2 version that applies only CSS changes to the plugin. If you want to customize it for use on non-shop Home page, it should at least give you the correct formatting when min-width and max-width rules with !important are removed and hopefully my previous post is helpful for solving the main issue.

    Plugin Author taisho

    (@taisho)

    I’m closing this topic because 2 weeks have passed with no activity. I see that at least one of the problems you had was resolved because you let me know in a different thread.

    If you still need assistance, feel free to reopen it or post a new one.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No option for regular page or Homepage’ is closed to new replies.