Support » Plugin: WooCommerce » [Plugin: WooCommerce – excelling eCommerce] Custom Theme – jQuery failing ?

  • Resolved bobby

    (@mgkday)


    Hello,

    I am trying to use WooCommerce with a custom theme.

    I could install the plugin successfully.
    I have all the pages working.
    I added a variable product, everything is almost working.

    I did not modify the theme at all for installing WooCommerce.

    Here is the part that doesn’t work:

    When I look at a product page, it looks as if jQuery wasn’t working:

    -the “Description” and “Additional Information” tabs are both shown (no tab effect), there links are useless since they are already displayed.
    -the product is variable (color and size) was is displayed gives me a hint that jQuery isn’t working. indeed I see the “Clear selection” text, without even selecting a color nor a size. and if I select a combination, no “add to cart/quantity” part appears.

    I inspected the page, no JS errors. So I can’t debug this.

    I tried using the “woocommerce_content();” trick as in the WC docs, but no changes.

    Any advices ?

    thank you very much in advance.

    MGK

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author royho

    (@royho)

    It would help if you posted URL…Most likely you have duplicate jQuery running…

    Thanks for your reply royho, I will try to put it online now, as I am running it locally (WAMP) for the moment :/

    I already have jQuery within my theme indeed, everything is working, its just the woocommerce part that is not, and I don’t see any JS errors (Chrome > Inspect Element) so I don’t really know how to handle that.

    on my function.php’s theme, I have

    if ( !function_exists('core_mods') ) {
    		function core_mods() {
    			if ( !is_admin() ) {
    				wp_deregister_script('jquery');
    				wp_register_script('jquery', (get_template_directory_uri()."/js/jquery-1.5.min.js"), false, '1.0');
    
    	wp_enqueue_script('jquery');
    Plugin Author royho

    (@royho)

    Again you have to put your site online for us to know…You may not see any errors does not mean we won’t see it on our side…

    Plugin Author royho

    (@royho)

    Also I am seeing a very old version of jquery being loaded…Could that be the cause?

    I was just uploading everything on my server, sorry for the delay :

    here is a test link :

    http://cultureleb.com/-/

    you can see that jQuery is working by clicking on the + (bottom right), a fake underneath menu will appear

    I changed to latest jQuery 1.8.0 also.

    I even took everything and kept the minimum just for testing purpose.

    Thanks in advance for your help

    Plugin Author royho

    (@royho)

    Did you modified the woocommerce template files as well?

    Plugin Author royho

    (@royho)

    Looking at your site, you seem to be missing many of the essential scripts thus your site is not working…You’re missing jquery UI which makes the TABS function, you’re missing add to cart variations JS, add to cart JS…etc…These are needed…

    not at all, the link you see is a clean fresh install of wordpress, my theme and woocomerce plugin. I added the “shop” page on the wordpress menu after installing woocommerce plugin and added a variable product. nothing more.

    Plugin Author royho

    (@royho)

    Read my reply.

    so where can I find the “list” of stuff to add when using a custom theme ?

    Plugin Author royho

    (@royho)

    Actually these are added by woocommerce plugin…not sure why you don’t have them…This is something only you can check as it is your theme…

    maybe I forgot to add a function in my function’s theme to say “add all the scripts from the plugins as well” ? does something like that exists ?

    Plugin Author royho

    (@royho)

    I doubt it…I would suggest you try another theme…

    when I activate Twenty Eleven for example, it works perfectly.

    so I am guessing you are right, there is something missing on my function.php.

    If you check this page http://cultureleb.com/-/?product=testproduct

    you can see in the source code :

    <script type='text/javascript' src='http://cultureleb.com/-/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=1.6'></script>

    and so on, which corresponds to the part that are missing in my theme in order to work !

    So now I need to find where does these lines are generated in the Twenty Eleven theme 🙂

    Am are right ?

    EDIT : resolved, I was calling the footer in another way in my theme,

    I was using

    <?php get_footer(); ?>

    calling the footer.php page, but I needed “wp_footer();”

    it works now, thanks a lot for your help !!

    hey MGKday,
    I am having the same problem and would like to get your explanation on how to resolve this. when you say you use wp_footer() instead of <?php get_footer(); ?>, what exactly did you mean/
    How do I modify my theme to apply this trick?
    Is the two function do the exact same thing, so that I can use either one of them?

    thank you

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] Custom Theme – jQuery failing ?’ is closed to new replies.