usitabu
Forum Replies Created
-
Version 2.0.0 is still working properly.
Forum: Plugins
In reply to: [Service Area Postcode Checker] Success message leaves junk dataThank you for the answer.
It was possible to omit the customization of the code, because the plug-in administrative fields allow entering HTML tags. At the end of the Success Message field I have entered the text:
<span id='postcode_mask_to_remove'>and added some CSS:
#postcode_mask_to_remove { display:none; }One more issue, but not regarding QIB.
There is a problem with the SMNTC plugin regardless of the version. Using it, you can reduce the quantity of product to 0 on the shop/archive page. After pressing the “Add to cart” button, the amount of such product will increase in the cart by 1. For the SMNTC 1.6 version I corrected this by changing the condition in the code
if (val> 0) {toif (val> 1) {.Sorry for delayed answer. I can provide two links now, showing “Add to Cart” button behavior.
First link https://test.goldenproducts.pl/sklep/; SMNTC v. 1.6; QIB v. 1.01 – everything works correct (for the combination of SMNTC 1.9 and QIB 1.01 it also works properly).
Second link https://my.goldenproducts.pl/sklep/; SMNTC v. 1.9; QIB v. 2.0 – problem on shop/archive page.
Let me know if I can provide any further information. Maybe it will help you in your work on the new version.
Thank you for detailed explanation. It’s very useful.
The web page that I’m preparing is being done a bit “dirty” at the moment. This is partly due to my lack of experience in WordPress, HTML, CSS, etc. At the moment I need to get some functionalities quickly, then I will improve the code.
I searched and tested various plugins for the appropriate “-/+” buttons presentation and functionality. I needed this for all places where there is a quantity of product. The operation of your plugin and the way the code you write, I liked the most. But it is limited to the product and the cart only. In turn, SMNTCS does what I need on the shop/archive page. That’s why I used it and limited its operation using CSS. I suppose that SMNTCS does it by accident, because in its latest version it behaves unstably (for some products it increases / decreases the quantity, and for others it does not).
In summary: I use your plugin version 1.01 and SMNTCS version 1.6. The whole works as I need it, i.e. the – / + buttons perform everywhere correctly (except for a quick preview).
I will be able to share website link and return to testing this functionality after June 12,
Once again, thank you very much for your help.
I’ve tried a few solutions for archive/shop. Since my needs concern on simple products the plugin ThemesZone WooCommerce Ajax Quantity looks pretty intrested to me.
However finally, I’ve decided to use some snippet code for quantity field, the SMNTCS WooCommerce Quantity Buttons plugin for minus/plus signs and some CSS code for styling.
This solution works, except pop-up product quick view.
Used snippet:
/** * Add quantity field on the archive page. */ function custom_quantity_field_archive() { $product = wc_get_product( get_the_ID() ); if ( ! $product->is_sold_individually() && 'variable' != $product->product_type && $product->is_purchasable() ) { woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity() ) ); } } // On the left side of the ‘Add to cart’ button add_action( 'woocommerce_after_shop_loop_item', 'custom_quantity_field_archive', 0, 9 ); // On the right side of the ‘Add to cart’ button //add_action( 'woocommerce_after_shop_loop_item', 'custom_quantity_field_archive', 15, 9 ); /** * Add requires JavaScript. */ function custom_add_to_cart_quantity_handler() { wc_enqueue_js( ' jQuery( ".post-type-archive-product" ).on( "click", ".quantity input", function() { return false; }); jQuery( ".post-type-archive-product" ).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() ); }); ' ); } add_action( 'init', 'custom_add_to_cart_quantity_handler' );Unfortunately, I can’t provide you link to the website as it’s currently a restricted project. There will be some possibilities after 12 of June.
I’ve tested by switching on/off some updated plugins. The problem occured only for QIB. Then I’ve had get back to version 1.01 and it worked OK. Then I’ve updated to 2.0 and problem recurred.
Thank you for response! Good job anyway. Plugin’s feature for archive/shop page would be very appreciated.