cyberchimps / responsivecore

Core files and functions for the responsive theme
8 stars 17 forks source link

Mobile menu shows "undefined" in Woocommerce product pages #2

Closed juhana closed 10 years ago

juhana commented 11 years ago

When you view product pages in Woocommerce the mobile menu reads "undefined".

The bug is on line 266 of https://github.com/cyberchimps/responsivecore/blob/master/js/responsive-scripts.js#L266

if (e("body").hasClass("woocommerce")) {
    t = e("h1.page-title").html()
} else if (e("body").hasClass("woocommerce")) {
    t = e("h1.entry-title").html()

The first else if will never be reached because it's identical to the main if. It should be something like this:

if (e("body").hasClass("woocommerce") && e("h1.page-title").length > 0) {
    t = e("h1.page-title").html()
} else if (e("body").hasClass("woocommerce")) {
    t = e("h1.entry-title").html()
grappler commented 10 years ago

This has been fixed.