liamloveslearning Posted January 9, 2010 Share Posted January 9, 2010 Hi everyone, Im trying to show a button if theres a price defined, and if the pirce is 0 not show a button, Ive written this so far but it keeps breaking my script and I cant understand why, can anybody spot any errors im overlooking? case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; if ($list['PRODUCT_LIST_PRICE']== '0'){ $lc_text = ' '; } else { $lc_text = osc_link_object(osc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $osC_Product->getKeyword() . '&' . osc_get_all_get_params(array('action')) . '&action=cart_add'), osc_draw_image_button('button_buy_now.gif', $osC_Language->get('button_buy_now'))) . ' '; break; } Link to comment https://forums.phpfreaks.com/topic/187828-if-statement-breaking-everything/ Share on other sites More sharing options...
JAY6390 Posted January 9, 2010 Share Posted January 9, 2010 put the break; AFTER the final } Link to comment https://forums.phpfreaks.com/topic/187828-if-statement-breaking-everything/#findComment-991710 Share on other sites More sharing options...
liamloveslearning Posted January 9, 2010 Author Share Posted January 9, 2010 sorted i wasnt closing my curly bracket before 'break' Link to comment https://forums.phpfreaks.com/topic/187828-if-statement-breaking-everything/#findComment-991711 Share on other sites More sharing options...
liamloveslearning Posted January 9, 2010 Author Share Posted January 9, 2010 Thanks JAY6390 Link to comment https://forums.phpfreaks.com/topic/187828-if-statement-breaking-everything/#findComment-991712 Share on other sites More sharing options...
JAY6390 Posted January 9, 2010 Share Posted January 9, 2010 No problem Link to comment https://forums.phpfreaks.com/topic/187828-if-statement-breaking-everything/#findComment-991713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.