dispositiontools / craft-commerceinsights

Get insights from Craft Commerce
Other
1 stars 1 forks source link

Error when using "Find best selling products" #3

Closed maxpdesign closed 2 years ago

maxpdesign commented 2 years ago

Hello,

I'm getting an error when I use "Find best selling products" functionality.

Screenshot 2022-08-11 at 11 06 46

Probably because it is trying to get a purchasable that has been deleted. The docs mention this scenario here: https://craftcms.com/docs/commerce/3.x/purchasables.html#purchasables-and-line-items

Is it possible that you can change the code so it uses the snapshot of the lineItem instead of the getPurchasable() method? Because the getPurchasable() method is returning null if the purchasable is deleted.

Thanks in advance!

dispositiontools commented 2 years ago

Thats a great idea. Thank you. I'll work on this.

totov commented 2 years ago

I'm getting the same issue - please let me know if I can supply any info to help diagnose and fix this.

dispositiontools commented 2 years ago

Thank you for your patience with this. I've pushed the fix with v1.0.10 I've been working on a new version for Craft4 which is more stable and with some new features.