Seite 1 von 1

Merkwürdiges verhalten im Shop

Verfasst: 27.10.2009, 21:10
von wolfschw
Hallo

Folgendes Problemchen

Search Engine Friendly URLs ist Installiert.
Konfiguration ==> Shop Layout ==> Warenkorb anzeigen ist auf false
Wenn ich auf der Seite Produkt-Listing bin und die Menge eines Produktes eingebe und dan auf jetzt kaufen klicke,
wird das Produkt in den Warenkorb gelegt und die Produkt-Info Seite wird angezeigt. ?( <komisch>
Wenn ich nun aber die Search Engine Friendly URLs abschalte wird das Produkt in den Warenkorb
gelegt und ich bleibe auf der Seite Produkt-Listing.

Gruß

Wolfgang

Verfasst: 29.10.2009, 01:06
von r23
Hallo,

kann ich im System nicht bestätigen

http://demo.myoos.de/Wein/Rotwein-c-4_7.html

das Produkt wird bei "Suchmaschinen freundlichen Links" in den warenkorb gelegt ohne auf die produkt_info
zu springen.

Der Shop geht nur bei Produkten mit *Merkmalen* bzw. Optionen auf die produkt_info Seite und verlässt dann die
Auflistung

hth

ralf

Verfasst: 29.10.2009, 08:23
von wolfschw
Hallo

Es gibt bei mir aber keine Merkmale oder Optionen im Artikel.
Er springt einfach zum Produkt-info

gruß

Wolfgang

Verfasst: 29.10.2009, 12:16
von r23
Kann man sich dies ansehen?

Bitte ein Link zum Shop

(wenn man etwas ändern muss am shop) ich komme erst in 12 Stunden
zu einer Besichtigung)

Gruß

Ralf

Verfasst: 29.10.2009, 13:43
von wolfschw
Hallo

Na klar doch
Beispiel:
http://www.jura-ersatzteile-shop.de/Kaffee-c-25.html


Schönen Tag noch

gruß

Wolfgang

Verfasst: 29.10.2009, 15:38
von r23
Hallo,

danke.

das Formular ist soweit in Ordnung

Der fehlerhafte Shop

Code: Alles auswählen

<form name="buy_now" action="http://www.jura-ersatzteile-shop.de/index.php" method="post">
<input type="hidden" name="action" value="buy_now">
<input type="hidden" name="products_id" value="79">
<input type="hidden" name="mp" value="main">
<input type="hidden" name="file" value="shop">
<input type="hidden" name="cPath" value="25">
<input type="hidden" name="page" value="1" />
<input type="text" name="cart_quantity" value="1" size="3" />
<input type="image" src="themes/osc/images/buttons/deu/buy_now.gif" alt="1 x 'Jura Cafe Creme 500g' bestellen!" border="0"  />
</form></td>
der Demo Shop

Code: Alles auswählen

<form name="buy_now" action="http://demo.myoos.de/index.php" method="post">
<input type="hidden" name="action" value="buy_now">
<input type="hidden" name="products_id" value="8">
<input type="hidden" name="mp" value="main">
<input type="hidden" name="file" value="shop">
<input type="hidden" name="cPath" value="3">
<input type="hidden" name="page" value="1" />
<input type="text" name="cart_quantity" value="1" size="3" />
<input type="image" src="themes/oos/images/buttons/deu/buy_now.gif" alt="1 x 'Kochlöffel Silikon Profi Plus' bestellen!" border="0"  />
</form></td>
sieht für mich zumindest zurzeit gleich aus.


wenn man das Formular absendet verwendet der Shop
~/shop/includes/oos_cart_actions.php

