Ask your WordPress questions! Pay money and get answers fast! (more info)

Woocoomerce Thumbnail Input Quantities plugin - issues WordPress

I'm using Woocoomerce Thumbnail Input Quantities plugin with Avada Theme

I have couple of issues with this - it works but sort of... i.e its inconsistent!

(1) On some computers the UP / Down Scroll arrows do not show

(2) If user Types in a Quantity in to the input box then simply presses added to cart more often than not only 1 QTY is added to cart ie. if I type in 20 and press add it simply adds 1 (not 20). Do the same on another item and correct qty is added.

When Scroll Up/Down arrows are used the correct Qty is added

But like I said earlier - does not work on some pc's !

I need to make this Qty Input consistent

Don't care if Scroll arrow can't be used - just a consistent Input box is fine !

test site Url http://www.logic-online.com/tbcc7

Answers (1)

2015-12-02

Rempty answers:

Plz create a test user and send me logins. Can't see qty or prices.


bas mistry comments:

Done !


Rempty comments:

You added manually the add button and the thumbnail-quantity, modifying the templates, right?
Just move the data-quantity an put as first attribute

change this
<a class="button add_to_cart_button product_type_simple" href="/tbcc7/index.php/product-category/bag-prepack/?add-to-cart=6275" data-quantity="1" rel="nofollow" data-product_id="9478" data-product_sku="Test103">ADD</a>

must be:
<a data-quantity="1" class="button add_to_cart_button product_type_simple" href="/tbcc7/index.php/product-category/bag-prepack/?add-to-cart=6275" rel="nofollow" data-product_id="9478" data-product_sku="Test103">ADD</a>


Rempty comments:

If not work, disable the plugin, Download this file https://gist.github.com/mikejolley/2793710/download (add-to-cart.php)

Upload to yourtheme_name/woocommerce/loop/

Source:
https://docs.woothemes.com/document/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/


bas mistry comments:

Not manully added but ....
I have WP Customize plugin which allows Button Text to be changed

I removed the Customised "ADD"

But still doing the same.

I tried the other add-to-cart.php - but 2 problems
(1) Can't seem to modify the buttons don't line up and I haven't been able to find the css to change !
(the QTY and Add to cart button are about 5-7px out)
(2) Main problem is because this is not ajax the whole page refereshes. Users not keen on that
[This might be a fall-back ...]


Rempty comments:

OK, take a look to this

https://gist.github.com/claudiosmweb/5114131

Is a modified add-to-cart.php, support ajax + quantity.



bas mistry comments:

Yes, that works but too much white space
the qty add to cart won't line up

Unfortunately, I took a look at the CSS but won't line up and too much white space the users didn't like


Rempty comments:

you forgot to add this to your functions.php

function cs_wc_loop_add_to_cart_scripts() {
if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) : ?>

<script>
jQuery( document ).ready( function( $ ) {
$( document ).on( 'change', '.quantity .qty', function() {
$( this ).parent( '.quantity' ).next( '.add_to_cart_button' ).attr( 'data-quantity', $( this ).val() );
});
});
</script>

<?php endif;
}
add_action( 'wp_footer', 'cs_wc_loop_add_to_cart_scripts' );


bas mistry comments:

I did add it.

I just checked...

and the Ajax bit works too


Rempty comments:

.product-buttons form.cart{
margin:0px!important;
}
.product-buttons form.cart .quantity.buttons_added{margin-top:0px!important;float:left;}
.product-buttons form.cart .add_to_cart_button{float:left;}


bas mistry comments:

thanks

that worked with a few tweaks


bas mistry comments:

ah...

Spoke too soon

(1) Promotions Page (this page is simply Shortcode for Featured and On Sale item - when items are added to cart by entering Quantity or using + / - <strong>only 1 is added</strong>

(2) When an item is added to the Cart
i.e 5 x 10M Clear Tape - then another item
say 3 x 13 AMP Fuses 3'

now if I decide to add say 10 more to either the items on this page ie. 10 x 10M Clear Tape
only 5 are added.

I think this is due to Page Refresh. So if I goto NEXT page and the PREV correct number is added