Skip to content

Commit

Permalink
Revert "Implemented the show out of stock option"
Browse files Browse the repository at this point in the history
This reverts commit 95935f1.
  • Loading branch information
royduin committed Dec 13, 2021
1 parent 3bdf0f6 commit 46e6fe5
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/Models/Scopes/RelatedProductsScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,10 @@ public function apply(Builder $builder, Model $model)
->where('mainrule.relation', 'where_show')
->where('mainrule.store_id', config('rapidez.store'));
})
->leftJoin('amasty_mostviewed_group', 'mainrule.rule_id', '=', 'amasty_mostviewed_group.group_id')
->leftJoin('amasty_mostviewed_product_index as related', function ($join) {
$join->on('related.rule_id', '=', 'mainrule.rule_id')
->where('related.relation', 'what_show')
->where('related.store_id', config('rapidez.store'));
})
->leftJoin('cataloginventory_stock_item as related_stock', 'related_stock.product_id', '=', 'related.entity_id')
->where(function ($query) {
$query->where(function ($query) {
$query->where('amasty_mostviewed_group.show_out_of_stock', 1)
->whereIn('related_stock.is_in_stock', [0, 1]);
})->orWhere(function ($query) {
$query->where('amasty_mostviewed_group.show_out_of_stock', 0)
->where('related_stock.is_in_stock', 1);
});
});
}
}

0 comments on commit 46e6fe5

Please sign in to comment.