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 […]
Category: WP Tutorials
Change number of upsells output
Posted onAdd 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 onAdd 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 […]
Hide loop read more buttons for out of stock items
Posted onYou need to 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. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. /** * Hide loop read more buttons for […]
Show cart contents / total
Posted onAdd 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. To display the cart contents and total in your template, use something like: […]
Display My Account link in a template file
Posted onDisplays a link to the user account section. If the user is not logged in the link will display ‘Login / Register’ and take the use to the login / signup page. If the user is logged in the link will display ‘My account’ and take them directly to their account. if ( is_user_logged_in() ) […]