Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Verbb Gift Voucher #20

Closed
marc524 opened this issue Feb 11, 2019 · 2 comments
Closed

Issues with Verbb Gift Voucher #20

marc524 opened this issue Feb 11, 2019 · 2 comments

Comments

@marc524
Copy link

marc524 commented Feb 11, 2019

When using Verbb's Gift Voucher plugin, Vouchers are available in commerce_purchasables, but are not in commerce_variants. As such, the query returns NULL for the ID and SKU. This really messes up the widget.

My solution right now is to just exclude any item the returns a NULL ID. This actually gives me what I want the most anyway, as I just want to know what the actual top selling products are and exclude Gift Vouchers from that display.

Change Line 84 of ProductsTop.php from

->where(['orders.orderStatusId' => $this->orderStatusId]);

to

->andWhere(['orders.orderStatusId' => $this->orderStatusId])
->andWhere(['not', ['variants.productId' => null]]);

I could see this also being an issue with Digital Products, as those products don't use Variants either, although I haven't tested it.

@bymayo
Copy link
Owner

bymayo commented Feb 12, 2019

@marc524 Thanks for letting me know about this. I'll test that line and merge. If you want to submit a pull request you can do that also with the fix.

@bymayo
Copy link
Owner

bymayo commented May 14, 2019

@marc524 Fixed in latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants