Post by abmcr » Thu Jun 04, 2009 12:48 am

If i choose a product and i choose "add to cart", the backet is not updated in teh layout, and refresh when i change the page. I am the only to have this problem?
try in the demo frontend

http://demo.opencart.com/index.php?rout ... duct_id=41

if a click one time or two , the basket is not always update

Thank you

New member

Posts

Joined
Wed Jun 03, 2009 11:38 pm

Post by Qphoria » Thu Jun 04, 2009 4:49 am

search the forum before posting. This has been answered a few times already

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by phpuk » Thu Jun 04, 2009 5:52 am

The current fix is:

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

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();
          });
       });
    });

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by abmcr » Thu Jun 04, 2009 4:21 pm

Thank you for the response. I apologize for my post but i have searched and not found :-[

New member

Posts

Joined
Wed Jun 03, 2009 11:38 pm
Who is online

Users browsing this forum: No registered users and 5 guests