Tag Info

Hot answers tagged

4

You could check to see if the 'WooCommerce' class exists, then run the code that requires WooCommerce. <?php if ( class_exists( 'WooCommerce' ) ) { // code that requires WooCommerce } else { // you don't appear to have WooCommerce activated } ?>


2

Use get_current_blog_id() to check the current site. To run on site 2 only, use this: function new_meta_values($order_id) { if ( 2 !== get_current_blog_id() ) return; /* the rest of the function code */ }


2

You should be able to do this with the same filter that is talked about here. The full-size images are being kept by WordPress. It's not really a WooCommerce thing. As well as the settings for images in WooCommerce you will also need to set minimum image size in WordPress's Settings>Media... Then this script (see the link above for complete discussion) ...


1

Don't do it. You will need the original images to regenerate the smaller version when you will want to change the theme, and disk space is so cheap there is no real need to conserve it. A better alternative is to limit image upload size and force the user to photoshop the image before uploading, something that most likely will also improve the result of ...


1

i currently work on a woocommerce v2.1.12 shop and it seems they chaged that behavior. my ajax url to add items to the cart has to look like this: ?add-to-cart=[PRODUCT-ID]&variation_id=[VARIATION-ID]&attribute_[ATTRIBUTE-NAME]=[ATTRIBUTE-SLUG]&attribute_[ATTRIBUTE-NAME]=[ATTRIBUTE-SLUG] example: ...


1

The problem is that your code, especially the global $post; and then $post->ID part is getting the $post_id of the page you are on from the $post global variable, not of the product(s) in your cart, which would be what you are looking for. Aside from that, the $args parameter of wp_get_post_terms has no argument taxonomy, besides you already ...



Only top voted, non community-wiki answers of a minimum length are eligible