Skip to content
Open
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
17 changes: 6 additions & 11 deletions doc/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ return [
```yaml
# config/packages/_sylius.yaml
imports:
...
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
...
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
```

4. (optional) Import routing in your `config/routes.yaml` file:
Expand All @@ -45,10 +45,10 @@ bitbag_sylius_wishlist_plugin:

```yaml
sylius_order:
resources:
order_item:
classes:
controller: BitBag\SyliusWishlistPlugin\Controller\OrderItemController
resources:
order_item:
classes:
controller: BitBag\SyliusWishlistPlugin\Controller\OrderItemController

```

Expand All @@ -59,11 +59,6 @@ sylius_order:
```yaml
sylius_ui:
events:
sylius.shop.layout.header.grid:
blocks:
cart:
template: "@BitBagSyliusWishlistPlugin/_cart.html.twig"
priority: 10
sylius.shop.product.index.box:
blocks:
content:
Expand Down
2 changes: 1 addition & 1 deletion spec/Controller/Action/ListWishlistProductsActionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function it_lists_wishlist_items(
$form->createView()->willReturn($formView);
$twigEnvironment
->render(
'@BitBagSyliusWishlistPlugin/WishlistDetails/index.html.twig',
'@BitBagSyliusWishlistPlugin/shop/wishlist/index.html.twig',
[
'wishlist' => $wishlist,
'form' => $formView,
Expand Down
2 changes: 1 addition & 1 deletion spec/Exporter/DomPdfWishlistExporterSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function it_returns_pdf_as_attachment(

$html = '';

$twigEnvironment->render('@BitBagSyliusWishlistPlugin/_wishlist_pdf.html.twig', [
$twigEnvironment->render('@BitBagSyliusWishlistPlugin/shop/wishlist/wishlist_pdf.html.twig', [
'title' => 'My wishlist products',
'date' => date('d.m.Y'),
'products' => $data,
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Action/ImportWishlistFromCsvAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __invoke(Request $request): Response
}

return new Response(
$this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/importWishlist.html.twig', [
$this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/shop/wishlist/import_wishlist.html.twig', [
'form' => $form->createView(),
]),
);
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Action/ListWishlistProductsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function __invoke(Request $request): Response
]);

return new Response(
$this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/WishlistDetails/index.html.twig', [
$this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/shop/wishlist/index.html.twig', [
'wishlist' => $wishlist,
'form' => $form->createView(),
]),
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Action/ShowChosenWishlistAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __invoke(string $wishlistId, Request $request): Response
$form = $this->createForm($wishlist);

return new Response(
$this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/WishlistDetails/index.html.twig', [
$this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/shop/wishlist/index.html.twig', [
'wishlist' => $wishlist,
'form' => $form->createView(),
]),
Expand Down
2 changes: 1 addition & 1 deletion src/Exporter/DomPdfWishlistExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
public function export(Collection $data): void
{
$dompdf = $this->domPdfFactory->createNewWithDefaultOptions();
$html = $this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/_wishlist_pdf.html.twig', [
$html = $this->twigEnvironment->render('@BitBagSyliusWishlistPlugin/shop/wishlist/wishlist_pdf.html.twig', [
'title' => 'My wishlist products',
'date' => date('d.m.Y'),
'products' => $data,
Expand Down
1 change: 1 addition & 0 deletions src/Form/Type/AddProductsToCartType.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
])
->add('selected', CheckboxType::class, [
'required' => false,
'label' => false,
]);
});
}
Expand Down
1 change: 1 addition & 0 deletions src/Resources/assets/shop/js/WishlistVariantPrice.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//TODO adjust this to work with the new wishlist view
export class WishlistVariantPrice {
constructor(node) {
if (node === null || !node.nodeType) throw new Error("The first parameter must be a NodeElement");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class WishlistMainCheckboxUpdater {
this.defaultConfig = {
mainCheckboxId: '#toggle-checkboxes',
checkboxesData: '[data-bb-checkboxes] input',
bulkActionsBtnClass: '.bb-colective-actions',
bulkActionsBtnClass: '.bb-collective-actions',
};
this.finalConfig = {...this.defaultConfig, ...config};
this.mainCheckbox = document.querySelector(this.finalConfig.mainCheckboxId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,4 @@
align-items: center;
justify-content: space-between;
margin: $spacer * 1.5 0 $spacer * .75;

}

.bb-wishlist-actions-import-button {
background-color: #E0E1E2 !important;
color: rgba(0, 0, 0, 0.6) !important;
}

.bb-wishlist-actions-import-button:hover {
background-color: #CACBCD !important;
color: rgba(0, 0, 0, 0.8) !important;
}
12 changes: 0 additions & 12 deletions src/Resources/assets/shop/scss/pages/wishlist-details/_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@

&-image {
grid-area: image;
width: 75%;
height: 75%;

img {
margin-bottom: 24px;
}
}

&-name {
Expand Down Expand Up @@ -76,11 +70,5 @@
align-items: center;
justify-content: center;
}

> * {
span {
color: $lightgray;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
.bb-colective-actions {
&.disabled {
opacity: .45;
pointer-events: none;
}

&.enabled {
}

.wishlist-dropdown-menu {
&__item {
.wishlist-item--button {
text-align: left;
background: #ffffff !important;
color: rgba(0, 0, 0, 0.95) !important;
width: 100%;
}

.wishlist-item--button:hover {
background: #E0E1E2 !important;
}
}

&__item:hover {
background: #ffffff !important;
.bb-dropdown {
.dropdown-item {
&:hover,
&:focus,
&:active{
background-color: transparent;
}
}
}
1 change: 1 addition & 0 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
imports:
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/services.xml" }
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/twig_hooks/**/*.yaml" }
124 changes: 124 additions & 0 deletions src/Resources/config/twig_hooks/shop/wishlist/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
sylius_twig_hooks:
hooks:
'bitbag_sylius_wishlist_plugin.wishlist.index':
content:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content':
header:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/header.html.twig"
priority: 100
form:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.header':
title:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/header/title.html.twig"
priority: 100
actions:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/header/actions.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.header.actions':
clear:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/header/actions/clear.html.twig"
priority: 100
new:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/header/actions/new.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form':
form:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections':
items:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items.html.twig"
priority: 100
actions:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections.actions':
bulk:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/bulk.html.twig"
priority: 100
global:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/global.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections.actions.global':
import:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/global/import.html.twig"
priority: 100
add_to_cart:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/global/add_to_cart.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections.actions.bulk':
add_to_cart:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/bulk/add_to_cart.html.twig"
priority: 400
remove:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/bulk/remove.html.twig"
priority: 300
copy:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/bulk/copy.html.twig"
priority: 200
download_csv:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/bulk/download_csv.html.twig"
priority: 100
download_pdf:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/actions/bulk/download_pdf.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections.items':
head:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/head.html.twig"
priority: 100
body:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections.items.head':
select_all:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/head/select_all.html.twig"
priority: 400
image:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/head/image.html.twig"
priority: 300
price:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/head/price.html.twig"
priority: 200
quantity:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/head/quantity.html.twig"
priority: 100
actions:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/head/actions.html.twig"
priority: 0

'bitbag_sylius_wishlist_plugin.wishlist.index.content.form.sections.items.body':
checkbox:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/checkbox.html.twig"
priority: 600
image:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/image.html.twig"
priority: 500
name:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/name.html.twig"
priority: 400
variant:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/variant.html.twig"
priority: 300
price:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/price.html.twig"
priority: 200
quantity:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/quantity.html.twig"
priority: 100
remove:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist/index/content/form/sections/items/body/remove.html.twig"
priority: 0
13 changes: 13 additions & 0 deletions src/Resources/config/twig_hooks/shop/wishlist/layout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sylius_twig_hooks:
hooks:
'sylius_shop.base.header.content':
wishlist_header:
template: "@BitBagSyliusWishlistPlugin/shop/wishlist_header.html.twig"
priority: 150

# TODO find the right way to extend product box's content
#sylius.shop.product.index.box:
# blocks:
# content:
# template: "@BitBagSyliusWishlistPlugin/Product/Box/_content.html.twig"
# priority: 10
9 changes: 0 additions & 9 deletions src/Resources/views/Common/_removeFromWishlist.html.twig

This file was deleted.

2 changes: 1 addition & 1 deletion src/Resources/views/Product/Box/_content.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
{% import "@SyliusShop/shared/macro/money.html.twig" as money %}

<div class="ui fluid card">
<a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}"
Expand Down
Loading