Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hide price if $0 in product listing


Micke

Recommended Posts

Even though I have very poor knowledge in PHP I have succeded in installing many contributions.

There is however one thing that I have never gotten quite right.

It's the part in product_listing.php in the "Hide price if $0"contribution.

 

I want to show all prices in the product listing exept from those at $0.

(Installing the contribution right "out of the box" hides all prices in the product listing.

Removing it shows all prices with $0 too...)

 

Now I'm trying a different approach, maybe the if-else (for specials) in product listing could be used to select the $0's and show the TEXT_CALL_FOR_PRICE instead...

Since I'm a cut-and paste kind of guy I can't make it work.

I still hides all prices...

Anybody knows what to do?

 

In catalog/includes/modules/product_listing.php

	 
	  case 'PRODUCT_LIST_PRICE':
		$lc_align = 'right';

		if (tep_not_null($listing[$x]['specials_new_products_price'])) {
		  $lc_text = '?<s>' .  $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>??<span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span>?';

	 //BOF Here's what I'm trying to do
		 } elseif ($listing['products_price'] == 0) {
		 $lc_text = '?' . ( TEXT_CALL_FOR_PRICE ) . '?';
	 //EOF Here's what I'm trying to do

		 } else {
		 $lc_text = '?' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '?';


		}
		break;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...