How to Force Website to Show user.css Changes

From Phoenix Cart User Guide
Revision as of 07:35, 18 September 2022 by PeterRobert (talk | contribs)
Back
FAQ Tips & Tricks


After making changes in /yourTemplate/static/user.css and saving, the changes do not show unless your browser cache is hard or forced to refresh or reload.

The website can be forced to load the new user.css.

Make a copy of /templates/default/includes/hooks/shop/siteWide/styleSheets.php and save it to /templates/yourTemplate/includes/hooks/shop/siteWide/

After

function listen_injectSiteStart() {

Insert

$css_version = '2021.0.8';

Change this line

$this->sitestart .= '<link href="' . $css_file . '" rel="stylesheet">' . PHP_EOL;

to

$this->sitestart .= '<link href="' . $css_file . '?ver=' . $css_version . '" rel="stylesheet">' . PHP_EOL;


2021.0.8 can be any meaningful versioning system you want.

Every time changes are saved in the user.css, update the version number in styleSheets.php and save.

Now the changes in user.css will show after a simple refresh and importantly, will show for a previous customer who might still have the old pages cached in their browser.


Example

Click on an image in the gallery on a product_info page, to see the default modal pop-up carousel.

[[File:lightbox_carousel_before.png|link=]



Construction.png
This page is in progress
Please visit again soon for additions and changes

Phoenix Cart User Guide, like CE Phoenix Cart, is free to use but is maintained by unpaid volunteers.

Code references are licensed under a Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales License.
All other content is the reserved Intellectual Property and Copyright of phoenixcart.org