Jump to content

Ajax Cart problem


Recommended Posts

Getting this when adding to cart from product page.
Doesn't happen when adding from HomeFeatured module or Category pages.

pictureOffsetOriginal is null
http://localhost/crimptools2/modules/blockcart/ajax-cart.js
Line 201



The product eventually gets added to the cart but the Add To Cart button is disabled.

Why would the line setting the var $element in this code return a null object?

// add the picture to the cart
var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
if (!$element.length)
 $element = $('#bigpic');
var $picture = $element.clone();
var pictureOffsetOriginal = $element.offset();
$picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left});


I find neither anchors a.product_image or a.product_img_link

I think this may also have to do with the View Full Size problem I'm having, too...

Link to comment
Share on other sites

I was having and identic problem with buttons not working. I solved the problem by disabling all modules not original presta 1.4.0.17 and enabling each one per one and checking again my cart. One of my extra modules was causing the problem. It seems that it was not compatible with 1.4. I deleted it (and others too compatible up to 1.3.6) but not in 1.4. For buyed modules I have already a fix for 1.4.
Perhaps you can solve it too by this way ?

Link to comment
Share on other sites

  • 2 weeks later...
  Quote
I had to make sure that *ALL* the correct .js files were being referenced. Seems that some didn't get included.
Now, all is well.


Which files were these? I've just noticed that I didn't have the ajax-cart.js either - and it's still not wondering so just wondered if there any others that might be missing?
Link to comment
Share on other sites

If you edit file product-list.tpl, you must save the structure of tags:








because script in file modules\blockcart\ajax-cart.js works like this:
var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');

Good luck!

Link to comment
Share on other sites

  • 1 month later...

can you explain for the designer in the room?

My product list page I wanted to take them images out so that I have a more condensed view..now when i add an item to the cart it does it but no animation lets me know.. the animation of the item dropping into the cart does not work. However, I know it did it because if I hit refresh it is in the cart. If I hit checkout it is in the cart.

Link to comment
Share on other sites

  • 1 month later...

Hi all,

after some hours looking for a solution I have not other way more than say SOS.
I have a problem with add to cart button, once I click on it, looks over but not charge on the cart only when I refresh the page or go to other page.
I deactivate tree part modules and check, for compilation, change some files on controller and modules regarding cart but it continue not working.
My shop is http://www.delica-te-zen.com

Any help will be nice, I don´t know what more to do.
thanks in advance.
BR

Link to comment
Share on other sites

  Quote
If you edit file product-list.tpl, you must save the structure of tags:








because script in file modules\blockcart\ajax-cart.js works like this:
var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');

Good luck!



Hmmm...this is my product-list.tpl section that relates to the image and add to cart button - I don't think I've changed them from the default.

    getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} />



The add to cart button section reads:

getPageLink('cart.php')}?add&id_product={$product.id_product|intval}{if isset($static_token)}&token={$static_token}{/if}" title="{l s='Add to cart'}">{l s='Add to cart'}



I have removed the product description from the template but this doesn't relate to the image or button, nor the JS action to add to cart.

I also get the 'pictureOffsetOriginal is null' error and the animation is broken.

We were going to launch today - but we can't until this is fixed. Does anyone have any pointers?
www.ergodev5.co.uk is the shop domain is you wish to take a peek.

I'm testing in Firefox 4 on Mac.

I've done some more fiddling and pretty much reverted the template back to its original state and I still get the error in product lists. Interestingly, it does work on the featured products homepage section.

Have I fouled the template too much? It's obviously not browser-specific.


Torbz
x

Link to comment
Share on other sites

SOLVED :: My issue at least....

Some edit I had done to hide certain sections of a product had fouled the template.
I re-uploaded the original and made the changes more carefully and it works again now.
I may have made a key press in error and stuck something subtle in by mistake.

I got rid of the
and the description was commented out - it seemed to work fine.

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...