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

Feature/mul 185 #205

Merged
merged 2 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions features/adding_wishlist_product_to_cart.feature
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,17 @@ Feature: Adding wishlist product to cart
And I select 4 quantity of "Jack Daniels Gentleman" product
And I add my wishlist products to cart
Then I should be notified that "Jack Daniels Gentleman" does not have sufficient stock

@ui
Scenario: Adding more than available in stock wishlist products to cart
Given the store has a product "Jack Daniels Gentleman" priced at "$10.00"
And all store products appear under a main taxonomy
And the store has a product "Bushmills Black Bush Whiskey" priced at "$230.00"
And there is 1 units of product "Bushmills Black Bush Whiskey" available in the inventory
And the "Bushmills Black Bush Whiskey" product is tracked by the inventory
And I have these products in my wishlist
When I go to the wishlist page
And I select 6 quantity of "Bushmills Black Bush Whiskey" product
And I check "Bushmills Black Bush Whiskey"
And I add selected products to cart
Then I should be notified that "Bushmills Black Bush Whiskey" does not have sufficient stock
2 changes: 2 additions & 0 deletions src/Form/Type/AddProductsToCartType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Valid;

final class AddProductsToCartType extends AbstractType
{
Expand Down Expand Up @@ -56,6 +57,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void

$form
->add('cartItem', AddToCartType::class, [
'constraints'=> new Valid(),
'label' => false,
'required' => false,
'product' => $wishlistProduct->getProduct(),
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/bitbag-wishlist-shop.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading