Closed terryupton closed 1 year ago
Great idea I'll have to look into this when I'm not smashed but the feature shouldn't be that tricky
Hey Regan. Hope you're good. Any plans to look at this in the near future? 😀
+1
I've had a look in the files as we also need this functionality and it seems easy to add related products to entries / categories / etc. A little more involved to get the modal onto the product page itself. To add to categories I've done the following steps.
Edit the RelatedService.php file to have the following on line 91:
$products = [];
if (class_exists('craft\commerce\elements\Product')) {
$query = craft\commerce\elements\Product::find();
$query->relatedTo = $element;
$query->anyStatus();
$products = $query->all();
}
Then just add $products
into the $elements = array_merge(
part of the code.
I hope that helps @terryupton and hopefully this can be included in a future release @reganlawton ? Thanks.
When should have been done jsut not closed
As the title says... :-)