-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Checking stock levels on cart update, fixes issue #1190 #1221
Conversation
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoooooooooooooooooooL.
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really man
+1 |
{ | ||
public $message = '%stockable% does not have sufficient stock.'; | ||
public $stockablePath = 'stockable'; | ||
public $quantitytPath = 'quantity'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
@umpirsky This is quite important, would you mind adding a scenario or two to verify it works? |
Checking for flash message on cart update would be enough! |
@pjedrzejewski I was thinking about that. But in order to reproduce this flash message, backorders need to be disabled. Is there a way to disable them? |
We could disable it for test env, but this would require adjustments to other scenarios which assume backorders are enabled... Changing parameter in frozen container is not an option... |
@pjedrzejewski I know, but disabling it would require lot of work reworking other scenarios. Can we somehow allow disabling it dynamically? |
@umpirsky You can't do this easily via direct calls on container, you could try by introducing CompilerPass... but, why not simply create |
@@ -161,4 +161,11 @@ | |||
</property> | |||
</class> | |||
|
|||
<class name="Sylius\Bundle\CartBundle\Model\CartItem"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be on CartBundle instead of CoreBundle ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it is inventory validation constraint. Cart bundle itself does not know about inventory at all. They are connected inside CoreBundle Otherwise we would couple Cart & Inventory.
@umpirsky Shouldn't this be ( SetEnv SYMFONY__SYLIUS__INVENTORY__BACKORDERS_ENABLED true |
@stloyd Note that parameter in https://gist.github.com/umpirsky/a181b0f07dfa4bff3382#file-a-L11 is |
@umpirsky TBH. I have never used this stuff, but maybe documentation give you a hint: http://symfony.com/doc/current/cookbook/configuration/external_parameters.html#environment-variables |
@stloyd I read it before. Cannot figure why this does not work. Maybe I put setEnv on wrong place. |
@pjedrzejewski We need this fix asap ^^ |
Checking stock levels on cart update, fixes issue #1190
Shouldn't even have conflicts with the components branch. Thanks Sasha! |
Many thanks @pjedrzejewski! Yes, about components, we now want to merge some changes into our project, but want to avoid merging components for some time. Can you give any advice on this? |
Would cherry pick work? |
I guess, not sure how complicate will it be to merge components later. I gues no need to care. |
Components are only namespace changes, but I understand it may be annoying to upgrade at specific stage of the project... I'll try to figure some solution for you (except tagging a release) before merging components. |
Fixes #1190.