Inhalte aufrufen

How to create a clear cart button?

6.2.5 anfragen fehler update

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
1 Antwort zu diesem Thema

#1 Guest_Ez._*

Guest_Ez._*
  • Guests

Geschrieben: 15 October 2017 - 10:53

Hello!

 

I'm new to SmartStore.NET. I’m working on a project based on SmartStore.Net 2.6 and I’m trying to create a clear cart button in the Shopping Cart page. I replaced the checkbox whit a button to delete the item in the Shopping Cart:

 

<a class="remove ajax-cart-link"

       href="#"

    rel="nofollow"

       data-href='@Url.Action("DeleteCartItem", "ShoppingCart", new { cartItemId = item.Id })'

       data-name="@item.ProductName"

       data-type="cart"

       data-action="remove"

       title='@T("Common.Remove")'>

       <i class="fa fa-trash-o"></i>

</a>

 

But I can’t figure out how to create a button to remove all items from the Shopping Cart whit one click.

Any help would be appreciated.



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 16 October 2017 - 11:43

It's not possible out of the box. You have to add a new action method to ShoppingCartController that deletes all items, not only one.


Marcus Gesing

Smartstore AG



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: 6.2.5, anfragen, fehler, update