-
-
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
[Cart][Inventory] Fix cart inventory validation #6712
[Cart][Inventory] Fix cart inventory validation #6712
Conversation
Arminek
commented
Nov 14, 2016
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Related tickets | Sylius/Sylius-Standard#135 |
License | MIT |
@@ -293,7 +293,7 @@ public function iAddQuantityOfProductsToTheCart($quantity, ProductInterface $pro | |||
|
|||
/** | |||
* @Given /^I have(?:| added) (\d+) (products "([^"]+)") (?:to|in) the cart$/ | |||
* @When /^I add(?:|ed) (\d+) (products "([^"]+)") to the cart$/ | |||
* @When /^I(?:| again) add(?:|ed) (\d+) (products "([^"]+)") to the cart$/ |
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.
This syntax just does not look right :<
public function __construct(AvailabilityCheckerInterface $availabilityChecker, CartContextInterface $cartContext) | ||
{ | ||
$this->availabilityChecker = $availabilityChecker; | ||
$this->cartContext = $cartContext; |
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.
Why?
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.
Just use $orderItem->getOrder()
.
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.
In this case Order
has not been assigned yet.
9c7b884
to
cda19fe
Compare
@@ -165,5 +165,11 @@ | |||
<argument type="service" id="form.registry" /> | |||
<tag name="form.type" alias="sylius_product_variant" /> | |||
</service> | |||
|
|||
<service id="sylius.form.type.add_cart_item" class="Sylius\Bundle\CoreBundle\Form\Type\Order\AddCartItemType"> |
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.
Let's move this to OrderBundle.
@@ -45,7 +45,7 @@ sylius_shop_cart_item_add: | |||
method: createForProduct | |||
arguments: [expr:service('sylius.repository.product').find($productId)] | |||
form: | |||
type: sylius_cart_item | |||
type: sylius_add_cart_item |
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.
sylius_add_to_cart :)
Does it also fix #6635? |
dfc3fdb
to
eaeca17
Compare
@@ -13,6 +13,8 @@ sylius: | |||
customer: | |||
currency_code: | |||
not_valid: The currency code you entered is invalid. | |||
cart_item: | |||
not_available: 'name does not have sufficient stock.' |
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.
That message seems wrong 😄
c431107
to
c5e547a
Compare
c5e547a
to
bb2a871
Compare
Great job Arek! 👍 |