Hot answers tagged

3

OK so I had a variation of this same problem myself and I'll walk you through it. All works fine, except for one thing: WooCommerce custom product attributes are not displayed instantly in dropdown/select filters on the website. However, 'manually' pressing Update on the Wordpress-page does the job. When displaying attributes woocommerce does this ...


2

The get_adjacent_post() function has multiple arguments. The fourth and last one is the taxonomy, which per default is 'category': $post_prev = get_adjacent_post( true, '', true, 'product_cat' ); $post_next = get_adjacent_post( true, '', false, 'product_cat' );


2

If the code you have provided is the only code you are using to achieve what you want then thats incomplete code. Below is the tested version of code which works well. I hope this helps: /* Add the field to the checkout */ add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); function my_custom_checkout_field( $checkout ) { echo ...


1

Customizer Controls can be displayed based on context. With active_callback API introduced in WordPres 4.0, you can control where to show your specific options. Add your customizer options like this with the optional active_callback argument. $wp_customize->add_control( 'wc_cart_page_option', array( 'label' => esc_html__( 'Cart Page Options' ...


1

You need first to buy WooCommerce Quick View plugin, because woocommerce lightbox plugin doesn't work without it. Please read this: Woocommerce single product show in modal…? And if you go to the wordpress page of woocommerce lightbox plugin, you will see that is a complementary plugin.


1

You may need to include a tax_query for the Woocommerce taxonomy (called 'product_cat'): $tax_query = array( array( 'taxonomy' => 'product_cat' ), ); $query->set( 'tax_query', $tax_query ); } return $query; } However, you'll have to ensure that you can return posts AND pages AND product categories and also ...


1

It's a bit hard to tell without knowing what shop theme you are using but I'll try anyways…  The code <?php wc_get_template_part( 'content', 'product' ); ?> is basically calling the template file content-product.php. I would however not recommend you alter the default file. On a standard woocommerce install you will find that default template file ...


1

The best practice for editing a Woocommerce theme is similar to Wordpress as you should use Hooks and Filters when possible. https://docs.woothemes.com/document/introduction-to-hooks-actions-and-filters/ But if you do need to edit a template Woocommerce outlines this on their website as well: https://docs.woothemes.com/document/template-structure/ You just ...



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