0

If we visit magento site, Products "prices" or "add to cart button"[optional either one] should not visible on entire site[on product list page, product view page, featured products , everywhere.] after entering username and password only customers can see the products prices. [as like in admin panel login, but USername: & password box: should be on home page] ,

Please help me to find solution.

3 Answers 3

0

Then, You have to place the add to cart code in the

if($sessionCustomer->isLoggedIn())
{
  <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button    btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
}

in list.phtml

Then in View.phtml

if($sessionCustomer->isLoggedIn())
{
  <?php echo $this->getChildHtml('addtocart') ?>
}

Try this code.

2

You can use this code. Check whether the customer is logged in or not

List page

$sessionCustomer = Mage::getSingleton("customer/session");
if($sessionCustomer->isLoggedIn()) 
{
echo $this->getPriceHtml($_product, true);
}

View page

$sessionCustomer = Mage::getSingleton("customer/session");

if($sessionCustomer->isLoggedIn()) 
{
    echo $this->getChildHtml('product_type_data');
}
15
  • Hi, Thanks @Manikandan Can you please explain answer in details with where i have to place the code in list.phtml and view.phtml Aug 8, 2014 at 6:19
  • In list.phtml and view.phtml you can find a class name "product-shop" in there you can apply this codes
    – Manikandan
    Aug 8, 2014 at 6:22
  • Hi, I did changes as you told in following links. Please inform if there is any changes i have to do. list.phtml pastebin.com/puh5PdQM view.phtml pastebin.com/1Bk6bwta Aug 8, 2014 at 6:48
  • no more codes to update. It's enough
    – Manikandan
    Aug 8, 2014 at 8:40
  • you have wrongly placed the codes. You have the replace the code in list.phtml line 64 & view.phtml line 65
    – Manikandan
    Aug 8, 2014 at 8:49
2

I would recommend you to use one of the B2B extension available in the market. Below i have pasted the link of one of the free extension Sitewards B2B

It will cover your requirement well and you won't need to play dirty around code.

NOTE : This is a free extension and i am not in any way related with the ext developer. I have used it in one of the website and suggesting it from my experience

0

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.