how to not show a product after login.

  • Posts: 2
  • Thank you received: 0
10 years 5 months ago #194917

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.4
-- Error-message(debug-mod must be tuned on) -- : i am trying to get a product to not display once a customer is logged in.
is this possible.

the reason for this is that i have a product which cannot display any details until the customer has logged in. this is so as to comply with new medical rules.

so i've created a copy of the product to list with no price and no information other than the customer has to be logged in and registered in order to view any information as per the new law.
the original copy of the product that includes all information has access level of registered. this way public cannot view.

however, once logged in i can now see two equal products. 1. with price and details 2. no price and no details. how can i make the 2nd once not show when a customer is logged in.

any solutions would be very appreciated?
stella.

Last edit: 10 years 5 months ago by tinkerbel.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #194935

Hi,

Two ways, the first one could be to edit the view "product / listing_img_title" and add a PHP if condition based on the product id and on the user log status.
Something like:

if($this->row->product_id != 'X' || hikashop_loadUser() == null){
  // display the content
}

The following user(s) said Thank You: tinkerbel

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum