Disable 'remove item' option for order guides only.

Jonathan Ooms
Kilo Contributor

Hi Community,

I have a question concerning the 'remove option' in the shopping cart. When I speak about the 'remove option' functionaltiy, I mean the find_real_file.png - button in the cart overview.

My problem

In this example the client ordered 1 individual catalog item and 1 Order guide. This Order guide contains 2 items, namely 'Order guide: item 1' and 'Order guide: item 2'.

I want to keep the 'remove item' option for catalog items (green) that are ordered individually, but I want to remove this 'remove item' option (red) when an order guide is ordered.

find_real_file.png

My failed efforts so far

a) Via 'Maintaining cart layout', deselecting the 'delete item' buttons does not work on the frontend and does not make a distinction between catalog items and order guides.

b)  Removing following code lines of the Angular ng-template 'large_shopping_cart_v2.html

<button class="btn btn-clear" ng-click="c.removeItem($event, item)" aria-label="${Remove Item From Cart} {{::item.name}}" title="${Remove Item} {{::item.name}}">
<i class="fa fa-times-circle btn-remove" aria-hidden="true"></i> </button>

==> This removes the 'remove option' for all items in the shopping cart, including the order guide items. 

Question

What type of code do I have to add or substract in the angular ng-template 'large_shopping_cart_v2.html' to keep the 'remove option' for individual catalog items and remove this 'remove option' when order guides are ordered?

 

If you need additional information, let me know in the comments.

 

Thanks in advance,

 

Jonathan Ooms

 

1 ACCEPTED SOLUTION

Jon Barnes
Kilo Sage

I would echo Allen's question about the user experience, but if you get past that and still want to do it, try adding this attribute to your button in the template:

ng-hide="item.order_guide"

like:

<button ng-hide="item.order_guide" ...

View solution in original post

4 REPLIES 4

Allen Andreas
Administrator
Administrator

Hi,

You also have the "clear cart" button there as well that just clears everything versus individually selecting items.

So what if a user fills out the order guide, mostly, adds it to their cart, but then decides they don't need it...now they can't remove it...so it's stuck?

Just curious on that side of things.

Unless you're keeping the clear cart button active....but then they can still remove stuff...

So are you just trying to stop them from removing items individually (for order guide items)?

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Jon Barnes
Kilo Sage

I would echo Allen's question about the user experience, but if you get past that and still want to do it, try adding this attribute to your button in the template:

ng-hide="item.order_guide"

like:

<button ng-hide="item.order_guide" ...

Jonathan Ooms
Kilo Contributor

Hi Jon and Allen,

 

Adding ' ng-hide="item.order_guide ' indeed seems to do the trick. Thank you for this anwer.

I understand your concerns for the user experience and I agree that it is not the ideal solution.

Another possible solution for me would be that if a client removes an item that is part of an order guide, that all the accesory items of this order guide are removed as well. 

So in this example ( without adding the  'ng-hide="item.order_guide ' to the Angular ng-template). The client is  currently able to remove 'order guide: item 1' or 'order guide: item 2' indivudually. 

Is there an option/way that when a client removes one of the catalog items that are part of the order guide, using the 'remove option', that the other accesory catalog items of this order guide are removed automatically?

It is really important for me that clients are not able to order only a part of the catlog items of an order guide.

Thanks in advance!

Jonathan Ooms

 

Did you ever solve this?