Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep_draw_mselect_menu Problem


Guest

Recommended Posts

Posted

I have a file that is looking for an undefined function, when I load the page I get the following error:-

 

Fatal error: Call to undefined function: tep_draw_mselect_menu() in /mysite/myadmin/suppliers.php on line 266

 

The line in question reads:-

 

$contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_CATEGORIES . '<br>' . tep_draw_mselect_menu('categories[]', $categories, $categories_selected));

 

 

Can anyone tell me whats causing this and where I might add this function define..

 

Any help would be much appreciated.. thanks

Posted

I'm still stuck with this one.. was burning the candle till late last night without success.. anyone shed some light here...

 

Once I've got it sorted I can release the Supplier Area Contribution to the community..

 

It's a contribution that allows you to create some suppliers and set a markup percentage for each one and select which categories they can add their products to with a login name and password.

 

The suppliers can then login to their own pages where they can add products to their categories entering the cost price that they sell the product to you for. The front of the shop will show the list price determined by the markup on cost you had set for that supplier.

 

The suppliers can only see and modify their own products and not any other suppliers..

 

If this seems like something you might be interested in then please help with this problem that I'm having..

 

Cheers..

 

If you need me to send over what I've currently got so that you can set it up on a new install to see the problem then just let me know..

Posted
I have a file that is looking for an undefined function, when I load the page I get the following error:-

 

Fatal error: Call to undefined function: tep_draw_mselect_menu() in /mysite/myadmin/suppliers.php on line 266

 

The line in question reads:-

 

$contents[] = array('text' => '<br>' . TEXT_SUPPLIERS_CATEGORIES . '<br>' . tep_draw_mselect_menu('categories[]', $categories, $categories_selected));

Can anyone tell me whats causing this and where I might add this function define..

 

Any help would be much appreciated.. thanks

 

defined in admin/includes/functions/html_output.php:

 

// Output a form multiple select menu

function tep_draw_mselect_menu($name, $values, $selected_vals, $params = '', $required = false) {

$field = '<select name="' . $name . '"';

if ($params) $field .= ' ' . $params;

$field .= ' multiple>';

$field .= '<option value="">' . TEXT_NONE . '</option>';

for ($i=0; $i<sizeof($values); $i++) {

if ($values[$i]['id'])

{

$field .= '<option value="' . $values[$i]['id'] . '"';

if ( ((strlen($values[$i]['id']) > 0) && ($GLOBALS[$name] == $values[$i]['id'])) ) {

$field .= ' SELECTED';

}

else

{

for ($j=0; $j<sizeof($selected_vals); $j++) {

if ($selected_vals[$j]['id'] == $values[$i]['id'])

{

$field .= ' SELECTED';

}

}

}

}

$field .= '>' . $values[$i]['text'] . '</option>';

}

$field .= '</select>';

 

if ($required) $field .= TEXT_FIELD_REQUIRED;

 

return $field;

}

Treasurer MFC

Posted
I'm still stuck with this one.. was burning the candle till late last night without success.. anyone shed some light here...

 

Once I've got it sorted I can release the Supplier Area Contribution to the community..

 

It's a contribution that allows you to create some suppliers and set a markup percentage for each one and select which categories they can add their products to with a login name and password.

 

The suppliers can then login to their own pages where they can add products to their categories entering the cost price that they sell the product to you for. The front of the shop will show the list price determined by the markup on cost you had set for that supplier.

 

The suppliers can only see and modify their own products and not any other suppliers..

 

If this seems like something you might be interested in then please help with this problem that I'm having..

 

Cheers..

 

If you need me to send over what I've currently got so that you can set it up on a new install to see the problem then just let me know..

 

That is not a function from the default osC html_output.php so you must have gotten it from some contrib you tried to install. Somewhere with the install instructions there must be a reference to where to add this function. I see Amanda nows from which and where.

Posted

Cheers Boxtel

 

That worked a treat adding the following just before the last ?> in admin/includes/functions/html_output.php

 

// Output a form multiple select menu

function tep_draw_mselect_menu($name, $values, $selected_vals, $params = '', $required = false) {

$field = '<select name="' . $name . '"';

if ($params) $field .= ' ' . $params;

$field .= ' multiple>';

for ($i=0; $i<sizeof($values); $i++) {

if ($values[$i]['id'])

{

$field .= '<option value="' . $values[$i]['id'] . '"';

if ( ((strlen($values[$i]['id']) > 0) && ($GLOBALS[$name] == $values[$i]['id'])) ) {

$field .= ' SELECTED';

}

else

{

for ($j=0; $j<sizeof($selected_vals); $j++) {

if ($selected_vals[$j]['id'] == $values[$i]['id'])

{

$field .= ' SELECTED';

}

}

}

}

$field .= '>' . $values[$i]['text'] . '</option>';

}

$field .= '</select>';

 

if ($required) $field .= TEXT_FIELD_REQUIRED;

 

return $field;

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...