Works excellent on products page but on an individual product page, the add to cart button doesn't produce the pop up message but instead reloads page with product added to shopping cart. Bug?

Comments

erik seifert’s picture

Sounds like a js error. Please check for error messages and post them to this thread. You can also add a url to test.

Thanx

Luki_be’s picture

I don't get any js error messages (unless i'm looking in the wong place) but here's a test url:

http://www.dzinelabs.com/projects/drupal/content/discount-testing

TIA

tunic’s picture

Category: bug » feature
Priority: Major » Normal

I think your problem is theme related. UC Ajax Cart tries to find Ubercart Add to cart button based on ajax-cart-submit-form class (it's added with a form alter at uc_ajax_cart_alter_cart_form function).

In your theme, Add to cart buttons from individual product pages do not have this class. Testing module with standard module works ok with individual product page.

Try to test module in your site with Garland theme, and if it works (it should ;) please check your theme and custom modules that may be altering the Uc Ajax Cart needed markup.

Lowering priority and changing to feature request as long as it doesn't seem to be a bug.

Luki_be’s picture

k, tnx tunic. I'll check with the peeps of the theme to see if and whee i can change the theme to add the needed class.

tunic’s picture

Well, in fact module locates Add to Cart button with this selector:

form.ajax-cart-submit-form input.ajax-cart-submit-form-button

Check Garland markup to see how should be, or check mentioned function (uc_ajax_cart_alter_cart_form).

tunic’s picture

Category: feature » support

Changing to right category.

Luki_be’s picture

Hi tunic,

i'm afraid i can't locate neither the selector or the function ... i mean i see it in the Garland source but i have no clue where i can add it in my theme ...

tunic’s picture

Status: Active » Fixed

Your support request is about tehming, I'm afraid but that's out of my scope, you should check some theming tutorials.

My thought is that you have overriden add to cart markup in someway, so you should review your theming code for page products and insert or reuse Ubercart original code.

Luki_be’s picture

Found the culprit ... i was using this code for the template.php to show stock: http://chalcedony.co.nz/gemsofwisdom/ubercart-2-display-stock-available

turns out that code messed your module up:
function acquia_prosper_uc_product_add_to_cart( $node )

This function alters the add to cart button on product pages. All is well now.

Status: Fixed » Closed (fixed)

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