0

On the entire website(homepage, category page etc) sometimes I'm getting "cannot read property timepicker" issue due to which some feature like "Add To Quote" functionality affected & instead of "Add to Quote" item via AJAX it's redirecting to 404 page.

Please visit the following screesnhot:-

When "Add To Quote" feature is working :-

enter image description here

When "Add To Quote" feature not working :-

enter image description here

Note:-1 I'm using some 3rd party extensions on the site also migrated from Magento1 to 2, using custom theme etc.

2-

I need to run only "Add to Quote" feature so please let me know how i can resolve " cannot read property" issue.

1 Answer 1

0

Please use the JavaScript try catch in the part of the code that is giving the above error as

try
{
// code with the possibility of throwing a js error
}
catch (err)
{
// your error handling js code
}

Also add a code to check if the particular js variable is defined or not as below code:

if (typeof yourvariable !== 'undefined')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.