diff --git a/spec/Controller/Action/AddProductVariantToWishlistActionSpec.php b/spec/Controller/Action/AddProductVariantToWishlistActionSpec.php
index d9fdc3cc..bac482a1 100644
--- a/spec/Controller/Action/AddProductVariantToWishlistActionSpec.php
+++ b/spec/Controller/Action/AddProductVariantToWishlistActionSpec.php
@@ -83,7 +83,7 @@ public function it_handles_the_request_and_persist_new_wishlist_for_logged_shop_
$wishlist->hasProductVariant($productVariant)->willReturn(false);
$wishlistProductFactory->createForWishlistAndVariant($wishlist, $productVariant)->willReturn($wishlistProduct);
$translator->trans('bitbag_sylius_wishlist_plugin.ui.added_wishlist_item')->willReturn('Product has been added to your wishlist.');
- $urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', ['wishlistId' => 1])->willReturn('/wishlist/1');
+ $urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', ['wishlistId' => 1])->willReturn('/wishlist/1');
$wishlist->addWishlistProduct($wishlistProduct)->shouldBeCalled();
$wishlistRepository->add($wishlist)->shouldBeCalled();
@@ -117,7 +117,7 @@ public function it_handles_the_request_and_persist_new_wishlist_for_anonymous_us
$wishlist->hasProductVariant($productVariant)->willReturn(false);
$wishlistProductFactory->createForWishlistAndVariant($wishlist, $productVariant)->willReturn($wishlistProduct);
$translator->trans('bitbag_sylius_wishlist_plugin.ui.added_wishlist_item')->willReturn('Product has been added to your wishlist.');
- $urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', ['wishlistId' => 1])->willReturn('/wishlist/1');
+ $urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', ['wishlistId' => 1])->willReturn('/wishlist/1');
$wishlist->addWishlistProduct($wishlistProduct)->shouldBeCalled();
$wishlistRepository->add($wishlist)->shouldBeCalled();
diff --git a/spec/Controller/Action/RemoveProductFromWishlistActionSpec.php b/spec/Controller/Action/RemoveProductFromWishlistActionSpec.php
index c70c7dcc..6fbc0f10 100644
--- a/spec/Controller/Action/RemoveProductFromWishlistActionSpec.php
+++ b/spec/Controller/Action/RemoveProductFromWishlistActionSpec.php
@@ -81,7 +81,7 @@ function it_handles_request_and_redirects_to_wishlist(
$wishlist->getWishlistProducts()->willReturn(new ArrayCollection([$wishlistProduct->getWrappedObject()]));
$wishlistProduct->getProduct()->willReturn($product);
$translator->trans('bitbag_sylius_wishlist_plugin.ui.removed_wishlist_item')->willReturn('Product has been removed from your wishlist.');
- $urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_list_products')->willReturn('/wishlist');
+ $urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_products')->willReturn('/wishlist');
$wishlistProductManager->remove($wishlistProduct)->shouldBeCalled();
$wishlistProductManager->flush()->shouldBeCalled();
diff --git a/src/Controller/Action/AddProductToSelectedWishlistAction.php b/src/Controller/Action/AddProductToSelectedWishlistAction.php
index a247ac3e..3c48ebb5 100644
--- a/src/Controller/Action/AddProductToSelectedWishlistAction.php
+++ b/src/Controller/Action/AddProductToSelectedWishlistAction.php
@@ -85,7 +85,7 @@ public function __invoke(int $wishlistId, int $productId): Response
$session->getFlashBag()->add('success', $this->translator->trans('bitbag_sylius_wishlist_plugin.ui.added_wishlist_item'));
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
diff --git a/src/Controller/Action/AddProductVariantToWishlistAction.php b/src/Controller/Action/AddProductVariantToWishlistAction.php
index 2940af2f..3087d633 100644
--- a/src/Controller/Action/AddProductVariantToWishlistAction.php
+++ b/src/Controller/Action/AddProductVariantToWishlistAction.php
@@ -74,7 +74,7 @@ public function __invoke(int $wishlistId, Request $request): Response
}
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
diff --git a/src/Controller/Action/AddWishlistToUserAction.php b/src/Controller/Action/AddWishlistToUserAction.php
index 86c7fc1d..ed200beb 100644
--- a/src/Controller/Action/AddWishlistToUserAction.php
+++ b/src/Controller/Action/AddWishlistToUserAction.php
@@ -87,6 +87,6 @@ public function __invoke(Request $request): Response
);
}
- return new RedirectResponse($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_list_wishlists'));
+ return new RedirectResponse($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_wishlists'));
}
}
diff --git a/src/Controller/Action/BaseWishlistProductsAction.php b/src/Controller/Action/BaseWishlistProductsAction.php
index fb93f983..c609eb88 100644
--- a/src/Controller/Action/BaseWishlistProductsAction.php
+++ b/src/Controller/Action/BaseWishlistProductsAction.php
@@ -67,7 +67,7 @@ public function __invoke(int $wishlistId, Request $request): Response
{
if ($this->createForm($wishlistId) == null) {
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_list_wishlists'));
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_wishlists'));
} else {
$form = $this->createForm($wishlistId);
$form->handleRequest($request);
@@ -76,7 +76,7 @@ public function __invoke(int $wishlistId, Request $request): Response
$this->handleCommand($form);
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
@@ -91,7 +91,7 @@ public function __invoke(int $wishlistId, Request $request): Response
}
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
diff --git a/src/Controller/Action/CleanWishlistAction.php b/src/Controller/Action/CleanWishlistAction.php
index c698b58d..09e8b375 100644
--- a/src/Controller/Action/CleanWishlistAction.php
+++ b/src/Controller/Action/CleanWishlistAction.php
@@ -62,7 +62,7 @@ public function __invoke(int $wishlistId, Request $request): Response
$session->getFlashBag()->add('success', $this->translator->trans('bitbag_sylius_wishlist_plugin.ui.clear_wishlist'));
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
diff --git a/src/Controller/Action/ExportSelectedProductsToCsvAction.php b/src/Controller/Action/ExportSelectedProductsToCsvAction.php
index ce34c21b..f7feea1d 100644
--- a/src/Controller/Action/ExportSelectedProductsToCsvAction.php
+++ b/src/Controller/Action/ExportSelectedProductsToCsvAction.php
@@ -89,7 +89,7 @@ public function __invoke(int $wishlistId, Request $request): Response
}
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
@@ -121,7 +121,7 @@ private function exportSelectedWishlistProductsToCsv(FormInterface $form): Respo
$session->getFlashBag()->add('error', $this->translator->trans($e->getMessage()));
- return new RedirectResponse($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_list_products'));
+ return new RedirectResponse($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_products'));
}
return $this->returnCsvFile($file);
diff --git a/src/Controller/Action/RemoveProductFromWishlistAction.php b/src/Controller/Action/RemoveProductFromWishlistAction.php
index d7b8d298..bc6da945 100644
--- a/src/Controller/Action/RemoveProductFromWishlistAction.php
+++ b/src/Controller/Action/RemoveProductFromWishlistAction.php
@@ -79,6 +79,6 @@ public function __invoke(Request $request): Response
$session->getFlashBag()->add('success', $this->translator->trans('bitbag_sylius_wishlist_plugin.ui.removed_wishlist_item'));
- return new RedirectResponse($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_list_products'));
+ return new RedirectResponse($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_products'));
}
}
diff --git a/src/Controller/Action/RemoveProductVariantFromWishlistAction.php b/src/Controller/Action/RemoveProductVariantFromWishlistAction.php
index 8251b551..6e2722f5 100644
--- a/src/Controller/Action/RemoveProductVariantFromWishlistAction.php
+++ b/src/Controller/Action/RemoveProductVariantFromWishlistAction.php
@@ -89,7 +89,7 @@ public function __invoke(
$session->getFlashBag()->add('success', $this->translator->trans('bitbag_sylius_wishlist_plugin.ui.removed_wishlist_item'));
return new RedirectResponse(
- $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist', [
+ $this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_show_chosen_wishlist', [
'wishlistId' => $wishlistId,
])
);
diff --git a/src/Controller/Action/ShowChosenWishlistAction.php b/src/Controller/Action/ShowChosenWishlistAction.php
index 918f0095..13bf28dd 100644
--- a/src/Controller/Action/ShowChosenWishlistAction.php
+++ b/src/Controller/Action/ShowChosenWishlistAction.php
@@ -91,7 +91,7 @@ public function __invoke(string $wishlistId, Request $request): Response
);
}
- return new RedirectResponse($this->urlGenerator->generate("bitbag_sylius_wishlist_plugin_shop_wishlist_list_wishlists"));
+ return new RedirectResponse($this->urlGenerator->generate("bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_wishlists"));
}
private function createForm(WishlistInterface $wishlist): FormInterface
diff --git a/src/Controller/Action/UpdateWishlistNameAction.php b/src/Controller/Action/UpdateWishlistNameAction.php
index 29c8a575..5e5bf295 100644
--- a/src/Controller/Action/UpdateWishlistNameAction.php
+++ b/src/Controller/Action/UpdateWishlistNameAction.php
@@ -73,6 +73,6 @@ public function __invoke(Request $request): Response
$this->translator->trans('bitbag_sylius_wishlist_plugin.ui.wishlist_name_already_exists')
);
}
- return new Response($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_wishlist_list_products'));
+ return new Response($this->urlGenerator->generate('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_list_products'));
}
}
diff --git a/src/Controller/OrderItemController.php b/src/Controller/OrderItemController.php
index 96648318..ac651e28 100644
--- a/src/Controller/OrderItemController.php
+++ b/src/Controller/OrderItemController.php
@@ -74,7 +74,7 @@ public function addAction(Request $request): Response
return new Response($this->generateUrl('sylius_shop_homepage'));
}
- return new Response($this->generateUrl('bitbag_sylius_wishlist_plugin_shop_wishlist_add_product_variant', [
+ return new Response($this->generateUrl('bitbag_sylius_wishlist_plugin_shop_locale_locale_wishlist_add_product_variant', [
'wishlistId' => $wishlist->getId(),
'variantId' => $variant->getId(),
]));
diff --git a/src/Resources/assets/shop/js/handleAddAnotherWishlistModal.js b/src/Resources/assets/shop/js/handleAddAnotherWishlistModal.js
index b6c7dbb5..c2cf039c 100644
--- a/src/Resources/assets/shop/js/handleAddAnotherWishlistModal.js
+++ b/src/Resources/assets/shop/js/handleAddAnotherWishlistModal.js
@@ -20,7 +20,7 @@ const setWishlistModal = () => {
const form = document.querySelector(`#${wishlistFormName}`);
const formValue = form.querySelector(`#${wishlistFormName}_name`);
- const url = '/wishlists/create';
+ const url = document.querySelector("[data-bb-wishlist-add-url]").dataset.bbWishlistAddUrl;
const formData = new FormData(form);
const csrfToken = document.querySelector("[data-bb-csrf]").dataset.bbCsrf;
diff --git a/src/Resources/config/routing.yml b/src/Resources/config/routing.yml
index 0b40037c..96c7323c 100644
--- a/src/Resources/config/routing.yml
+++ b/src/Resources/config/routing.yml
@@ -1,115 +1,11 @@
-bitbag_sylius_wishlist_plugin_shop_wishlist_list_products:
- path: /wishlist
- methods: [GET]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.list_wishlist_products
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_add_products:
- path: /wishlist/{wishlistId}/products
- methods: [POST]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.add_products_to_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_add_product:
- path: /wishlist/add/{productId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.add_product_to_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_remove_product:
- path: /wishlist/remove/{productId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.remove_product_from_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_remove_selected_products:
- path: /wishlist/{wishlistId}/products/delete
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.remove_selected_products_from_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_add_product_variant:
- path: /wishlist/{wishlistId}/add/variant/{variantId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.add_product_variant_to_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_add_selected_products:
- path: /wishlist/{wishlistId}/products/add
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.add_selected_products_to_cart
-
-bitbag_sylius_wishlist_plugin_shop_wishlsit_export_selected_products_to_csv:
- path: /wishlist/{wishlistId}/csv/export
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.export_selected_products_to_csv
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_import_from_csv:
- path: /wishlist/csv/import
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.import_from_csv
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_remove_product_variant:
- path: /wishlist/{wishlistId}/remove/variant/{variantId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.remove_product_variant_from_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_render_header_template:
- path: /wishlist/header-template
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.render_header_template
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_export_to_pdf:
- path: /wishlist/{wishlistId}/export/pdf
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.export_wishlist_to_pdf_action
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_clean:
- path: /wishlist/clear/{wishlistId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.clean_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_create_new_wishlist:
- path: /wishlists/create
- methods: [GET, POST, DELETE]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.create_new_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_remove_wishlist:
- path: /wishlists/{id}/remove
- methods: [GET, POST, DELETE]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.wishlist::deleteAction
- _sylius:
- csrf_protection: false
- redirect:
- route: bitbag_sylius_wishlist_plugin_shop_wishlist_list_wishlists
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_edit_wishlist_name:
- path: /wishlists/{id}/edit
- methods: [GET, PUT, POST]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.update_wishlist_name_action
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_list_wishlists:
- path: /wishlists
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.list_wishlists
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_show_chosen_wishlist:
- path: /wishlists/{wishlistId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.show_chosen_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_add_product_to_selected_wishlist:
- path: /wishlist/{wishlistId}/add/{productId}
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.add_product_to_selected_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_copy_selected_products_to_other_wishlist:
- path: /wishlists/{wishlistId}/copy/{destinedWishlistId}
- methods: [ POST ]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.copy_selected_products_to_other_wishlist
-
-bitbag_sylius_wishlist_plugin_shop_wishlist_add_wishlist_to_user:
- path: /wishlists/{id}/save-wishlist
- methods: [GET, PUT, POST]
- defaults:
- _controller: bitbag_sylius_wishlist_plugin.controller.action.add_wishlists_to_user
+bitbag_sylius_wishlist_plugin_shop_no_prefix:
+ resource: "@BitBagSyliusWishlistPlugin/Resources/config/routing/shop.yml"
+ name_prefix: 'bitbag_sylius_wishlist_plugin_shop_'
+
+bitbag_sylius_wishlist_plugin_shop:
+ resource: "@BitBagSyliusWishlistPlugin/Resources/config/routing/shop.yml"
+ name_prefix: 'bitbag_sylius_wishlist_plugin_shop_locale_'
+ prefix: /{_locale}
+ requirements:
+ _locale: ^[a-z]{2}(?:_[A-Z]{2})?$
+
diff --git a/src/Resources/config/routing/shop.yml b/src/Resources/config/routing/shop.yml
new file mode 100644
index 00000000..02d6d228
--- /dev/null
+++ b/src/Resources/config/routing/shop.yml
@@ -0,0 +1,115 @@
+wishlist_list_products:
+ path: /wishlist
+ methods: [GET]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.list_wishlist_products
+
+wishlist_add_products:
+ path: /wishlist/{wishlistId}/products
+ methods: [POST]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.add_products_to_wishlist
+
+wishlist_add_product:
+ path: /wishlist/add/{productId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.add_product_to_wishlist
+
+wishlist_remove_product:
+ path: /wishlist/remove/{productId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.remove_product_from_wishlist
+
+wishlist_remove_selected_products:
+ path: /wishlist/{wishlistId}/products/delete
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.remove_selected_products_from_wishlist
+
+wishlist_add_product_variant:
+ path: /wishlist/{wishlistId}/add/variant/{variantId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.add_product_variant_to_wishlist
+
+wishlist_add_selected_products:
+ path: /wishlist/{wishlistId}/products/add
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.add_selected_products_to_cart
+
+wishlsit_export_selected_products_to_csv:
+ path: /wishlist/{wishlistId}/csv/export
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.export_selected_products_to_csv
+
+wishlist_import_from_csv:
+ path: /wishlist/csv/import
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.import_from_csv
+
+wishlist_remove_product_variant:
+ path: /wishlist/{wishlistId}/remove/variant/{variantId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.remove_product_variant_from_wishlist
+
+wishlist_render_header_template:
+ path: /wishlist/header-template
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.render_header_template
+
+wishlist_export_to_pdf:
+ path: /wishlist/{wishlistId}/export/pdf
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.export_wishlist_to_pdf_action
+
+wishlist_clean:
+ path: /wishlist/clear/{wishlistId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.clean_wishlist
+
+wishlist_create_new_wishlist:
+ path: /wishlists/create
+ methods: [GET, POST, DELETE]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.create_new_wishlist
+
+wishlist_remove_wishlist:
+ path: /wishlists/{id}/remove
+ methods: [GET, POST, DELETE]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.wishlist::deleteAction
+ _sylius:
+ csrf_protection: false
+ redirect:
+ route: wishlist_list_wishlists
+
+wishlist_edit_wishlist_name:
+ path: /wishlists/{id}/edit
+ methods: [GET, PUT, POST]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.update_wishlist_name_action
+
+wishlist_list_wishlists:
+ path: /wishlists
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.list_wishlists
+
+wishlist_show_chosen_wishlist:
+ path: /wishlists/{wishlistId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.show_chosen_wishlist
+
+wishlist_add_product_to_selected_wishlist:
+ path: /wishlist/{wishlistId}/add/{productId}
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.add_product_to_selected_wishlist
+
+wishlist_copy_selected_products_to_other_wishlist:
+ path: /wishlists/{wishlistId}/copy/{destinedWishlistId}
+ methods: [ POST ]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.copy_selected_products_to_other_wishlist
+
+wishlist_add_wishlist_to_user:
+ path: /wishlists/{id}/save-wishlist
+ methods: [GET, PUT, POST]
+ defaults:
+ _controller: bitbag_sylius_wishlist_plugin.controller.action.add_wishlists_to_user
diff --git a/src/Resources/views/Common/_addToWishlist.html.twig b/src/Resources/views/Common/_addToWishlist.html.twig
index 652da97a..da9b33b7 100644
--- a/src/Resources/views/Common/_addToWishlist.html.twig
+++ b/src/Resources/views/Common/_addToWishlist.html.twig
@@ -1,7 +1,7 @@
{% if app.user %}
{% if findAllByShopUserAndToken(app.user)|length < 2 %}
{% for wishlist in findAllByShopUserAndToken(app.user) %}
{% for wishlist in findAllByAnonymousAndChannel(sylius.channel) %}
+
{{- wishlistProductsCount -}}
{% else %}
-
+
diff --git a/src/Resources/views/WishlistDetails/_collectiveActions.html.twig b/src/Resources/views/WishlistDetails/_collectiveActions.html.twig
index e9e1fee7..ca039313 100644
--- a/src/Resources/views/WishlistDetails/_collectiveActions.html.twig
+++ b/src/Resources/views/WishlistDetails/_collectiveActions.html.twig
@@ -8,13 +8,13 @@
Bulk Actions