Inhalte aufrufen

How to create a clear cart button?

6.2.5 anfragen fehler update

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
  • 3034 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.


Schöne Grüße aus Düsseldorf,
Marcus Gesing




Auf dieses Thema antworten



  

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