Das ändern der Nettopreise klappt leider nicht, krieg das einfach nicht hin...
Habe jetzt aber ein anderes Problem:
Habe noch eine Spalte "products_zustand" (wird auch für Googlebase benötigt), die möchte ich gern
einbinden, allerdings als drop down menü.
Die Spalte in der Datenbank ist einfach ein string, der wird dann auch auf der Produktseite ausgewertet
und in der jeweiligen Sprache korrekt angezeigt.
Die Werte manuell ändern klappt schonmal, bekomme das aber leider nicht hin, da statt dem
Eingabefenster ein dropdown zu machen (drop down klappt zwar, aber das Update geht schief).
So sieht das bei mir aus:
// drop down für Artikelzustand
$conditions = array (array ('id' => 'neu', 'text' => 'neu'));
$conditions[] = array ('id' => 'gebraucht', 'text' => 'gebraucht');
$conditions[] = array ('id' => 'erneuert', 'text' => 'erneuert');
$condition_select = xtc_draw_pull_down_menu('products_zustand', $conditions, $results['products_zustand'], 'onChange="this.form.submit();" title="'. '"');
?>
<tr class="dataTableRow">
<td class="dataTableContent" align="center"><input type="checkbox" name="stock_update[
<?php echo $results['products_id'] ?>][changed]" />
<input type="hidden" name="stock_update[
<?php echo $results['products_id'] ?>][ptc]" value="
<?php echo $results['categories_id'] ?>" /></td>
<td class="dataTableContent" align="center">
<?php echo $results['products_id'] ?></td>
<td class="dataTableContent" align="center"><input type="text" size="6" name="stock_update[
<?php echo $results['products_id'] ?>][sort]" value="
<?php echo $results['products_sort'] ?>" onChange="
<?php echo $doChange?>" /></td>
<td class="dataTableContent" align="center"><input type="text" size="12" name="stock_update[
<?php echo $results['products_id'] ?>][model]" value="
<?php echo $results['products_model'] ?>" onChange="
<?php echo $doChange?>" /></td>
<td class="dataTableContent" align="center">
<?php echo $catman_select?></td>
<td class="dataTableContent" align="left" >
<?php echo $results['products_name'] ?></td>
<td class="dataTableContent" align="center"><input type="text" size="7" name="stock_update[
<?php echo $results['products_id'] ?>][weight]" value="
<?php echo $results['products_weight'] ?>" onChange="
<?php echo $doChange?>" onBlur="
<?php echo $doValidate_flt?>" /></td>
<td class="dataTableContent" align="center"><input type="text" size="7" name="stock_update[
<?php echo $results['products_id'] ?>][price]" value="
<?php echo number_format($products_price_brutto,2,'.',','); ?>" onChange="
<?php echo $doChange?>" onBlur="
<?php echo $doValidate_flt ?>" /></td>
<td class="dataTableContent" align="right">
<?php echo number_format($results['products_price'],4,'.',','); ?></td>
<td class="dataTableContent" align="center">
<?php echo $results['products_quantity'] ?><input type="hidden" size="4" name="stock_update[
<?php echo $results['products_id'] ?>][oldstock]" value="
<?php echo $results['products_quantity'] ?>" onChange="
<?php echo $doChange?>" /></td>
<td class="dataTableContent" align="center"><input type="text" size="4" name="stock_update[
<?php echo $results['products_id'] ?>][newstock]" value="0" onChange="
<?php echo $doChange?>" onBlur="
<?php echo $doValidate_int?>" /></td>
<!--- Artikelzustand Uptate -->
<!--- <td class="dataTableContent" align="center"><input type="text" size="10" name="stock_update[
<?php echo $results['products_id'] ?>][zustand]" value="
<?php echo $results['products_zustand'] ?>" onChange="
<?php echo $doChange?>" /></td> -->
<td class="dataTableContent" align="center">
<?php echo $condition_select?></td>
<!--- Artikelzustand Uptate -->
<td class="dataTableContent" align="center" ><input type="radio" name="stock_update[
<?php echo $results['products_id'] ?>][active]" value="1"
<?php echo $active ?> onClick="
<?php echo $doChange?>" /></td>
<td class="dataTableContent" align="center" ><input type="radio" name="stock_update[
<?php echo $results['products_id'] ?>][active]" value="0"
<?php echo $inactive ?> onClick="
<?php echo $doChange?>" /></td>
</tr>
Tabellen-Update:
if($filter_type==1){
// Zustand hinzugefügt
$sql = "UPDATE " . TABLE_PRODUCTS . " SET products_sort = '".$items['sort']."', products_quantity = '".$current_stock."', products_model = '".$items['model']."', products_price = '".$products_price_netto."', products_weight = '".$items['weight']."', manufacturers_id = '".$items['manufacturer']."', products_zustand = '".$items['zustand']."', products_status = '".$items['active']."' WHERE products_id = $key";
$qs_sql .= "$sql;\n";
}
else {
// Zustand hinzugefügt
$sql = "UPDATE " . TABLE_PRODUCTS . " SET products_sort = '".$items['sort']."', products_quantity = '".$current_stock."', products_model = '".$items['model']."', products_price = '".$items_price."', products_weight = '".$items['weight']."', products_zustand = '".$items['zustand']."', products_status = '".$items['active']."' WHERE products_id = $key";
$qs_sql .= "$sql;\n";
}
und weiter unten noch ne Spalte angelegt:
<!-- Spalte für Artikelzustand -->
<th scope="col" style="width:60px; align="middle;"><?php echo QUICK_ZUSTAND; ?></th>
<!-- Spalte für Artikelzustand -->