This widget represents the wishlist of a logged in user.
products |
Returns the array of products available in wishlist of user.
|
---|
remove_from_wishlist | This provides the functionality of deleting a product from user wish list. Product id is passed as a argument in this function. |
---|---|
move_wishlist_to_cart | This provides the functionality of moving or adding a product into cart from wish list of the user. |
<h3>{{ms.filters.translate('My Wishlist')}}</h3>
<ms-userWishlist>
<template v-if="!wishlistData.length && !loading">
<h2>{{ms.filters.translate('No Wishlist Item Found')}}</h2>
</template>
<template v-if="wishlistData.length && !loading">
<template v-for="product in wishlistData">
<div v-if="product && product.publish != 0">
<w-product-grid-item :product="product"></w-product-grid-item>
<button role="button" v-if="product._id"
@click="remove_from_wishlist(product._id,1)">
{{ms.filters.translate('Remove from Wishlist')}}
</button>
</div>
</template>
</template>
</ms-userWishlist>
<div ms-widget="ms.userWishlist" data-ng-if="ms.user.isLoggedIn">
<h2>WishList</h2>
<div ng-if="products.length">
<div ng-repeat="product in products">
<table>
<tr>
<td style="padding:10px;padding-left:20px">
<h2>{{product.name}}</h2>
<h5>
<b>Product Code:</b>
{{product.sku | uppercase}}
</h5>
<div ng-if="product.seller" ms-widget="ms.seller_info_new">
<h5><b>Sold By:</b> {{seller.title}}</h5>
</div>
<h1>{{product.price|msCurrency}}</h1>
<br>
<a style="padding:5px;border:1px solid black"
data-ng-click="move_wishlist_to_cart(product)">
Add to Cart
</a>
<a style="padding:5px;border:1px solid black"
data-ng-click="remove_from_wishlist(product._id)">
Remove from Wishlist
</a>
</td>
</tr>
</table><br>
</div>
</div>
<div ng-if="products.length==0">
<p>No product exist in wishlist.</p>
</div>
</div>
<div data-ng-if="!ms.user.isLoggedIn">
<h2>WishList</h2>
<p>No user is logged in.</p>
</div