Query whether WooCommerce is activated

Posted on Leave a comment

If you‚Äôre building a theme which supports but doesn‚Äôt require WooCommerce, you may want to wrap WooCommerce functionality (think cart links etc) inside a conditional query. That way, if WooCommerce isn‚Äôt activated, the functionality is simply ignored instead of producing fatal errors. /** * Check if WooCommerce is activated */ if ( ! function_exists( ‘is_woocommerce_activated’ […]

Add checkout validation styles to a third party or custom theme

Posted on Leave a comment

You need to add this CSS to your child theme‚Äôs¬†style.css¬†file or to your customizers‚Äô ‚ÄúAdditional CSS‚ÄĚ section. Please don‚Äôt add custom code directly to your parent theme‚Äôs¬†style.css file as this will be wiped entirely when you update the theme. .form-row.woocommerce-invalid .chzn-single, .form-row.woocommerce-invalid .chzn-drop, .form-row.woocommerce-invalid input.input-text, .form-row.woocommerce-invalid select { border:1px solid red; } .form-row.woocommerce-validated .chzn-single, .form-row.woocommerce-validated […]

Show product categories in WooFramework breadcrumbs

Posted on Leave a comment

Add this code to your child theme‚Äôs¬†functions.php¬†file or via a plugin that allows custom functions to be added, such as the¬†Code snippets¬†plugin. Avoid adding custom code directly to your parent theme‚Äôs¬†functions.php file, as this will be wiped entirely when you update the theme. /** * Show product categories in Woorramework breadcrumbs */ // Get breadcrumbs […]

Change the placeholder image

Posted on Leave a comment

The placeholder image can now be set at:¬†WooCommerce > Settings > Products¬†as of version 3.5x. More info at:¬†Configuring WooCommerce Settings. WooCommerce 3.4x or earlier Add code to your child theme‚Äôs¬†functions.php¬†file or via a plugin that allows custom functions to be added, such as the¬†Code snippets¬†plugin. Avoid adding custom code directly to your parent theme‚Äôs¬†functions.php file […]

Change number of upsells output

Posted on Leave a comment

Add code to your child theme‚Äôs¬†functions.php¬†file or via a plugin that allows custom functions to be added, such as the¬†Code snippets¬†plugin. Avoid adding custom code directly to your parent theme‚Äôs¬†functions.php¬†file as this will be wiped entirely when you update the theme. /** * Change number of upsells output */ add_filter( ‘woocommerce_upsell_display_args’, ‘wc_change_number_related_products’, 20 ); function […]

Change number of related products output

Posted on Leave a comment

Add code to your child theme‚Äôs¬†functions.php¬†file or via a plugin that allows custom functions to be added, such as the¬†Code snippets¬†plugin. Avoid adding custom code directly to your parent theme‚Äôs¬†functions.php¬†file as this will be wiped entirely when you update the theme. Please note that it does not work for all themes because of the way […]