Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Must Select Problems


Poolio

Recommended Posts

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

Link to comment
Share on other sites

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

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

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

 

 

<?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,,,

Link to comment
Share on other sites

could you change the offending line in application_top to:

 

if (is_array($messageStack)) { $messageStack->reset(); }

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

could you change the offending line in application_top to:

 

if (is_array($messageStack)) { $messageStack->reset(); }

 

 

 

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...