Hi,

After upgrading I have a problem removing products from the ajax cart block. First time it seems to work fine, but the second time it doesn't using ajax.

First time the link for removing images looks like this:
<a class="use-ajax ajax-processed" href="/remove-product/nojs/91">Remove</a>

Second time it seems to be missing the "ajax-processed" class:
<a class="use-ajax" href="/remove-product/nojs/90">Remove</a>

Before the update I could also trigger a javascript function in dc_ajax_add_cart.js like this:

$('.ajax-shopping-cart-table', context).once('foo', function() {
console.log("do something");
});

But that only triggers on initial load and not after the cart has been refreshed, even though the cart html has been rebuilt and foo-processed is missing from ajax-shopping-cart-table.

Anyone knows whats going on?

Best regards,
Mats

Comments

matsjacobsson created an issue. See original summary.

subhojit777’s picture

Version: 7.x-2.0 » 7.x-2.x-dev

Sorry, can you please downgrade the module. Seems like I have not tested 2.x version properly. I am currently writing tests #2568855: Write tests for this module.

subhojit777’s picture

Status: Active » Needs work

Was able to replicate the problem today.

  • subhojit777 committed c42ded0 on 7.x-2.x
    Issue #2572529: Remove from cart only uses Ajax every second time
    
subhojit777’s picture

Status: Needs work » Fixed

@matsjacobsson Can you try the latest 2.x dev release. I have tested in my local and looks like the problem got fixed. I will roll out a beta release of 2.x

Status: Fixed » Closed (fixed)

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