Artikelattribute Reihenfolge sortieren

Aus Wiki | modified eCommerce Shopsoftware
Zur Navigation springenZur Suche springen

Bei dem Produkten sind alle Attribute durcheinander...also zuerst Farbe, dann Größe, dann Motiv...und ich möchte das gerne sortieren...kann mir wer helfen???

Antwort von Hendrik (19.07.2009)

Die Optionsnamen werden nach Name sortiert. Wenn du den Optionen entsprechende Namen gibst wird entsprechend sortiert.

Farbe -> 10_Farbe Motiv -> 11_Motiv

Nun ist das Präfix allerdings unschön in der Darstellung. Durch u.g. Patches wird das Präfix von der Darstellung im Frontend ausgefiltert.

Beachte. Die Sortierung ist alphanumerisch, nicht numerisch. D.h. "120_" kommt vor "12_". Dem begegnest du indem du darauf achtest stets gleich viele Stellen für die Nummerierung zu verwenden. z.B. "001_", "002_", usw.

   includes/modules/product_attributes.php
   ---------------------------------------
   Finde:
       $selected = 0;
       $products_options_array = array ();

   Füge an:
       $products_options_name['products_options_name']=preg_replace('/^[0-9]*_(.*)/','$1', $products_options_name['products_options_name']);



   shopping_cart.php
   -----------------
   Finde:
           $attributes_values = xtc_db_fetch_array($attributes);

   Füge an:
           $attributes_values['products_options_name']=preg_replace('/^[0-9]*_(.*)/','$1', $attributes_values['products_options_name']);


   checkout_confirmation.php
   -------------------------
   Finde:
       for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
         
   Füge an:     
       $order->products[$i]['attributes'][$j]['option']=preg_replace('/^[0-9]*_(.*)/','$1', $order->products[$i]['attributes'][$j]['option'] );


   checkout_process.php
   --------------------
   Finde:
         $attributes_values = xtc_db_fetch_array($attributes);

   Füge an:
         $attributes_values['products_options_name']=preg_replace('/^[0-9]*_(.*)/','$1', $attributes_values['products_options_name']);



Antwort von web28 (11.10.2009)
Sinnvoller wäre es, die fehlende Sortierfunktion zu ergänzen: MODUL: Artikelmerkmale sortieren - modified eCommerce Shopsoftware 1.0x