Skip to content

Commit

Permalink
OP-291: Replicate wishlist selection logic from product list on produ…
Browse files Browse the repository at this point in the history
…ct details view
  • Loading branch information
hmfilar committed Jul 30, 2024
1 parent be4dc0a commit 516c2bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/Resources/assets/shop/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import './handleEditWishlistModal';
import { WishlistVariantButton } from './WishlistVariantButton';
import { WishlistVariantPrice } from './WishlistVariantPrice';


const WishlistVariantElements = [...document.querySelectorAll('[data-bb-toggle="wishlist-variant"]')];
export const WishlistVariantButtonList = WishlistVariantElements.map(button => new WishlistVariantButton(button).init());

Expand Down
11 changes: 2 additions & 9 deletions src/Resources/views/Product/Show/_addToCart.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,14 @@
'form': form
}) }}

{{ form_widget(form.wishlists) }}

<div class="bb-add-to-cart-container">
<button type="submit" class="primary ui icon labeled button bb-wishlist-button"
{{ sylius_test_html_attribute('add-to-cart-button') }}>
<i class="cart icon"></i>
{{ 'sylius.ui.add_to_cart'|trans }}
</button>
<button id="{{ form.addToWishlist.vars.id }}" name="{{ form.addToWishlist.vars.full_name }}"
class="{{ form.addToWishlist.vars.attr.class }} ui icon labeled button bb-wishlist-button"
data-bb-toggle="wishlist-variant"
{{ sylius_test_html_attribute('wishlist-add-variant') }}>
<i class="heart icon"></i>
{{ form.addToWishlist.vars.label|trans }}
</button>

{% include '@BitBagSyliusWishlistPlugin/Common/_addToWishlist.html.twig' %}
</div>
{{ form_row(form._token) }}
{{ form_end(form, {'render_rest': false}) }}
Expand Down

0 comments on commit 516c2bb

Please sign in to comment.