Seltsames Problem mit Staffelpreisen

MyOOS hat einen Fehler, oder tut nicht das, was Ihr erwartet? Derartige "Unanehmlichkeiten" bitte hier.
Antworten
Maw.
Beiträge: 41
Registriert: 20.02.2009, 23:07
Kontaktdaten:

Seltsames Problem mit Staffelpreisen

Beitrag von Maw. »

Hallo,
hab ein seltsames Problem, und zwar in einer Kategorie sind einige Produkte und sobald ein Produkt Staffelpreise hat, dann steht bei allen weiteren Produkten als Preis der billigste Staffelpreis des einen Produktes dort.
Lösch ich die Staffelpreise raus, stimmt alles.
Zu sehen hier:
http://www.huber-schriften.com/onlinesh ... &cPath=65&
Das erste Produkt hat Staffelpreise wobei 51+ Stück 1,68€ kosten und somit sind die Preise aller weiteren Produkte auf der Übersichtsseite mit dem Preis angegeben.
Klickt man auf ein anderes Produkt, so sieht man den richtigen Preis.

Hatte ich sonst noch nie ;(

Gruß Maw
r23
Beiträge: 2674
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

hallo,

poste bitte einmal den bereich von

Code: Alles auswählen

          case 'PRODUCT_LIST_PRICE':
aus

~/product_listing.php

cu

ralf
Maw.
Beiträge: 41
Registriert: 20.02.2009, 23:07
Kontaktdaten:

Beitrag von Maw. »

Hallo Ralf,
folgender Code:

Code: Alles auswählen

      	case 'PRODUCT_LIST_PRICE':
        	$lc_align = 'right';

        	if ( $listing['products_discount4'] > 0 ) {
          	$price_discount = $oCurrencies->display_price($listing['products_discount4'], oos_get_tax_rate($listing['products_tax_class_id']));
        	} elseif ( $listing['products_discount3'] > 0 ) {
          	$price_discount = $oCurrencies->display_price($listing['products_discount3'], oos_get_tax_rate($listing['products_tax_class_id']));
        	} elseif ( $listing['products_discount2'] > 0 ) {
          	$price_discount = $oCurrencies->display_price($listing['products_discount2'], oos_get_tax_rate($listing['products_tax_class_id']));
        	} elseif ( $listing['products_discount1'] > 0 ) {
          	$price_discount = $oCurrencies->display_price($listing['products_discount1'], oos_get_tax_rate($listing['products_tax_class_id']));
        	}

        	$pl_product_price = $oCurrencies->display_price($listing['products_price'], oos_get_tax_rate($listing['products_tax_class_id']));

        	if (oos_is_not_null($listing['specials_new_products_price'])) {
          	$pl_special_price = $listing['specials_new_products_price'];
          	$pl_product_special_price = $oCurrencies->display_price($pl_special_price, oos_get_tax_rate($listing['products_tax_class_id']));
        	} else {
          	$pl_max_product_discount =  min($listing['products_discount_allowed'],$_SESSION['member']->group['discount']);

          	if ($pl_max_product_discount != 0 ) {
            	$pl_special_price = $listing['products_price']*(100-$pl_max_product_discount)/100;
            	$pl_product_special_price = $oCurrencies->display_price($pl_special_price, oos_get_tax_rate($listing['products_tax_class_id']));
          	}
        	}


        	if ($listing['products_base_price'] != 1) {
          	$pl_base_product_price = $oCurrencies->display_price($listing['products_price'] * $listing['products_base_price'], oos_get_tax_rate($listing['products_tax_class_id']));

          	if ($pl_special_price != '') {
            	$pl_base_product_special_price = $oCurrencies->display_price($pl_special_price * $listing['products_base_price'], oos_get_tax_rate($listing['products_tax_class_id']));
          	}
        	}


        	if (oos_is_not_null($listing['specials_new_products_price'])) {
          	$lc_text = ' <s>' . $pl_product_price . '</s><br />';
          	if ($listing['products_base_price'] != 1)  $lc_text .= '<s><span class="base_price">' . $listing['products_base_unit'] . ' = ' . $pl_base_product_price . '</span></s><br />';

          	$lc_text .= ' <span class="special_price">' . $pl_product_special_price . '</span>';
          	if ($listing['products_base_price'] != 1)  $lc_text .= '<br /><span class="special_base_price">' . $listing['products_base_unit'] . ' = ' . $pl_base_product_special_price . '</span></s><br />';
        	} else {
          	if ($pl_max_product_discount != 0 ) {
            	$lc_text = ' <s>' . $pl_product_price . '</s> -' . number_format($pl_max_product_discount, 2) . '%<br />';
            	$lc_text .= ' <span class="discount_price">' . $pl_product_special_price . '</span>';
            	if ($listing['products_base_price'] != 1)  $lc_text .= '<br /><span class="special_base_price">' . $listing['products_base_unit'] . ' = ' . $pl_base_product_special_price . '</span></s><br />';
          	} else {
            	if (isset($price_discount)) {
              	$lc_text = 'ab ' . $price_discount . '<br />';
            	} else {
              	$lc_text = 'ab ' . $pl_product_price . '<br />';
            	}
          	}
        	}

        	break;
Gruß Marc
r23
Beiträge: 2674
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

füge zwischen

Code: Alles auswählen

        	$lc_align = 'right';
und

Code: Alles auswählen

        	if ( $listing['products_discount4] > 0 ) {
dies ein

Code: Alles auswählen

unset ($price_discount);
$price_discount = 0;
$pl_product_price = 0;
$pl_special_price = '';
solltest du als Anzeige ab 0.00 Euro erhalten, so kannst du evtl. auch unset

http://de.php.net/unset

verwenden

Code: Alles auswählen

unset ($price_discount);
unset ($price_discount);
unset ($pl_product_price);
$pl_special_price = '';
hoffe die Antwort hilft weiter?

cu

ralf
Maw.
Beiträge: 41
Registriert: 20.02.2009, 23:07
Kontaktdaten:

Beitrag von Maw. »

okay, mit dem Löschen der Variablen, also mit UNSET hat es funktioniert!
Vielleicht nur ganz kurz, woran ist das gelegen? Warum ist das hier auf einmal so gewesen?

Schöne Grüße und vielen Dank!
Marc
Antworten