In woocommerce some products have empty options, but how to check this
In woocommerce some products have empty options, but how to check this
In woocommerce some products have empty options, but how to check this
You use upload_mimes filter to restrict the image type as : add_filter(‘upload_mimes’,’restict_image_type’); function restict_image_type($mimes) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’, ); return $mimes; } For upload limit you can set in .htaccess one of the following; LimitRequestBody 1048576 //( 1MB) php_value upload_max_filesize 1M php_value post_max_size 1M
You don’t need to add class to those elements. You can apply CSS style to those elements by using following selectors respectively. .post-type-archive-product ul.products li.product .post-type-archive-product ul.products li img .post-type-archive-product ul.products li .button .post-type-archive-product ul.products li .woocommerce-loop-product__title .post-type-archive-product ul.products li span.woocommerce-Price-amount.amount
here is product set in display in cart in cart.php $_product = apply_filters( ‘woocommerce_cart_item_product’, $cart_item[‘data’], $cart_item, $cart_item_key ); $product_id = apply_filters( ‘woocommerce_cart_item_product_id’, $cart_item[‘product_id’], $cart_item, $cart_item_key ); $thumbnail = apply_filters( ‘woocommerce_cart_item_thumbnail’, $_product->get_image(), $cart_item, $cart_item_key ); if ( ! $_product->is_visible() ) { echo $thumbnail; } else { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($_product->id), ‘thumbnail’ ); $cartimgsrc=UNAVAILABLEIMG; if($thumb[0]){ $cartimgsrc=$thumb[0]; $product … Read more
So i manage to solve the problem myself after looking little more around, the hook is super poorly named. But it does the trick! It fires after the order is created, so you can manipulate the order as you wish. add_action(‘woocommerce_process_shop_order_meta’, woocommerce_process_shop_order’, 10, 2); function woocommerce_process_shop_order ($post_id, $post) { global $woocommerce; $oOrder = new WC_Order($post_id); … Read more
Allow customer to choose an optional free/paid product to add to their order (and reduce stock reduced & record sale)
There are several plugins available that can do this for you. For example YITH WooCommerce Added to Cart Popup. Otherwise, I would recommend you to create a custom plugin that adds this functionality with Javascript. Or add it to your theme. If is not a custom theme, then take a look at child themes.
The googles suggested several ways to do this, either with PHP or jQuery. Here’s one article I found to get you started: http://tutorialzine.com/2016/06/quick-tip-detecting-your-location-with-javascript/ Plus there is this Stackoverflow answer that might help: https://stackoverflow.com/questions/40636671/how-to-setup-the-functionality-to-get-user-location-in-browser “Geolocation” is a good search term to use. You’ll need to customize you registration form to enable this, but perhaps these links … Read more
Woocommerce Child Category Permalink Structure Change
Here’s my solution to this. In my situation, the “Related Products” section didn’t make sense (as the store was already organized based on categories), so I removed the standard related products section and re-added it with the same template, but by feeding the template the cross-sells instead of the related products. The section still says … Read more