Is it possible to redirect customers to a page I made myself instead of the ‘standard’ vendor shop when clicking on ‘visit’ on the store list?
– Possible, hope this url will be different for each vendor?
Furthermore, when customers click on a product on the vendor store, they get redirected to a single product page – is there a possibility to shut this off?
– If we will change this then it will be reflect all over the site. Users will not able to access single product page anymore.
– Possible, hope this url will be different for each vendor?
Yes, each vendor will have their own page. so for instance http://www.domain.com/restaurant1
– If we will change this then it will be reflect all over the site. Users will not able to access single product page anymore.
That is no problem! I have a restaurant page, and it’s not necessary.
Can you help me figure this out?
Yes, each vendor will have their own page. so for instance http://www.domain.com/restaurant1
– OK, how we will generate this dynamically?
Is “restaurant1” vendor user’s username?
That is no problem! I have a restaurant page, and it’s not necessary.
– Add this snippet to your site –
add_action( 'woocommerce_before_shop_loop_item', function() {
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
}, 9 );
add_action( 'woocommerce_after_shop_loop_item', function() {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
}, 4 );
Add custom code(s) to your child theme’s functions.php
In case you do not have child theme then add those using this plugin – https://wordpress.org/plugins/code-snippets/
Thanks it worked!
Restaurant1 would then be the restaurants’ name. I made this page for instance for one of the restaurants on my website https://vegamarketings.com/toastable/. However, when I click on that restaurant on the restaurant list, I get redirected to a page that is pre-made by WCFM. However, I’d rather be directed to that other page.
Kindly try this snippet –
add_filter( 'wcfmmp_get_store_url', function( $store_url, $user_id ) {
$userdata = get_userdata( $user_id );
$user_nicename = ( !false == $userdata ) ? $userdata->user_nicename : '';
if( $user_nicename ) {
$store_url = trailingslashit( home_url( $user_nicename ) );
}
return $store_url;
}, 50, 2 );
You are amazing. Thank you so much.
My pleasure, you are always welcome 🙂
It will be really pleasure for me if you leave a review for me 🙂