Thread: CSS File Issue

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default CSS File Issue

    Ok, I am using default template - Classic

    Recently, I made a duplicate of the stylesheet.css and renamed it to stylesheet-old.css and kept it in the same folder.

    The weird thing is, When I am using Safari on Mac, the site is loading stylesheet.css and when I am using Chrome or any other browser, it's loading from stylesheet-old.css.

    So I deleted stylesheet-old.css. Safari still loads the site correctly, but other browsers are loading the site without and CSS rules at all. This seems very odd to me. I removed history, cashes, etc on all the browsers and no luck. I feel like something is cashed somewhere. The only add on that could be a culprit is SEO friendly URL add on.

    Any ideas?
    Thanks in advance.

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: CSS File Issue

    I can't address the browser differences, but Zencart loads all stylesheets whose file name begins with 'style' and have the .css extension that it finds in the current template's css folder. If you want a stylesheet to not be loaded, change the extension (stylesheet.old) or remove it from the css folder.

    BTW, you should create your custom template before you go any further: http://www.zen-cart.com/content.php?...ustom-template

    That way, you'll have the Classic template for troubleshooting purposes and you won't overewrite your changes when you upgrade to the next Zencart veresion.
    Last edited by stevesh; 26 Sep 2013 at 01:18 PM.

  3. #3
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default Re: CSS File Issue

    Thanks for the info. But to give you some background, I have been working on Zencart installs for over 6 years. This is my 17th store.

    The thing I can't understand is, Some browsers exclusively loads stylesheet-old.css, no matter how much I clear the history/caches/cookies. Some loads the correct stylesheet.css no matter what. If I remove stylesheet-old.css, other browsers that loads exclusively from that file goes in to "no css stylesheet" mode. If I duplicate stylesheet-old.css from a new version, the same error happens. This is very odd to me.

    Could it be that I use SEO friendly URL mod and it caches the files?

    PS: My goal is to just have one stylesheet.css.

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: CSS File Issue

    Quote Originally Posted by sle39lvr View Post

    Could it be that I use SEO friendly URL mod and it caches the files?
    Could be. I don't use URL rewriters. Can you turn it off temporarily for testing ?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: CSS File Issue

    Quote Originally Posted by sle39lvr View Post
    Recently, I made a duplicate of the stylesheet.css and renamed it to stylesheet-old.css and kept it in the same folder.
    First, don't do that. Same with PHP files.
    If you want to RENAME a file and ensure that it's not used unexpectedly, change its extension to something else.
    Or, in the case of stylesheets, ADD "old" to the BEGINNING of the filename, not the end. Remember: stylesheets are auto-loaded based on naming of "styleXXXXXX.css". So, if you rename it and keep the "style" prefix and ".css" suffix (ie: stylesheet-old.css keeps both) then it will assume you intended to use it.

    Same with PHP files: Keeping the *.php pattern will most likely cause BOTH the old and new files to be loaded, often producing unexpected results.

    Simple rule: change the extension if you want the file to be a backup or temporary copy that you've not decided to delete just yet.


    As far as potential caching, Zen Cart doesn't do any caching of html assets like that. So something you've added must be doing that. There are many unofficial addons that people have tossed out there that do cache and minify things like css and js, which do cause weird problems like yours. So do some of the url-rewrite tools that cache objects. Turn all those off as a starting point.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default Re: CSS File Issue

    Yes, I learned it the hard way about renaming files.
    I just turned off SEO URL rewriting, and took off the old (second) CSS file. Site isn't loading and CSS rules currently, except on my Mac's Safari browser.

    Please let me know if anyone is willing to take a look? I can pm the site.

    This is blowing my mind, because this goes against everything I know and my past experiences.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: CSS File Issue

    Have you tried specifically visiting the URL of the correct stylesheet file? ie: typically http:// your_site.com/includes/templates/your_template_name/css/stylesheet.css
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default Re: CSS File Issue

    I can access it via URL from every browser.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: CSS File Issue

    Then it seems as though your browsers have outdated cached resources in them.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: CSS File Issue

    Or maybe it's just that your main CSS file has a syntax error right near the top of the file ... no closing parenthesis, and invalid path:

    Code:
        src: url(../includes/templates/classic/css/fonts/lyon-regular.ttf;
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 [Host issue, not a bug] Mass Log File Issue and Site is Down
    By MortalWombat in forum Bug Reports
    Replies: 5
    Last Post: 27 Jan 2016, 06:57 AM
  2. Layout issue / css problem with IE only. Can't find the issue!
    By linnx in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Apr 2011, 10:54 AM
  3. CSS Issue
    By Checooper in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 May 2010, 08:53 PM
  4. css issue
    By acummins in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Feb 2010, 02:06 AM
  5. Default CSS Optmization - How do I change CSS File name in header of all pages?
    By Beama in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 7 Oct 2009, 09:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg