4

I'm attempting to hide the "Add To Cart" button for specific stores currently and am having some issues with my lack of experience. It works in each individual store but not when using the search function because this returns results for a "default" store being used since our search function can't return results from multiple stores.

My question is when are multistore setups helpful? My company is using separate stores for each category of products on the same site and within each store there's sub-categories for the products.

It would be much easier for me to hide products if they were all in the same store in different categories. I'm wondering if I'm right about setting up the store this way and if not what the best solution to my problem is.

Once again the problem I'm trying to fix is hiding the "Add To cart" button when using the search feature.

Thanks for any help!

1
  • you can setup every store on a separate domain with a different design theme, different products and customer groups to target audience of each store. Or you can use the option to share customers, products, pricing and other data among different stores. Commented Oct 2, 2018 at 5:39

2 Answers 2

1

Multistore is for multiple stores where that makes sense for UX and/or SEO.

eg 1: Your company has 4 different brands that sell very different things - you'd have 4 different stores on different domain names.

eg 2: Your company has 1 brand but sells to multiple countries - you may have a different site per country.

However neither of these examples are definitive, so maybe you wouldn't do it like that.

BUT, having different stores for different categories for 1 company makes no sense to me at all. Not even if they're on sub-domains as there's no SEO benefit to that, you have multiple configurations to take care of and you're just making life difficult for yourselves for no reason.

I would be inclined to have just 1 store, with all your current sub-stores as top-level categories. That makes for 1 set of configurations to look after.

When you get the inevitable backlash of "but we did it like that because we have lots of categories" ... I have +200k products across 200+ categories on 1 store and I know of much much bigger Magento stores.

Hiding the cart button on a single store per category can be done with a simple PHP statement in the correct phtml template.

eg (none of this code will work)

$allowCats = array(1,3,6,8);

if(in_array(category_id,$allowCats){
//Show that damn button
}

You say you have a "lack of experience" but not where you lack experience. If you have experience in PHP, you'll eventually get your head around Magento codebase, otherwise, probably not. If you lack experience in managing Magento... RTFM ;)

https://docs.magento.com/m2/pdf/ce/Magento_Community_Edition_2.0_User_Guide.pdf

Good luck

0

Please install below module which is provide like this features. Store owner to hide the product price and add to cart button from guests or certain customer groups.

https://github.com/karliuka/m2.ProductAvailable

after install put below command via ssh.

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy

I hope its very helpful to you..

I already reply answer here - Hide store prices if not logged in - Magento 2.3.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.