Auto update cart after quantity change

Almost one year late, but this question might still get visitors: You trigger the click, but the button doesn’t have enough time to become enabled, so that is why, by the time you click the second time the button becomes enabled. Remove the “disabled” propriety before triggering the click: <script> jQuery(‘div.woocommerce’).on(‘change’, ‘.qty’, function(){ jQuery(“[name=”update_cart”]”).prop(“disabled”, false); … Read more

Use is_product_category() properly

is_product_category() is to be used on woocommerce category archive pages only so first make sure that you are on category archive. instead of category number use category slug name is_product_category(‘category-slug’) no need to run OR(||) condition just use is_product_category(‘category-slug1′,’category-slug2’) to get same output

WooCommerce: Translation lost on AJAX call in Checkout page [closed]

I think I fixed the issue with the following extended function in my plugin: function localize_backend( $locale ) { // set langauge if user is in admin area if( defined( ‘WP_ADMIN’ ) || ( isset( $_REQUEST[‘pwd’] ) && isset( $_REQUEST[‘kau-boys_backend_localization_language’] ) ) ){ // ajax call from frontend if ( ‘admin-ajax.php’ == basename( $_SERVER[ ‘SCRIPT_FILENAME’ … Read more

WooCommerce – Overwrite action hook [closed]

It’s actually pretty simple to change the title in content-product.php, but you won’t be able to do it with a hook. Near the top of the file, you should see this line: Override this template by copying it to yourtheme/woocommerce/content-product.php All you have to do is copy the file to the above directory, replacing “yourtheme” … Read more

Display “add to cart” button on every listing in product category page?

You can use the WooCommerce hook woocommerce_after_add_to_cart_button. This hook will add content after the “Add To Cart” button. If the customer clicks on this button, the product should get added to the cart, and the customer should be send to the checkout page. Add the below code in your child theme functions.php /* Create Buy … Read more

How to add multiple product gallery images from front-end

if ( ! empty( $_FILES[‘muti_files’] ) ) { $files = $_FILES[‘muti_files’]; foreach ($files[‘name’] as $key => $value){ if ($files[‘name’][$key]){ $file = array( ‘name’ => $files[‘name’][$key], ‘type’ => $files[‘type’][$key], ‘tmp_name’ => $files[‘tmp_name’][$key], ‘error’ => $files[‘error’][$key], ‘size’ => $files[‘size’][$key] ); } $_FILES = array(“muti_files” => $file); $i=1; foreach ($_FILES as $file => $array) { if ($_FILES[$file][‘error’] !== … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)