Skip to content

Instantly share code, notes, and snippets.

@tangar76
tangar76 / __content.md
Last active October 5, 2018 08:21
Firecheckout M2 - customization examples
@tangar76
tangar76 / snippet.js
Created December 12, 2018 14:44
Get product IDs on category page (Magento admin)
jQuery('#catalog_category_products_table tbody td.col-entity_id').map(function() { return jQuery(this).text().trim(); }).get().join();
@tangar76
tangar76 / help.md
Last active February 5, 2020 20:36
Valet deployment
@tangar76
tangar76 / MagentoCatalogImportExport_Model_Import_Product.php.diff
Last active February 5, 2021 08:27
Fixed stock status to "Out of Stock" after product import even product allowed backorders. .../module-catalog-import-export/Model/Import/Product.php
--- /vendor/magento/module-catalog-import-export/Model/Import/Product.php
+++ /vendor/magento/module-catalog-import-export/Model/Import/Product.php (Unsaved)
@@ -3062,7 +3062,9 @@
$stockItemDo = $this->stockRegistry->getStockItem($row['product_id'], $row['website_id']);
$existStockData = $stockItemDo->getData();
- if (isset($rowData['qty']) && $rowData['qty'] == 0 && !isset($rowData['is_in_stock'])) {
+ if (isset($rowData['qty']) && $rowData['qty'] == 0 && !isset($rowData['is_in_stock'])
+ && empty($existStockData['backorders']) // backorders not set or set to 0
+ ) {