Merge pull request #5418 from devansh-webkul/child-product

Case Removed Only For Configurable #5398
This commit is contained in:
Devansh 2021-12-13 10:41:25 +05:30 committed by GitHub
commit f61daeaab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -101,10 +101,7 @@ class WishlistController extends Controller
'customer_id' => $this->currentCustomer->id,
]);
/**
* Accidental case if some one adds id of the product in the anchor tag amd gives id of a variant.
*/
if ($product->parent_id != null) {
if ($product->parent && $product->parent->type !== 'configurable') {
$product = $this->productRepository->findOneByField('id', $product->parent_id);
$data['product_id'] = $product->id;
}