Post by JNeuhoff » Thu Jun 18, 2009 7:19 pm

When using the enabled flying-animation during an Add-to-Cart, the shopping cart is not always refreshed, especially not for the first time it is done. Has someone solved this issue yet? Is it a bug in the way Ajax is used for this?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by phpuk » Thu Jun 18, 2009 9:34 pm

Hi JNeuhoff,
phpuk wrote: AJAX Script update:

Script: catalog/view/theme/default/template/module/cart.tpl

The current fix is:

Code: Select all

$(document).ready(function () {
   $('#add_to_cart').replaceWith('<a onclick="" id="add_to_cart" class="button">' + $('#add_to_cart').html() + '</a>');

   $('#add_to_cart').click(function () {
      $.ajax({
         type: 'post',
         url: 'index.php?route=checkout/cart',
       data: $('#product :input'),
         success: function(){
         $('#module_cart .middle').load('index.php?route=module/cart/callback');
         }
      });

      var image = $('#image').offset();
      var cart  = $('#module_cart').offset();

      $('#image').before('<img src="' + $('#image').attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');

      params = {
         top : cart.top + 'px',
         left : cart.left + 'px',
         opacity : 0.0,
         width : $('#module_cart').width(),
         heigth : $('#module_cart').height()
      };

      $('#temp').animate(params, 'slow', false, function () {
         $('#temp').remove();
      });
   });
});
This however has not been acknowledged by Daniel as the final solution as is therefore simply an option at the moment.

With the speed of development at the moment release candidates would not be very beneficial. Daniel updates the version number so that should be enough for now. You should view them all as BETA release candidates although the product is stable.

A version number displayed in the Admin section would be useful though.

Phil.

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by JNeuhoff » Thu Jun 18, 2009 9:45 pm

Thanks, I'll try your updated Ajax script and let know how it works.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 15 guests