Guest Posted May 18, 2005 Share Posted May 18, 2005 I´m a total noob concerning mySQL and PHP, well lots of other things too. Installed and got things running and noticed that Save is showing Sale_price and not Price - Sale_Price. I really don´t understand queries, but this line in saleItems.inc.php seems OK to me. $saleItems = $db->select("SELECT name, productId, price, sale_price, price - sale_price as saving FROM ".$config['dbprefix']."CubeCart_inventory ORDER BY saving ASC",$config['noSaleBoxItems']); somehow saving is 6.99 even though it should be 10 - 6.99 = 3.01 It gets worse. Added a new product same problem, but what´s worse is that all listed Sale Items get Save XXXX from the product showing in the main window. Sale Items Test Product Save $995.00 Royal 500 Save $995.00 and if I switch to Test Product Sale Items Test Product Save $6.99 Royal 500 Save $6.99 It should be Sale Items Test Product Save $3.01 Royal 500 Save $200.00 Quote Link to comment Share on other sites More sharing options...
Guest Posted May 20, 2005 Share Posted May 20, 2005 I changed the where clause in the select statement and the saving amount section below <?php /* +-------------------------------------------------------------------------- | CubeCart v3.0.0 Beta | ======================================== | by Alistair Brookbanks | CubeCart is a Trade Mark of Devellion Limited | © 2005 Devellion Limited | Devellion Limited, | Westfield Lodge, | Westland Green, | Little Hadham, | Nr Ware, HERTS. | SG11 2AL | UNITED KINGDOM | http://www.devellion.com | UK Private Limited Company No. 5323904 | ======================================== | Web: http://www.cubecart.com | Date: Friday, 15 April 2005 | Email: [email protected] | License Type: CubeCart is NOT Open Source Software and Limitations Apply | Licence Info: http://www.cubecart.com/site/faq/license.php +-------------------------------------------------------------------------- | saleItems.inc.php | ======================================== | Sales Items Box +-------------------------------------------------------------------------- */ // query database *** add where clause $saleItems = $db->select("SELECT name, productId, price, sale_price, price - sale_price as saving FROM ".$config['dbprefix']."CubeCart_inventory where sale_price > 0 ORDER BY saving ASC",$config['noSaleBoxItems']); if($saleItems == TRUE && $config['saleMode']>0){ $box_content=new XTemplate ("skins/".$config['skinDir']."/styleTemplates/boxes/saleItems.tpl"); $box_content->assign("LANG_SALE_ITEMS_TITLE",$lang['front']['boxes']['sale_items']); for($i=0;$i<count($saleItems);$i++){ if(($val = prodAltLang($saleItems[$i]['productId'])) == TRUE){ $saleItems[$i]['name'] = $val['name']; } $box_content->assign("DATA",$saleItems[$i]); //$box_content->assign("SAVING",priceFormat($salePrice)); // *** changed here if ($saleItems[$i]['sale_price'] > 0) { $box_content->assign("SAVING",priceFormat($saleItems[$i]['saving'])); } else { $box_content->assign("SAVING",priceFormat(0)); } $box_content->assign("LANG_SAVE",$lang['front']['boxes']['save']); $box_content->parse("sale_items.li"); } // end loop $box_content->parse("sale_items"); $box_content = $box_content->text("sale_items"); } else { $box_content = ""; } ?> Quote Link to comment Share on other sites More sharing options...
Guest Posted May 20, 2005 Share Posted May 20, 2005 Thx a lot :( Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.