Poolio Posted May 5, 2005 Share Posted May 5, 2005 on 5-4-05 I installed the must select contribution on a new creloaded6 v6.1a oscommerce store. There were a few differences getting in the installation but not many. The contribution works great for the most part,,, Thanks,,, but I do have two problems. The first problem is that "$messageStack->reset();" which was added to "application_top.php" generates the following error: "Fatal error: Call to a member function on a non-object in /home/thewrinkledegg/www/thewrinkledegg.com/includes/application_top.php on line 406" If I comment out line 406 which contains "$messageStack->reset();" then the contribution works great except for the fact that the message: "You must select a value from the options dropdown" continues to display after you correctly select an option and add the item to the cart. When you hit continue shopping which takes you back to the last item viewed the message "You must select a value from the options dropdown" is visible. The version of the must select contribution that I installed contains the revision that fixed this problem for many as mentioned in another forum discussion. Any help on this would be greatly appreciated. Jonathan Quote Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted May 6, 2005 Share Posted May 6, 2005 can you post the code for your messageStack class ? I'm not familiar with loaded intracies ... I would expect a similar function to be available Quote 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...
Poolio Posted May 6, 2005 Author Share Posted May 6, 2005 can you post the code for your messageStack class ?I'm not familiar with loaded intracies ... I would expect a similar function to be available <{POST_SNAPBACK}> <?php /* $Id: message_stack.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License Example usage: $messageStack = new messageStack(); $messageStack->add('general', 'Error: Error 1', 'error'); $messageStack->add('general', 'Error: Error 2', 'warning'); if ($messageStack->size('general') > 0) echo $messageStack->output('general'); */ //Lango Added for template mod: BOF class messageStack extends tableBoxMessagestack { //Lango Added for template mod: EOF // class constructor function messageStack() { global $messageToStack; $this->messages = array(); if (tep_session_is_registered('messageToStack')) { for ($i=0, $n=sizeof($messageToStack); $i<$n; $i++) { $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']); } tep_session_unregister('messageToStack'); } } // class methods function add($class, $message, $type = 'error') { if ($type == 'error') { $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . ' ' . $message); } elseif ($type == 'warning') { $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message); } elseif ($type == 'success') { $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . $message); } else { $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message); } } function add_session($class, $message, $type = 'error') { global $messageToStack; if (!tep_session_is_registered('messageToStack')) { tep_session_register('messageToStack'); $messageToStack = array(); } $messageToStack[] = array('class' => $class, 'text' => $message, 'type' => $type); } function reset() { $this->messages = array(); } function output($class) { $this->table_data_parameters = 'class="messageBox"'; $output = array(); for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) { if ($this->messages[$i]['class'] == $class) { $output[] = $this->messages[$i]; } } //Lango Added for template mod: BOF return $this->tableBoxMessagestack($output); //Lango Added for template mod: EOF } function size($class) { $count = 0; for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) { if ($this->messages[$i]['class'] == $class) { $count++; } } return $count; } } ?> There you go,,, Quote Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted May 6, 2005 Share Posted May 6, 2005 could you change the offending line in application_top to: if (is_array($messageStack)) { $messageStack->reset(); } Quote 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...
Poolio Posted May 6, 2005 Author Share Posted May 6, 2005 could you change the offending line in application_top to: if (is_array($messageStack)) { $messageStack->reset(); } <{POST_SNAPBACK}> Great,, that makes sense, and did work well. Unfortunately I still have the " You must select a value from the options dropdown" message when I navigate back from the cart to the last product viewed. Thanks much for your contribution, and your help.. Jonathan 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.