0
votes

I have a magento multi-store website. I have three stores. I want to remove/hide the Add to cart button from one store. But the other stores should display it.

Can I do this from admin panel? What is the easyest solution?

2
If you use different theme and handle it through .phtml that will be easiest.Oscprofessionals
it's a solution, but in the future I don't want to be obligated to change two-three themes when I make a change to the website..Pascut
you only have some specific part in your store associated theme and let other things come from a fall back theme.This will minmiza you multiple site template workOscprofessionals

2 Answers

1
votes

In your template you could check for the store id, for instance, if you don't want it to show in store id 3...

app/design/frontend/[package]/[theme]/template/catalog/product/view/addtocart.phtml

...
<?php if ($_product->isSaleable() && Mage::app()->getStore() != "3"): ?>
    <div class="add-to-cart">[...]</div>
<?php endif ?>
...

And that should remove the add to cart for the product pages.


You could leave the button there but disable it's ability to be added to cart with a module that and overrides Mage_Checkout_CartController::addAction(). You could redirect the user and add a message saying that it's disabled, etc.

0
votes

The best solution was to use a module. Now I can set from admin panel for each store (or website/global) to:

  1. Show "add to cart" button and the price
  2. Hide both
  3. Show only "add to cart" button
  4. Show only the price

And I can also set this settings to work for certain user groups. There's no need for extra themes or some "hard code" :) We need to work clean..

This is the Module (and it's free):

http://www.magentocommerce.com/magento-connect/hide-cart-price-5914.html

TAKE CARE: This module will probably not work out of the box. When i installed the module it gave an error page with Class 'Zend_log' not found in Rule.php, this error page came up when i visited 'system -> configuration' and 'customer->IG Hide Cart and Price Rules' and in the frontend at every product. well this is because of a bad name for a function in the Rule.php file. my not creative solution was(because of the late time): go to: /app/code/community/IG/HideCartPrice/Model/Rule.php Find line 129: public function load($id) Change it to: public function load1($id) Find line 131: parent::load($id); Change it to: parent::load1($id);

Hope I helped!