djms Posted June 19, 2005 Share Posted June 19, 2005 I've installed the Must Select Attributes by OceanRanch found in Carine Bruyndoncx's contribution by the same name and am now getting the following error message when I try to add something to my cart whether I've selected from the attributes list or not. Fatal error: Call to a member function on a non-object in /home/abc/mycompanyname-www/catalog/includes/application_top.php on line 388 Line 388 is the third line in the following piece of code...$messageStack->reset(); /BoF CB Enforce attribute selection if (is_array($HTTP_POST_VARS['id']) ) { $messageStack->reset(); while (list($option, $value) = each($HTTP_POST_VARS['id'])) { // 36 is the value for "-select-" //if ($value == 36) { if (($value == 36) or ($value == 36) or ($value == 36) ) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] . '&mustselect=product_info')); break; } } } elseif (tep_has_product_attributes($HTTP_POST_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id'])); break; } //EoF CB Also I have multiple attributes so I have commented out the single if($value==36){ and used the multiple if (($value==36) statement as above. Does anyone know if I'm supposed to have 36 in each of the ($value== 36) areas on this line? It originally had ($value == 9) or ($value == 10) or ($value == 999). The instructions said to replace the 9's with the "--please select--" attibute value in our system (mine is 36). Should I replace the 10 and 999 as well? Any ideas to solve these issues? Please be very specific as I don't know php and am feeling my way through this setup like a blindfolded monkey in a house of knives. :'( Unending thanks for any help offered, Djms Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted June 19, 2005 Share Posted June 19, 2005 you can change $messageStack->reset(); with if (is_array($messageStack)) { $messageStack->reset(); } If you only have one must select value setup (36 in your case), you can just keep the previous line, and comment out the line with the or statements. HTH, Carine KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
djms Posted June 19, 2005 Author Share Posted June 19, 2005 That did it! It works like a charm now. A thousand thanks, Djms Link to comment Share on other sites More sharing options...
Guest Posted July 21, 2005 Share Posted July 21, 2005 Thank you bruyndoncx for this great contribution, this is exactly what I was looking for for my shop. :thumbsup: Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted July 24, 2005 Share Posted July 24, 2005 thank you guys :) it is nice to get a pat on the back once a while :D KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.