IngoPhisto Posted August 1, 2017 Share Posted August 1, 2017 (edited) OSC 2.3.4 Im Admin kann die Lagermenge (products.products_quantity) zur Anzeigeliste hinzugefügt werden. Das erzeugt allerding eine zusätzliche Spalte im Listing und ist wohl eher nicht gewollt. Die Einstellung wirkt sich auf alle Seiten aus, die includes/modules/product_listing.php zur Anzeige benutzen. Das sieht dann etwa so aus: // create column list $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE, 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW); ... $select_column_list = ''; ... case 'PRODUCT_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; Hier müsst Ihr das besagte Datenfeld ohne Bedingung in die Abfrageliste (die in der Variablen $select_column_list gesammelt wird) einfügen. Und natürlich die Option, dass es im Admin aktiviert wird, inaktiv setzen. $select_column_list = 'p.products_quantity, '; ... case 'PRODUCT_LIST_QUANTITY': //$select_column_list .= 'p.products_quantity, '; break; Sodann könnt Ihr im Listing zu jeder Zeit auf das Array-Element $listing['products_quantity'] zugreifen. PS: mir fallen derzeit ein: index.php und advanced_search_result.php Edited August 1, 2017 by Ingo Malchow Link to comment Share on other sites More sharing options...
Yepi1533005574 Posted August 1, 2017 Share Posted August 1, 2017 Danke Ingo. Link to comment Share on other sites More sharing options...
Guest Posted August 1, 2017 Share Posted August 1, 2017 Danke Ingo! Link to comment Share on other sites More sharing options...
Guest Posted August 12, 2017 Share Posted August 12, 2017 Alles funzt jetzt!!! Da wir nun keine 30 Grad mehr im Büro haben, konnte ich mich der Sache oben annehmen. Hier die Zusammenfassung als Add-On zum download bereit: https://apps.oscommerce.com/r7tE4&product-not-available-online-but-shown Link to comment Share on other sites More sharing options...
Guest Posted August 18, 2017 Share Posted August 18, 2017 On 30.06.2017 at 18:53, BoniChipsy said: Ich habe Version 2.3.3 Wem dieses Add-On gefällt, der darf es zeigen durchs clicken rechts auf GEFÄLLT MIR Link to comment Share on other sites More sharing options...
Yepi1533005574 Posted September 15, 2017 Share Posted September 15, 2017 Hast du ne idee wie ich es hier in das modul new_products einbinde ? Mein code: $new_prods_content .= ' <div style="float:right; padding-top: 0px">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id'])). tep_draw_button(IMAGE_BUTTON_PROD_DETAILS, 'help', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '' ); danke im voraus. Link to comment Share on other sites More sharing options...
Yepi1533005574 Posted September 16, 2017 Share Posted September 16, 2017 habs hinbekommen. hier der geänderter code: $new_prods_content .= '<div class="footerProducto">'; if($new_products['products_quantity']>0) { $new_prods_content .= ' <div style="float:right; padding-top: 0px">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id'])). tep_draw_button(IMAGE_BUTTON_PROD_DETAILS, 'help', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '' ); }else{ $new_prods_content .= ' <div style="float:right; padding-top: 0px">' . tep_draw_button(IMAGE_BUTTON_PROD_QUESTION_DETAILS, 'help', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '' ); } ************************************************************* Hier noch mal die advanced_search_result.php in der query fehlt die Abfrage: p.products_quantity ohne diese Abfrage werden bei mir alle Produkte mit dem Anfragebutton ausgegeben. Suchen nach: $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, ersätzen mit: $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, p.products_quantity, Jetzt sollte alles funktionieren und nur das Produkt das angefragt werden soll auch mt diesem Button erscheint. Tolle Arbeit @BoniChipsy Link to comment Share on other sites More sharing options...
Recommended Posts