Tag Info

New answers tagged

0

iolocin, I took your edited answer and as Pieter Goosen mentioned, made sure it was an array in an array and as per the codex. Final working code: function wpse188669_pre_get_posts( $query ) { if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) { $tax_query = array( ...


0

Try using the core WooCommerce filter woocommerce_get_sku: function wpse_188691_woocommerce_get_sku( $sku, $product ) { if ( ! is_admin() ) { $parts = explode( '.', $sku ); // Only first two parts $parts = array_slice( $parts, 0, 2 ); // OR all parts except last (remove above) // array_pop( $parts ); ...


3

The problem with your approach is that woocommerces product category is a custom taxonomy called product_cat. But with cat you are addressing the built-in category. Taxonomies can be addressed with a tax query, simplified example below: function wpse188669_pre_get_posts( $query ) { if ( ! is_admin() && ...


0

If you put print_r($terms); below $terms = $the_order->get_items();. You see an overview of all the data you can use. Then select the information you want to show and use it in the foreach. Hope this will help you! Your code fixed my problem, thanks for that! Have a good one, Mickey


1

This is mostly a PHP question and it is related to WooCommerce. Either of which conditions makes it dangerously close to off-topic. However, I am going to give the benefit of the doubt and assume that the problem is due to a misunderstanding of the WordPress function wp_get_post_terms(). ;) wp_get_post_terms() returns all of the terms as an array of term ...


0

You can use: http://wordpress.org/plugins/easy-captcha/ This then allows you to select where you want the captcha form to appear. Its compatible with Woocommerce.


0

Open up that file (mini-cart.php) and edit line 40 where it contains <?php echo $_product->get_image(); ?> Change that to <?php echo $_product->get_image( array( 150, 200 ) ); ?> 150 is the width and 200 is the height. Change it to whatever size you want. After you have done that make sure to clear your cache and restart your browser ...


0

Simple CSS solution for this, use it as Custom CSS: // Remove product description only on category pages body.archive .product-item-desc { display: none; } // Remove page introduction subtitle only on category pages body.archive .page-introduce-subtitle { display: none; } In the above code, we are targeting only the category pages(body.archive) ...


0

Couple of things - avoid query_posts, use a new query object or the get_posts function (read all about it). And the_ID() echo's the ID, use get_the_ID() instead. However, you can save some memory and processing by simply iterating over an array of posts (i.e. not using a proper "loop" and setting up the global post), and just grab the ID directly: ...


1

This is treading very close to being off-topic as it asks specifically about a particular plugin, but the answer is quite generic: You can remove the capabilities you don't need. function remove_cap_wpse_186316(){ remove_cap( 'yourwoorole', 'yourwoocap' ); remove_cap( 'yourwoorole', 'yourwoocap1' ); } add_action( 'admin_init', ...


0

There's a few options you can choose from whenever changing image sizes. Switching out the actual default WooCommerce images is more difficult than a normal WordPress install as they are ingrained with the plugin. Modify Related Product Image Sizes: I've tested this and it seems to work only on related products ( though I'm sure it could be expanded to ...


0

I think it's a CSS problem because WooCommerce (annoyingly) uses width: 100% when it (in my opinion) should be max-width: 100%. Try to overwrite the width using width: auto, that should help.


0

You can overwrite the CSS of WooCommerce through this snippet, Remi Corson: <?php add_filter( 'wp_head' , 'related_products_style' ); function related_products_style() { if( is_product() ) : ?> <style> .woocommerce .related ul.products li.product img, .woocommerce .related ul li.product img, .woocommerce .upsells.products ...


2

In modern WordPress toolbar is considered mandatory part of admin. That is WordPress is explicitly opinionated about not letting you to disable it. While you still can kind of hack it out, it's unnecessary struggle. If you need a blank page there is no reason to struggle with blanking admin interface for it. You could simply use wp-admin/admin-post.php to ...


0

If you will disable the admin bar for all users on this page, use this wp_deregister_script( 'admin-bar' ); wp_deregister_style( 'admin-bar' ); remove_action( 'init', '_wp_admin_bar_init' ); remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );  in a function, ...



Top 50 recent answers are included