@inject ('wishListHelper', 'Webkul\Customer\Helpers\Wishlist') {!! view_render_event('bagisto.shop.products.wishlist.before') !!} @auth('customer') @php /* search wishlist on the basis of product's id so that wishlist id can be catched */ $wishlist = $wishListHelper->getWishlistProduct($product); /* link making */ $href = isset($route) ? $route : ($wishlist ? route('customer.wishlist.remove', $wishlist->id) : route('customer.wishlist.add', $product->product_id)); /* method */ $method = isset($route) ? 'POST' : ( $wishlist ? 'DELETE' : 'POST' ); /* is confirmation needed */ $isConfirm = isset($route) ? 'true' : 'false'; /* title */ $title = $wishlist ? __('velocity::app.shop.wishlist.remove-wishlist-text') : __('velocity::app.shop.wishlist.add-wishlist-text'); @endphp @if (isset($text)) {!! $text !!} @endif @endauth @guest('customer')
@csrf
@endauth {!! view_render_event('bagisto.shop.products.wishlist.after') !!}