Some themes include the customer avatar in the My Account page. I like it a lot, so i wrote a tutorial to add it also in Storefront, the latest WooThemes free theme – download it on WordPress.org!
Read moreSometimes you want to show a field on the checkout just for some users.
In this tutorial I’ll show you how to do this. In the example I’ll add the field for the VAT number only for the user role Wholesalers.
As you know, WooCommerce allows you to sell only in specific countries, like only in Italy or in Unites States.
What if you want to sell only in a specific province, or only in California for example?
Are you using the plugin WooCommerce Product Vendors?
Well, I think you will love this tutorial then!
If you are one of those users who want to setup a custom vendor shop page, add this code in your functions.php file located in wp-content/themes/your-theme-name/:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Load a custom template for vendor taxonomy | |
*/ | |
function load_custom_vendor_template( $located, $template_name ) { | |
if( is_tax( WC_PRODUCT_VENDORS_TAXONOMY ) && 'archive-product.php' == $template_name ) { | |
return get_stylesheet_directory() . '/woocommerce/taxonomy-shop_vendor.php'; | |
} | |
return $located; | |
} | |
add_filter( 'wc_get_template', 'load_custom_vendor_template', 10, 2 ); |
You Should Check
Latest Posts
- Ban Russia From the Checkout in WooCommerce March 4, 2022
- How to Confirm the Email Address on Checkout February 24, 2021
- How to Change the Low Stock Email Subject February 3, 2021
Latest Comments