Closed rmjohn closed 2 years ago
You wrote version 1.0.0, can you please try with the latest version 1.2.6
Hi I put the latest version , but I am getting an error when trying to add a product to order via magento admin: Fatal error: Uncaught TypeError: Return value of C4B\FreeProduct\Observer\ResetGiftItems::removeDeletedItemsFromQuoteItems() must be an instance of C4B\FreeProduct\Observer\void, none returned in /var/www/magento2/app/code/C4B/FreeProduct/Observer/ResetGiftItems.php on line 174
Hello, is your php version above 7.1?
Hi , my local version I'm testing on is php version 7.0.16 . Php version on server is 7.1.32. Before i deploy to server , is there any way to test this on 7.0?
Php versions below 7.1 are not supported unfortunately.
But if you are only testing if the module works, then removing the : void
from any methods should work.
Hello, I tested the new version and the same issue is there while creating orders via admin panel.(see atached image) Do you know how this can be fixed?
Adding products through storefront works well , it is only for orders created via admin.
Ok, I will have a look into it. Currently I don't have any solution
Thank you @domeglic . Please do update if you find something. Thanks
Hi @domeglic , were you able to replicate this issue?
Hi @domeglic
Same problem here. It seems that $quote->getItems() is always null for admin quotes so the ResetGiftItems observer never remove the gift items.
$quote->getItemsCollection() contains the items but when i use it instead of getItems() the frontend quotes start to be weird (duplicate quantity for non free items)
If you have any idea...
Magento has weird behavior with getItems and getItemsCollection, one would assume they are the same but are actually not. Especially when adding to cart.
I haven't had the chance to look into it yet.
You need change $quote->getItems() to $quote->getItemsCollection()->getItems(). i create a pr to resolve this bug #23 .
Preconditions
Settings / Sale Rules
Steps to reproduce
Expected result
Actual result