Skip to content

Commit

Permalink
Make use of whereColumn to fix related products query (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclaudio authored Sep 29, 2022
1 parent 87b9e85 commit 21a85d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Scopes/RelatedProductsScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function apply(Builder $builder, Model $model)
->where('related.store_id', config('rapidez.store'));
})
->leftJoin('cataloginventory_stock_item as related_stock', 'related_stock.product_id', '=', 'related.entity_id')
->where('mainrule.entity_id', '=', $builder->getQuery()->from.'.entity_id')
->whereColumn('mainrule.entity_id', $builder->getQuery()->from.'.entity_id')
->where('mainrule.relation', 'where_show')
->whereIn('mainrule.position', ['product_into_related', 'product_into_upsell'])
->where('mainrule.store_id', config('rapidez.store')),
Expand Down

0 comments on commit 21a85d7

Please sign in to comment.