Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Fix Css And Js Code Does Not Work On Localhost Copy Of Live Site? Rate Topic   - - - - -

 

Posted 03 September 2019 - 06:56 AM #1

Dear all,

 

I have set up my live site on localhost while store front is closed. I set up exact copy of my db of live into development db.

 

I'm able to login to admin panel and browse through the navigation and all

 

But the problem is all my site styles are lost and no java script is running.

 

I tried clearing cache manually but still the same.

 

However on my live websit,e I'v set up CDN enabled.  I doubt that each time when my local host tries to get CSS&JS from CDN, it does not allow to fetch data due to domain missmath  

(I use virtual host domain ) . I guess this could be the reason.

 

Please advice me on how to resolve this on my localhost.

 

Thanks in advance. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 03 September 2019 - 07:05 AM #2

Did you try to disable CDN on the localhost? I think, this is the only possible solution


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 03 September 2019 - 07:25 AM #3

Thanks for your suggestion,

 

I thought the same, But the problem is when I navigate to CDN settings page, I see the check box 'Enable CDN' being checked. 

After I un-check it, am unable to save settings due to JS not working to submit the form.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 03 September 2019 - 01:44 PM #4

Log in the phpMyAdmin., find the cscart_settings_objects table and search by 'cdn' name. You should change value from Y to N and clear cache


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 03 September 2019 - 03:03 PM #5

Hi,

 

I found the record as per your instructions. And found a serialised array string instead of 'Y' in value.

 

I replaced that string with 'N'. Then cleared the cache. 

 

Thanks to you, its now rendering the styles and JS functions.

 

There are few JS errors I see on console when I go to orders page such as, 

 

Uncaught ReferenceError: jQuery is not defined,

Uncaught TypeError: $ is not a function,

Uncaught TypeError: Cannot read property 'fn' of undefined,

Uncaught TypeError: Tygh.$ is not a function

 

Again, thanks for your suggestions. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 04 September 2019 - 05:42 AM #6

Try do delete the var/cache directory manually


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 04 September 2019 - 07:28 AM #7

Hi,

 

Perfect! 

 

it works like a charm after deleting the cache by manually.

 

Thank you eComLabs! appreciated your time.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19593 posts

Posted 04 September 2019 - 01:52 PM #8

You are welcome! :)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.