Problem/Motivation

In the /cart page, there is an option to remove a product from cart. Add the ability to remove the product from cart ajaxifically.

Proposed resolution

  • Create a sub module, say dc_ajax_add_cart_views, and it will provide the Views integrations
  • The sub module is going to provide an ajax remove button (this issue) and ajax update cart button #2910741: Ajaxify the Update cart button
  • Write a Views field that will inherit most of the code of commerce_order_item_remove_button
  • Ajaxify the submit button, so that upon clicking, the View itself is going to be refreshed/reloaded/re-rendered
  • The ajaxify submit button should also refresh the cart block (if present on the same page)

Remaining tasks

Test cases:

Test case 1:

  • Add two different products in cart, say Prod 1, Prod 2
  • Click "Remove" button beside Prod 1
  • Check if Prod 1 has been removed from cart
  • Check if Prod 2 is still present.
  • Check if quantity of Prod 2 is still same

Test case 2:

  • Check if the "Remove" button is really ajaxified. Refer AjaxAddCartTest::testAjaxAddCartForm()

User interface changes

Not yet decided.

API changes

Not yet decided.

Data model changes

N/A

CommentFileSizeAuthor
cart-remove.png64.44 KBsubhojit777
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

subhojit777 created an issue. See original summary.

subhojit777’s picture

Issue summary: View changes
subhojit777’s picture

Issue summary: View changes
subhojit777’s picture

Issue summary: View changes

  • subhojit777 committed 0d2199b on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
  • subhojit777 committed 13d3fba on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed 2d68a2f on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed 7c2ac04 on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed a78a4bb on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed c9b2238 on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed ccd1067 on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed f23ded2 on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed f313938 on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
  • subhojit777 committed ff3b538 on 8.x-1.x
    Issue #2910740 by subhojit777: Ajaxify the Remove from cart button
    
    -...
subhojit777’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.