richardhj / contao-isotope_simple_stockmanagement

Simple stock management for Isotope eCommerce
8 stars 8 forks source link

Disabeling a Product does not work #2

Closed SamueL370 closed 7 years ago

SamueL370 commented 7 years ago

Hey, at first I would like to say thank you for developing this extension, because for me it is necessary to maintain my webshop, or at least it makes maintainance a lot easier.

And here is my problem:

After installation everything worked fine: I can enable the stock option and see the current quantity. But as soon as I try to enable the "disable products automatically" function (or wthatever it is called) in the producttype menu, contao shows me an error message after I have ordered (after clicking the order button) the last available product in the webshop (if there are still one or two products in advantage it works fine). producttype quantity That is the error message:

Fatal error: Uncaught exception LogicException with message The model instance has been detached and cannot be saved thrown in system\modules\core\library\Contao\Model.php on line 434
#0 system\modules\isotope_simple_stockmanagement\src\Isotope\SimpleStockmanagement\Hooks.php(211): Contao\Model->save()
#1 system\modules\isotope\library\Isotope\Model\ProductCollection\Order.php(229): Isotope\SimpleStockmanagement\Hooks->updateStockPostCheckout(Object(Isotope\Model\ProductCollection\Order), Array)
#2 system\modules\isotope\library\Isotope\Model\Payment\Cash.php(39): Isotope\Model\ProductCollection\Order->checkout()
#3 system\modules\isotope\library\Isotope\Module\Checkout.php(163): Isotope\Model\Payment\Cash->processPayment(Object(Isotope\Model\ProductCollection\Order), Object(Isotope\Module\Checkout))
#4 system\modules\core\modules\Module.php(287): Isotope\Module\Checkout->compile()
#5 system\modules\isotope\library\Isotope\Module\Module.php(112): Contao\Module->generate()
#6 system\modules\isotope\library\Isotope\Module\Checkout.php(107): Isotope\Module\Module->generate()
#7 system\modules\core\elements\ContentModule.php(59): Isotope\Module\Checkout->generate()
#8 system\modules\core\library\Contao\Controller.php(484): Contao\ContentModule->generate()
#9 system\modules\core\modules\ModuleArticle.php(213): Contao\Controller::getContentElement(Object(Contao\ContentModel), 'main')
#10 system\modules\core\modules\Module.php(287): Contao\ModuleArticle->compile()
#11 system\modules\core\modules\ModuleArticle.php(67): Contao\Module->generate()
#12 system\modules\core\library\Contao\Controller.php(417): Contao\ModuleArticle->generate(false)
#13 system\modules\core\library\Contao\Controller.php(277): Contao\Controller::getArticle(Object(Contao\ArticleModel), false, false, 'main')
#14 system\modules\core\pages\PageRegular.php(133): Contao\Controller::getFrontendModule('0', 'main')
#15 system\modules\core\controllers\FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
#16 index.php(20): Contao\FrontendIndex->run()
#17 {main}

Is there a solution for this problem? Thank you very much for your help!

Greetings from Austria, Samuel

richardhj commented 7 years ago

Hi Samuel, thanks for reporting! What are the versions of Isotope and Contao installed?

SamueL370 commented 7 years ago

Contao is installed on version: 3.5.15 And Isotope on version: 2.4.0-beta1

richardhj commented 7 years ago

For reference: isotope/core#1756

richardhj commented 7 years ago

Please install the master branch and test it.

SamueL370 commented 7 years ago

Now everything works perfectly. Thank you for fixing the issue.