Bonjour,
je suis en train de finaliser la mise en place d'un site web basé sur oscommerce. Je suis encore débutant en php.
J'ai rectifié une contribution pour ajouter des cases à cocher.
Dans un fichier, new_attribute_include.php, j'ai ajouté les lignes suivantes :
if ($attribute_RH == "-1") {
echo "<TD class="main" align="left"><input type="checkbox" name="" . $current_value_id . "_optionValues_RH[]" value="" .$attribute_RH . """ . $CHECKED . "> </TD>";
}else {
echo "<TD class="main" align="left"><input type="checkbox" name="" . $current_value_id . "_optionValues_RH[]" value="" . $attribute_RH . ""> </TD>";
}
if ($attribute_LH == "-1") {
echo "<TD class="main" align="left"><input type="checkbox" name="" . $current_value_id . "_optionValues_LH[]" value="" . $attribute_LH . """ . $CHECKED . "> </TD>";
}else {
echo "<TD class="main" align="left"><input type="checkbox" name="" . $current_value_id . "_optionValues_LH[]" value="" . $attribute_LH . ""> </TD>";
}
Le fichier modifié commence par (pour info) :
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="SUBMIT_ATTRIBUTES">
<INPUT TYPE="HIDDEN" NAME="current_product_id" VALUE="<?=$current_product_id?>">
<INPUT TYPE="HIDDEN" NAME="action" VALUE="change">
<?
if ( $cPath ) echo "<INPUT TYPE=\"HIDDEN\" NAME=\"cPathID\" VALUE=\"" . $cPath . "\">";
require( 'new_attributes_functions.php');
// Temp id for text input contribution.. I'll put them in a seperate array.
$tempTextID= "1999043";
// Lets get all of the possible options
$query = "SELECT * FROM products_options where products_options_id LIKE '%' AND language_id = '$languageFilter'";
Lorsque j'appuie sur save dans mon formulaire, la page new_attribute_change.php est appelée mais elle ne semble pas bien récupérer les valeurs des checkbox :
for ($i = 0; $i < sizeof($optionValues); $i++) {
........
........
(j'ai rajouté ces 2 lignes et modifié la MYSQL_QUERY)
$value_RH = $HTTP_POST_VARS[$optionValues[$i] . '_optionValues_RH'];
$value_LH = $HTTP_POST_VARS[$optionValues[$i] . '_optionValues_LH'];
.....
MYSQL_QUERY( "INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order,RH,LH)
VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix', '$value_sort','$value_RH','$value_LH')" ) or die(mysql_error());
Je suis persuadé que les variables ne sont pas correctement récupérées dans $value_RH et $value_LH
J'espère réellement que quelqu'un de calé pourra m'aider car je suis vraiement scotché :)
Merci
Patrice
Patrice
