Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multioption Array storing problems


COsborne

Recommended Posts

I recently installed a shipping module that uses the multioption function. The module is saving the configuration values for the checkboxes as the text "Array" rather than a serialized or imploded version. How should it save the settings and what might be wrong? I think this is the result of a bad mod on my shop. The module is the BAX Global shipping module.

Link to comment
Share on other sites

Modify the file to serialize and unserialize the value as appropriate.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

If nobody else is reporting the same problem perhaps a step was missed during the installation.

 

Have you searched the contribution support area for the support thread for this contribution to see if perhaps someone else did have the same problem and a fix is provided?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Thanks for the suggestion. I've tried reinstalling the module and there are no other reports of it not working in this manner. Is it the module that is responsible for serializing or some part of the general functions?

Link to comment
Share on other sites

  • 1 month later...
Thanks for the suggestion. I've tried reinstalling the module and there are no other reports of it not working in this manner. Is it the module that is responsible for serializing or some part of the general functions?

 

 

The below text is taken from the UPS XML contribution:

 

In catalog/admin/modules.php

 

*****************************************

Find This code somewhere around line 43:

*****************************************

 

if (tep_not_null($action)) {

switch ($action) {

case 'save':

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

 

***********************************************

INSERT THE FOLLOWING CODE AFTER THE ABOVE LINE:

***********************************************

 

if( is_array( $value ) ){

$value = implode( ", ", $value);

$value = ereg_replace (", --none--", "", $value);

}

 

****************************

SO IT SHOULD LOOK LIKE THIS:

****************************

 

if (tep_not_null($action)) {

switch ($action) {

case 'save':

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

if( is_array( $value ) ){

$value = implode( ", ", $value);

$value = ereg_replace (", --none--", "", $value);

}

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");

}

tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));

break;

case 'install':

 

 

That will fix the problem, I believe.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...