Greetings,

I am trying to use this module on my custom theme. It does not work. I tried it on the my bootstrap base theme and it works. I figured there is a scripts or css conflict so i removed them all just to test. Still not working. So I figured it might be a panels issue so i disabled all panels related modules. It still does not work. I checked source code and both css and js files are there. I checked browser console and there are no errors. I think I am pretty decent at debugging and tracking down problems but now I have to say I am at a loss. So I am just curious if any body watching this queue might have an idea of what else i can check to identify the issue. Many thanks. Cheers

Comments

drupalstrap created an issue. See original summary.

subhojit777’s picture

What exactly is breaking. Is the ajax cart block not reflecting the updated items? For debugging, can you upload the theme here.

pyxio’s picture

Thanks for the quick reply. The overlay with cart items simply does not trigger when adding item to cart. I see only the standard drupal commerce message "X added to your cart" ... as far as sending theme I would rather do that via private email or I can privately provide you with a link where you can see the dev site and test yourself. Cheers

subhojit777’s picture

There is a setting that turns that popup on/off, make sure that it is on. Is the page refreshing when you add product to cart?

pyxio’s picture

yes page refreshes. setting look OK as i mention i tested in other themes and it is OK. so i think settings are not the issue. i would think a conflict in js but as i mentioned i removed everything to test and still not working. i can send you a PM to the site if you want to take a look.

subhojit777’s picture

Send me the site link.

pyxio’s picture

sent. thanks

pyxio’s picture

oh, you find product add to cart buttons on Plans page

pyxio’s picture

and you can see cart teaser in content block just at footer on left side.

subhojit777’s picture

What version are you using?

pyxio’s picture

7.x-2.1 default drush dl

subhojit777’s picture

Can you try v1.3

pyxio’s picture

done. still not working :(

subhojit777’s picture

Seems like ajax is not getting enabled in your form http://cgit.drupalcode.org/dc_ajax_add_cart/tree/dc_ajax_add_cart.module...

pyxio’s picture

i don't get it. if i switch theme it works.

subhojit777’s picture

Then maybe your theme is conflicting with the form_alter?

pyxio’s picture

also it is using bootstrap as a base theme ... and it works there so seems logical subtheme would inherit bootstrap base theme ajax ... so strange

pyxio’s picture

let me check what i have in the way of form alters. good call ...

pyxio’s picture

yes. you nailed it. this was the culprit


// function tracka_form_alter(&$form, &$form_state, $form_id) { 
//   if (strpos($form_id, 'commerce_cart_add_to_cart_form') !== FALSE) {
//     $form['submit'] = array(
//       '#type' => 'submit',
//       '#value' => t('Choose Plan'),
//     );
//   }
// }


pyxio’s picture

sorry for the inconvenience. i hope this issue will help somebody else in the future. there are so many places to look when debugging ... i should have know myself to check template.php file. i really appreciate the help and thanks for the great module.

pyxio’s picture

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

It is just renaming the button name, in that case:

function tracka_form_alter(&$form, &$form_state, $form_id) { 
  if (strpos($form_id, 'commerce_cart_add_to_cart_form') !== FALSE) {
    $form['submit']['#value'] = t('Choose Plan');
  }
}
pyxio’s picture

Awesome. thanks

pyxio’s picture

I guess hide cart if empty does not apply to shopping cart teaser?

subhojit777’s picture

Sorry? Didn't get you.

pyxio’s picture

if i check hide empty cart option. it hides shopping cart, but not shopping cart teaser. so i was just checking that is by design.

subhojit777’s picture

Yes, that is how it is supposed to work.

pyxio’s picture

cool. thanks again.