Query whether WooCommerce is activated

Posted on

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

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

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

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

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

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 […]