Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Prices at 0.00$


Just2Bad

Recommended Posts

Hi, on my site I have some products that have a price of 0.00$ and the prices is define with attributes. My problem is I don't want to display a price of 0.00$ for those products when listing products. Do you know what can I change in the code to teel the script to display no prices or a word if the prices of the products is 0.00 ???

 

Thanks...

Link to comment
Share on other sites

Great, but now I got thiss error message for about 50% of my category

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select p.products_model, p.products_image, pd.products_name, p

 

select count(select p.products_model, p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = \'1\' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = \'4\' and p2c.categories_id = \'70\' order by pd.products_name) as total

Link to comment
Share on other sites

  • 2 weeks later...

Not sure what release you are using and if it is different than this, but it should get you started:

 

On each page where a price appears, you need to mod the code as mentioned above. Not sure how linda's contribution works, but this works on the basic premise that if the price is $0.00, it won't display whether or not there are addtl. attributes. You should be able to take it from here....

 

Here is the except from my product_info.php (around line 70:)

 

if ($products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) =='$0.00') {

$products_price = '';

} else {

$products_price = ($products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])));

}

 

Remember you have to do similar mods to product listing, etc. It seems you had the concept, next time play around a little more.....PHP is pretty darn easy.

 

And I wish I knew about Linda's contribution BEFORE I did this (oh well)

 

 

-J

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...