Just2Bad Posted November 27, 2003 Share Posted November 27, 2003 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 More sharing options...
jpf Posted November 28, 2003 Share Posted November 28, 2003 Look at Linda's "free call for price" mod http://www.oscommerce.com/community/contributions,134 Make one that basically said - "Click options for price" Link to comment Share on other sites More sharing options...
Just2Bad Posted November 28, 2003 Author Share Posted November 28, 2003 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 More sharing options...
Just2Bad Posted November 28, 2003 Author Share Posted November 28, 2003 is it possible to just add somewhere in the code something like that if product_prices = 0 then new_var = "" else new_var = product_price . . . Display product_quantity, product_name, new_var Link to comment Share on other sites More sharing options...
Just2Bad Posted November 28, 2003 Author Share Posted November 28, 2003 Or if someone can help me to find out what's wrong when I install the free call for price mod Link to comment Share on other sites More sharing options...
Just2Bad Posted December 10, 2003 Author Share Posted December 10, 2003 BUMP !!!! Link to comment Share on other sites More sharing options...
Guest Posted December 10, 2003 Share Posted December 10, 2003 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.