Ajax Shopping Cart Teaser block should be updated together with Ajax Shopping Cart List block.

If this does not happen, then the meaning is lost.

Thank you!

Comments

subhojit777’s picture

Status: Active » Closed (works as designed)

Tests carried out:

  • Added a product
  • Removed a product
  • Updated quantity of a product

In all of the tests the shopping cart block and cart teaser were getting updated by Ajax. Tests carried out in Commerce Kickstart distribution.

Could you please provide more detailed steps, with screenshots if possible.

anikitin35’s picture

Yes I did the same test. Teaser does not changed.

Please, adapt the code for using Jquery 1.10.2 :(

subhojit777’s picture

Status: Closed (works as designed) » Active
anikitin35’s picture

Yes I do.

subhojit777’s picture

Status: Active » Postponed (maintainer needs more info)

Could you please specify what changes needs to be done in the code so that it works with jquery 1.10.2

anikitin35’s picture

I'm using Jquery 1.7 now. I'm haven't problems with ajax teaser update. I'm having a problem with recalculating items in a cart. I'm having a jquery conflict after item recalculating that blocks other scripts.

anybody’s picture

Status: Postponed (maintainer needs more info) » Active

I can confirm this problem. It appears if only the teaser AJAX Cart block is used and the Full AJAX cart block is not used. It should be reproducable that way.

The reason might have to do with the AJAX commands and the non-existing wrapper elements for the full ajax cart block. But I'm not sure.

Can someone reproduce the problem with this information?

subhojit777’s picture

Status: Active » Postponed (maintainer needs more info)

It appears if only the teaser AJAX Cart block is used and the Full AJAX cart block is not used. It should be reproducable that way.

The module is supposed to work like that. The ajax libraries are associated with the main cart block. Adding the libraries both in main cart block and in teaser cart block will be redundant. Also the bug that you pointed out does not relates to the current issue. Please create a new issue for this.

peps’s picture

I can also confirm the problem.

Reproduced by enabling ajax cart teaser block but main ajax cart is disabled. Vanilla 7.39.

I think there is no problem re-adding the libraries for both blocks, D7 should be able to manage if same library is added afaik. Correct me if I'm wrong.

anybody’s picture

+1 @#9, we'd also need that and the module is quite useful without the main block.

mchamps’s picture

I have the same issue when I click on add to cart, I see the confirmation message but the AJAX shopping cart teaser does not update it's content, you need to refresh the page to see the current cart content.

I use commerce_kickstart 7.x-2.28, dc_ajax_add_cart 7.x-2.1
I only display AJAX shopping cart teaser

subhojit777’s picture

Please create a new issue for #7/#9/#11.

subhojit777’s picture

If you only want to get ajax teaser cart then you may try Commerce Ajax Cart

anybody’s picture

@subhojit777,

thank you very much for your reply. How shell we proceed here? We can create a separate issue as feature request, but if you are not willing to add this feature as described that won't change anything.

Are you interested in such an addition despite your answer in #8?
Otherwise it would be better if we create a copy of your module and add that feature there. Commerce Ajax Cart is no solution, at least in my case.

Finally I'd hope to add that feature because it seems quite simple and a good addition to the current features.

Thank you very much.

subhojit777’s picture

but if you are not willing to add this feature as described that won't change anything

I never said that I'm not interested. I am asking not to continue this conversation in this issue, because the problem you and others have mentioned does not relates to the issue summary. You can see #2, #3, #4, #6, do they relate to the problem you are mentioning.

Are you interested in such an addition despite your answer in #8?
Otherwise it would be better if we create a copy of your module and add that feature there. Commerce Ajax Cart is no solution, at least in my case.

Commerce Ajax Cart was a suggestion as it ajaxifies only the teaser cart (and this what you need as I understand from your comments.. and others). Instead of working on the copy module, won't it be better if you write a patch that fixes the problem?

This is a good thing you have pointed out, thanks, and I would like to get it fixed. Please create a new issue for this this and mark that as bug.

P.S. Patches are always welcome :)

anybody’s picture

Thank you very much @subhojit777,

I'll create a separate issue for that.

jurgenmo’s picture

A bit late, but I solved this issue with css.
Put both AJAX shopping cart and AJAX shopping cart teaser in desired regions.

Then hide the AJAX chopping cart with css
#block-dc-ajax-add-cart-ajax-shopping-cart{
display: none !important;
}
Now when adding a product to the cart AJAX shopping cart teaser is updated correctly.

Still one issue: when you continue surfing or if you refresh the page, all the add to cart confirmation messages are shown!
You can solve this by disabling the rule "Show 'Add to cart' message".

Excuse me if my English is not always correct.

Hope this helps

thelinhuk’s picture

@punch147 you said "Put both AJAX shopping cart and AJAX shopping cart teaser in desired regions". Do you mean these two files

    drupal_add_js(drupal_get_path('module', 'dc_ajax_add_cart') . '/js/dc_ajax_add_cart_html.js');
        drupal_add_js(drupal_get_path('module', 'dc_ajax_add_cart') . '/js/dc_ajax_add_cart.js');
qpro’s picture

Same issue, I only use "Ajax Shopping Cart Teaser" because "Ajax Shopping Cart" is not displayed well in my boostrap based theme by default and "Ajax Shopping Cart Teaser" take less space than "Ajax Shopping Cart".

  • I solved it using @puch147 solution #18, thanks
  • @thelinhuk, punch147 says that you have to place the "Ajax Shopping Cart Teaser" and "Ajax Shopping Cart" blocks, not files, in the drupal regions in the UI in /admin/structure/block

subhojit777’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Postponed (maintainer needs more info) » Fixed

Re #6:
It doesn't works with jQuery 1.10 if you are using Commerce Kickstart, but works with vanilla Drupal with Commerce installation. The jQuery error is from a Commerce Kickstart JS library, that can't be fixed in this module.

I have used the solution as mentioned in #9. It is a lot cleaner than #18, and the JS is going to be added only once in HTML. Also it makes the blocks independent of each other.

Thanks all :) and apologies for the delay.

dr.osd’s picture

AJAX shopping cart teaser is not updated if AJAX shopping cart disabled.
To fix this add line
drupal_add_js(drupal_get_path('module', 'dc_ajax_add_cart') . '/js/dc_ajax_add_cart_html.js');
to dc_ajax_add_cart.module file on 372 line after
drupal_add_css(drupal_get_path('module', 'dc_ajax_add_cart') . '/css/dc_ajax_add_cart.css');

subhojit777’s picture

@Dr.Osd please you the latest dev version. The bug is fixed there.

Status: Fixed » Closed (fixed)

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