Code: Alles auswählen

  if (DISPLAY_CART == 'true') {
    $goto_mp = $aModules['main];
    $goto_file = $aFilename['main_shopping_cart];
    $parameters = array('action', 'cPath', 'products_id', 'pid');
  } else {
    $goto_mp = $sMp;
    $goto_file = $sFile;
    if ($_GET['action] == 'buy_now') {
      $parameters = array('action', 'pid', 'products_id', 'cart_quantity');
    } elseif ($_POST['action] == 'buy_now') {
      $parameters = array('action', 'pid', 'products_id', 'cart_quantity');
    } elseif ($_GET['action] == 'buy_slave')  {
      $parameters = array('action', 'pid', 'slave_id', 'cart_quantity');
    } elseif ($_POST['action] == 'buy_slave')  {
      $parameters = array('action', 'pid', 'slave_id', 'cart_quantity');
    } else {
      $parameters = array('action', 'pid', 'cart_quantity');
    }
  }
[code=php]

Hiernach bitte einmal zur Prüfung 

[code=php]
echo 'goto_mp=' . $goto_mp . '<br>';
echo 'goto_file=' . $goto_file .<br>';
exit;
eintragen.

es sollte bei einem "in den Warenkorb" legen folges auf dem Monitor stehen.

goto_mp=main
goto_file=shop

wenn nicht, benötige das Ergebnis.

Ab Zeile 242

Code: Alles auswählen

    case 'buy_now' :
verarbeitet des Script die Aktion 'buy_now'
und ab Zeile 273

Code: Alles auswählen

      } elseif (isset($_POST['products_id]) && is_numeric($_POST['products_id])) {
        if (oos_has_product_attributes($_POST['products_id])) {
          oos_redirect(oos_link($aModules['products], $aFilename['product_info], 'products_id=' . $_POST['products_id]));
        } else {
mit diesem oos_redirect geht der shop bei Produktmerkmalen zur Produktinfoseite.
bitte auf Fehler prüfen.

z.b.

Code: Alles auswählen

      } elseif (isset($_POST['products_id]) && is_numeric($_POST['products_id])) {
        if (oos_has_product_attributes($_POST['products_id])) {
echo 'Produnktmerkmal';
exit;
          oos_redirect(oos_link($aModules['products], $aFilename['product_info], 'products_id=' . $_POST['products_id]));
        } else {
Sollte Produnktmerkmal im Brwoserstehen, so bitte melden.

Code: Alles auswählen


          if (DECIMAL_CART_QUANTITY == 'true') {
            $_POST['cart_quantity] = str_replace(',', '.', $_POST['cart_quantity]);
          }

          if (isset($_POST['cart_quantity]) && is_numeric($_POST['cart_quantity])) {

            $cart_quantity = oos_prepare_input($_POST['cart_quantity]);
            $cart_qty = $_SESSION['cart]->get_quantity($_POST['products_id]);
            $news_qty = $cart_qty + $cart_quantity;

            $products_order_min = oos_get_products_quantity_order_min($_POST['products_id]);
            $products_order_units = oos_get_products_quantity_order_units($_POST['products_id]);

            if ( ($cart_quantity >= $products_order_min) or ($cart_qty >= $products_order_min) ) {
              if ( ($cart_quantity%$products_order_units == 0) and ($news_qty >= $products_order_min) ) {
                $_SESSION['cart]->add_cart($_POST['products_id], $news_qty);
              } else {
                $_SESSION['error_cart_msg] = $aLang['error_products_quantity_order_min_text] . $aLang['error_products_units_invalid] . $cart_quantity  . ' - ' . $aLang['products_order_qty_unit_text_info] . ' ' . $products_order_units;
              }
            } else {
              $_SESSION['error_cart_msg] = $aLang['error_products_quantity_order_min_text] . $aLang['error_products_quantity_invalid] . $cart_quantity . ' - ' . $aLang['products_order_qty_min_text_info] . ' ' . $products_order_min;
            }
          }

In Zeile 301 prüft der Shop ob die Session variable leer ist $_SESSION['error_cart_msg]
ist die $_SESSION['error_cart_msg] leer?

Code: Alles auswählen

echo $_SESSION['error_cart_msg];
echo 'end';
exit
vor

Code: Alles auswählen


          if ($_SESSION['error_cart_msg] == '') {
            oos_redirect(oos_link($goto_mp, $goto_file, oos_get_all_post_parameters($parameters), 'NONSSL'));
          } else {
            oos_redirect(oos_link($aModules['products], $aFilename['product_info], 'products_id=' . $_POST['products_id]));
          }
        }
      }
eintragen.

Es sollte
end
nur im Browser angezigt werden.

Code: Alles auswählen

exit 
beendet in diesem Debug Weg PHP, daher bitte vor jedem neuen Schritt, die alten Test-Erweiterungen
löschen.

Gruß

ralf

Verfasst: 29.10.2009, 20:09
von wolfschw
Hallo

Fehler gefunden 8o
und zwar in der /shop/includes/oos_cart_actions.php

Code: Alles auswählen

 if (DISPLAY_CART == 'true') { 
$goto_mp = $aModules['main]; 
$goto_file = $aFilename['main_shopping_cart]; 
$parameters = array('action', 'cPath', 'products_id', 'pid'); 
} else { 
$goto_mp = $sMp; 
$goto_file = $sFile; 
if ($_GET['action] == 'buy_now') { 
$parameters = array('action', 'pid', 'products_id', 'cart_quantity'); 
} elseif ($_POST['action] == 'buy_now') { 
$parameters = array('action', 'pid', 'products_id', 'cart_quantity'); 
} elseif ($_GET['action] == 'buy_slave') { 
$parameters = array('action', 'pid', 'slave_id', 'cart_quantity'); 
} elseif ($_POST['action] == 'buy_slave') { 
$parameters = array('action', 'pid', 'slave_id', 'cart_quantity'); 
} else { 
$parameters = array('action', 'pid', 'cart_quantity'); 
} 
}


in Zeile 9 und 11 fehlte 'products_id'

Noch 20 Jahre weiter und Ich behersche das php ;)


Gruß

Wolfgang

und Danke an ralf