Created
September 16, 2020 06:42
-
-
Save edavydova/918517d093d5e92fb845c0b3e495ea27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/master_products/func.php b/app/addons/master_products/func.php | |
index 6987bbc3a5..d075f8b20b 100644 | |
--- a/app/addons/master_products/func.php | |
+++ b/app/addons/master_products/func.php | |
@@ -26,6 +26,7 @@ use Tygh\Enum\VendorStatuses; | |
use Tygh\Registry; | |
use Tygh\Storefront\Storefront; | |
use Tygh\Settings; | |
+use Tygh\Enum\YesNo; | |
/** | |
* Installs the add-on products block and the product tab. | |
@@ -1063,7 +1064,8 @@ function fn_master_products_seo_get_schema_org_markup_items_post($product_data, | |
$offer_count = $product_repository->getVendorProductsCount( | |
$product_data['product_id'], | |
[ObjectStatuses::ACTIVE, ObjectStatuses::HIDDEN], | |
- [VendorStatuses::ACTIVE] | |
+ [VendorStatuses::ACTIVE], | |
+ Registry::get('settings.General.show_out_of_stock_products') === YesNo::YES | |
); | |
if ($offer_count === 0) { | |
@@ -1089,7 +1091,8 @@ function fn_master_products_seo_get_schema_org_markup_items_post($product_data, | |
$vendor_product_ids = $product_repository->findVendorProductIds( | |
$product_data['product_id'], | |
[ObjectStatuses::ACTIVE, ObjectStatuses::HIDDEN], | |
- [VendorStatuses::ACTIVE] | |
+ [VendorStatuses::ACTIVE], | |
+ Registry::get('settings.General.show_out_of_stock_products') === YesNo::YES | |
); | |
$vendor_products = $product_repository->findProducts($vendor_product_ids); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/master_products/Tygh/Addons/MasterProducts/Product/Repository.php b/app/addons/master_products/Tygh/Addons/MasterProducts/Product/Repository.php | |
index 9288f4c9cf..4da84ddf3f 100644 | |
--- a/app/addons/master_products/Tygh/Addons/MasterProducts/Product/Repository.php | |
+++ b/app/addons/master_products/Tygh/Addons/MasterProducts/Product/Repository.php | |
@@ -155,7 +155,7 @@ class Repository | |
* | |
* @return int[] Vendor product IDs | |
*/ | |
- public function findVendorProductIds($master_product_id, array $status = null, array $company_status = null, $is_show_out_of_stock_products_enabled = false) | |
+ public function findVendorProductIds($master_product_id, array $status = null, array $company_status = null, $is_show_out_of_stock_products_enabled = true) | |
{ | |
if (!$master_product_id) { | |
return []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment