Hallo. Ich möchte in der Shopversion 2.7.1.2 die CheckoutProcessProcess.inc.php überladen. Dazu habe ich in /user_classes/overloads/CheckoutProcessProcess/ die Datei MY_CheckoutProcessProcess.php angelegt Code: class MY_CheckoutProcessProcess extends MY_CheckoutProcessProcess_parent { public function save_order_product_attribute($p_product_array, $p_attribute_array, $p_order_products_id) { if(DOWNLOAD_ENABLED == 'true') { ....................................... usw ............... } } } Leider werden die Änderungen nicht übernommen. In der Shopversion 2.6.x hat das Ganze noch funktioniert. Hab ich einen Denkfehler? Danke und Gruß
Überladen ist eine Technik! Du solltest dir mal die Methode _setDownloadInformation in der Klasse CheckoutProcessProcess ansehen.
Danke für den Hinweis. Aber da bin ich zu wenig Progger... Normale SQL Abfragen wie in der Code: save_order_product_attribute kann ich noch lesen und ändern. Muß vermutlich doch noch einen Kurs machen. Gibts da was wo sich ein Autodidakt einlesen kann?
Bei mir wurden die "Overloads" teilweise erst nach mehrmaligen Durchlauf aktiv - denke liegt am Cache. Tee trinken und abwarten und wenn es nach einigen Minuten immer noch nicht angesprochen wird, helfen dir die "Proger" bestimmt weiter
Nein, daran liegt es nicht! Er versucht eine Methode zu überladen, welche es in der Version 2.7 nicht mehr gibt! Stattdessen werden neue Services eingesetzt die ihre eigenen Methoden mitbringen. Steht alles im Post von Marco(siehe oben)!!! Man muss nur mal lesen!!!
Ähm.... und was befindet sich in der Methode??? Sind doch auch nur "normale" Abfragen... PHP: protected function _setDownloadInformation(array $product, OrderItemInterface $item) { if(DOWNLOAD_ENABLED == 'true' && isset($product['attributes'])) { foreach($product['attributes'] as $attribute) { $query = 'SELECT pad.`products_attributes_maxdays` AS `max_days_allowed`, pad.`products_attributes_maxcount` AS `count_available`, pad.`products_attributes_filename` AS `filename` FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' pa, ' . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . ' pad WHERE pa.`products_id` = ' . (int)$product['id'] . ' AND pa.`options_id` = ' . (int)$attribute['option_id'] . ' AND pa.`options_values_id` = ' . (int)$attribute['value_id'] . ' AND pa.`products_attributes_id` = pad.`products_attributes_id`'; $result = xtc_db_query($query); if(xtc_db_num_rows($result)) { $row = xtc_db_fetch_array($result); $orderItemDownloadInformation = MainFactory::create('OrderItemDownloadInformation', new FilenameStringType($row['filename']), new IntType($row['max_days_allowed']), new IntType($row['count_available'])); $item->setDownloadInformation($orderItemDownloadInformation); // an OrderItem only can have 1 download return; } } } }
Ah jo hier steht es: /** * @deprecated deprecated since version GX2.7 - method will not be called. It will be deleted in GX2.9. * * @param array $p_product_array * @param array $p_attribute_array * @param int $p_order_products_id */ public function save_order_product_attribute($p_product_array, $p_attribute_array, $p_order_products_id) ....
OK. Denke ich komme der Sache näher... PHP: _setOrderItemAttributeCollection ist die neue Funktion, die muß ich mit PHP: _setDownloadInformation vergleichen und lernen...