Artur Pakuła

Artur Pakuła webdeveloper,
którego największa
pasja jest jego
pracą

Temat: własne pola w produktach

Witajcie.
podług wskazówek znalezionych na: http://www.zen-cart.com/forum/showthread.php?t=120523
dodałem swoje pola do produktu (kilka pól do koloru, materiału i wymiarów. teraz mam problem taki, że gdy dodaję produkt zapamiętują mi się pierwsze 4 z 18 pól. reszta niestety nie, ale gdy wejdę ponownie w produkt to mogę uzupełnić elementy i gdy zaakceptuję jest wówczas zapamiętane wszystko i wyświetla się jak potrzebuję, lecz gdy wejdę znów w produkt to nie ładują mi się zapisane dane. co mogę robić nie tak?

Pozdrawiam

Sądzę, że coś tu mam coś źle:
$sql_data_array = array('products_colour' => zen_db_prepare_input($_POST['products_colour']));
$sql_data_array1 = array('products_colour1' => zen_db_prepare_input($_POST['products_colour1']));
$sql_data_array2 = array('products_colour2' => zen_db_prepare_input($_POST['products_colour2']));
$sql_data_array3 = array('products_colour3' => zen_db_prepare_input($_POST['products_colour3']));
$sql_data_array4 = array('products_colour4' => zen_db_prepare_input($_POST['products_colour4']));
$sql_data_array5 = array('products_colour5' => zen_db_prepare_input($_POST['products_colour5']));
$sql_data_array6 = array('products_colour6' => zen_db_prepare_input($_POST['products_colour6']));
$sql_data_array7 = array('products_colour7' => zen_db_prepare_input($_POST['products_colour7']));
$sql_data_array8 = array('szer' => zen_db_prepare_input($_POST['szer']));
$sql_data_array9 = array('wys' => zen_db_prepare_input($_POST['wys']));
$sql_data_array10 = array('dl' => zen_db_prepare_input($_POST['dl']));
$sql_data_array11 = array('sr' => zen_db_prepare_input($_POST['sr']));
$sql_data_array12 = array('material1' => zen_db_prepare_input($_POST['material1']));
$sql_data_array13 = array('material2' => zen_db_prepare_input($_POST['material2']));
$sql_data_array14 = array('material3' => zen_db_prepare_input($_POST['material3']));
$sql_data_array15 = array('material4' => zen_db_prepare_input($_POST['material4']));
$sql_data_array16 = array('il_zr_sw' => zen_db_prepare_input($_POST['il_zr_sw']));
$sql_data_array17 = array('zr_sw1' => zen_db_prepare_input($_POST['zr_sw1']));
$sql_data_array18 = array('zr_sw2' => zen_db_prepare_input($_POST['zr_sw2']));



if ($action == 'insert_product') {
$insert_sql_data = array('products_id' => $products_id);

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
$sql_data_array1 = array_merge($sql_data_array1, $insert_sql_data);
$sql_data_array2 = array_merge($sql_data_array2, $insert_sql_data);
$sql_data_array3 = array_merge($sql_data_array3, $insert_sql_data);
$sql_data_array4 = array_merge($sql_data_array4, $insert_sql_data);
$sql_data_array5 = array_merge($sql_data_array5, $insert_sql_data);
$sql_data_array6 = array_merge($sql_data_array6, $insert_sql_data);
$sql_data_array7 = array_merge($sql_data_array7, $insert_sql_data);
$sql_data_array8 = array_merge($sql_data_array8, $insert_sql_data);
$sql_data_array9 = array_merge($sql_data_array9, $insert_sql_data);
$sql_data_array10 = array_merge($sql_data_array10, $insert_sql_data);
$sql_data_array11 = array_merge($sql_data_array11, $insert_sql_data);
$sql_data_array12 = array_merge($sql_data_array12, $insert_sql_data);
$sql_data_array13 = array_merge($sql_data_array13, $insert_sql_data);
$sql_data_array14 = array_merge($sql_data_array14, $insert_sql_data);
$sql_data_array15 = array_merge($sql_data_array15, $insert_sql_data);
$sql_data_array16 = array_merge($sql_data_array16, $insert_sql_data);
$sql_data_array17 = array_merge($sql_data_array17, $insert_sql_data);
$sql_data_array18 = array_merge($sql_data_array18, $insert_sql_data);

zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array1);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array2);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array3);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array4);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array5);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array6);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array7);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array8);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array9);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array10);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array11);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array12);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array13);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array14);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array15);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array16);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array17);
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array18);
} elseif ($action == 'update_product') {
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array1, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array2, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array3, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array4, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array5, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array6, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array7, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array8, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array9, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array10, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array11, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array12, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array13, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array14, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array15, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array16, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array17, 'update', "products_id = '" . (int)$products_id . "'");
zen_db_perform(TABLE_PRODUCTS_EXTRA_STUFF, $sql_data_array18, 'update', "products_id = '" . (int)$products_id . "'");
}Artur Pakuła edytował(a) ten post dnia 25.02.12 o godzinie 21:38