Try the Demo

Magento Forum

   
Authentication problem
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

how can i manage my product only for logged in user
example

when some one logged in than only they see my products,
othewise they only see some of my products which are available for every one

can some one tell me????

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

if some one know please answer

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale
Guru
 
Avatar
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

this will be very tricky. First i would create a new product attribute f.e. called only_user, this should be a general attribute.
Than you have to customize all phtml files which lists the products. For example list.phtml of module catalog in the grid mode:

if($_product->getOnlyUser() && $this->helper('customer')->isLoggedIn() )

//Show the product

But theres a problem in grid layout of list.phtml. The whole sum of products is count

<?php $_collectionSize $_productCollection->count() ?>
If you use above code you have to customize some more code of this function.

Hope you understand my bad english.

Cheers

Stefan

 Signature 

mzentrale | eCommerce - eBusiness
Agentur für eCommerce Beratung, Entwicklung & Marketing.
Magento™ Silver Partner
----

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

thanks Stefan
now i m using ur code smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

its working fine smile
thanks stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
honeyharish
Member
 
Total Posts:  60
Joined:  2008-07-10
 

but $_product->getOnlyUser() is not a funtion how can i define it????

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale
Guru
 
Avatar
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

you have to create a attribute named only_user under ->catalog->attributs->manage attributes. Then it is available
in the view.

cheeers

stefan

 Signature 

mzentrale | eCommerce - eBusiness
Agentur für eCommerce Beratung, Entwicklung & Marketing.
Magento™ Silver Partner
----

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top