How to hide price for 1 product in the category

  • Posts: 70
  • Thank you received: 4
11 years 4 months ago #82881

Hi,

My client has been managing their site themselves for a while and they came up with a question.

They have a product with about 7 variants. They would like to display no price when the product is listed with other products that have price listed. How could that be achieved??

Thanks in advance!

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #82906

Hi,

You have to edit the view "product / listing_img_title" (or another one depending on which display you are using) and add a if condition on the product ID, and if the product_id == youId, so hide the price part.

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

  • Posts: 70
  • Thank you received: 4
11 years 4 months ago #85724

HI Xavier,

This sounds like a coding job. And i am not very good at that. Do you have any examples of how that would look? I am sure i can figure out different product ID myself :) But not sure how entire line should look.

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
11 years 4 months ago #85759

Hi,

It's quite simple actually.

Change the line:
if($this->params->get('show_price')){

to:
if($this->params->get('show_price') && $this->row->product_id != XX){

where XX is the id of the product for which you want to hide the price on the listing.

The following user(s) said Thank You: gidgie

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

Time to create page: 0.066 seconds
Powered by Kunena Forum