Hallo, wenn ich in der Shopversion 4.4.0.1 versuche eine Funktion in der Datei OrderDetailsCartThemeContentView.inc.php zu überladen dann läuft das nicht mehr wie bisher... Beispiel: Code: protected function _getProductAttributes(&$p_product) { ........ $p_product[$option]['products_options_name'] = $attributesValues['products_options_name']; $p_product[$option]['options_values_id'] = (int)$value; $p_product[$option]['products_options_values_name'] = $attributesValues['products_options_values_name']; $p_product[$option]['options_values_price'] = $attributesValues['options_values_price']; $p_product[$option]['price_prefix'] = $attributesValues['price_prefix']; $p_product[$option]['weight_prefix'] = $attributesValues['weight_prefix']; $p_product[$option]['options_values_weight'] = $attributesValues['options_values_weight']; $p_product[$option]['attributes_stock'] = $attributesValues['attributes_stock']; $p_product[$option]['products_attributes_id'] = $attributesValues['products_attributes_id']; $p_product[$option]['products_attributes_model'] = $attributesValues['attributes_model']; if ($attributesValues['weight_prefix'] == '-') { $p_product['gm_weight'] -= $attributesValues['options_values_weight']; } else { $p_product['gm_weight'] += $p_product[$option]['options_values_weight']; } .......... } Hier wollte ich die Ausgabe der einzelnen Werte auslesen / verändern. Änderungen werden aber nicht mehr angenommen. Ich vermute mal daß die Ausgabe nun über die Modifiers läuft. Ist hier keine Überladung mehr möglich?
Schubs... Der Grund dieser Anfrage ist daß bei einem Shop der sehr viele Attribute hat die Anzeige der nicht gewählen Attribute ab dem Warenkorb verschwinden soll. Sonst wird die Liste zu lange mit nicht benötigten Attributen. In den Versionen vor den Modifiers hat das noch schön funktioniert...
Wie sieht der Wert eines nicht gewählten Attributes bei dir aus? Ist das ein leerer String "", ein "-" oder "bitte wählen" oder ähnliches?
Es handelt sich einfach um zwei Bindestriche. Bisher (mit Template) hatte ich das so gelöst: Code: $value_such = substr($attributesValues['products_options_values_name'], 0, 2); if ($value_such == '--' ) { ...................... Das Ganze in der ShoppingCartContentView, order.php und CheckoutProcessProcess
Der Overload der OrderDetailsCartThemeContentView Klasse könnte z. B. so aussehen: PHP: class FilterEmptyAttributes extends FilterEmptyAttributes_parent{ protected function _getProductAttributes($p_product, $p_combisId, $p_markStock, &$p_moduleContent) { $attributes = explode('<br />', $p_moduleContent['MODIFIERS']); foreach ($attributes as $key => $attribute) { if (strpos($attribute, ': --') !== false) { unset($attributes[$key]); } } $p_moduleContent['MODIFIERS'] = implode('<br />', $attributes); return parent::_getProductAttributes($p_product, $p_combisId, $p_markStock, $p_moduleContent); }}