How To Add Custom Css With My Changes Addon


But your ways are to complex. It is easier to use the CSS weight to override default CSS rules. For example. div with the id tygh_container exists on all pages

Yes you can add tygh_container to your rules or !important to override the cs-cart rule. That works but it doesn't help the problem of looking in multiple places to find the problem in the first place. Since its less I guess you can just wrap all your rules in tygh-container and never worry about whether there is a cs-cart rule that would override yours.

But option #2 I proposed, cloning the theme style (e.g. Greeny, Woody, etc.) is actually less complex than setting up a couple of folders, styles.post.tpl hook file and a new styles.less file as you can easily clone the theme style in the visual editor. Then put all of your styling in the custom css (you can even use less in the custom "css") either via the visual editor or by editing the file directly. You need to clone the theme style anyway or any color/font/background changes and custom css changes will be overwritten by upgrades. So what's the advantage of also creating a tpl override and another file?

You need to clone the theme style anyway or any color/font/background changes and custom css changes will be overwritten by upgrades. So what's the advantage of also creating a tpl override and another file?

Why do think so? All code in the CSS section of theme editor as well as styles in the custom addons are not overrided by the upgrade. This is the main feature of these ways of the realisation.

Why do think so? All code in the CSS section of theme editor as well as styles in the custom addons are not overrided by the upgrade. This is the main feature of these ways of the realisation.

From upgrade from 4.1.5 to 4.2.1:

[attachment=10749:csupgrade.jpg]

csupgrade.jpg

From upgrade from 4.1.5 to 4.2.1:

attachicon.gifcsupgrade.jpg

These styles exist on all installations and you are not able to change them. But custom styles will not be affected by the upgrade at all.

These styles exist on all installations and you are not able to change them.


Sure you can change them. But upgrades will wipe out your changes.

But custom styles will not be affected by the upgrade at all.


That is exactly what I was saying. So if you have created a custom style what's the point of putting styles in my_changes? Why not just use your custom style files?

OK. Looks like we misunderstood each other. In my opinion, custom styles feature is useful for small changes. Buy if you want to prepare completely new look and feel based on the default theme, it is better to use the module.

With my previous version 4.3.3 this tutorial works perfectly.

but I'm now testing with the version 4.3.5 (1 month) and it seems the structure of the folder has been changed. there is not "design" folder. now is called "themes_repository"

So, there is /themes_repository/(my_theme)/templates/addons/my_changes/hooks/index/styles.post.tpl

with this content:

{style src="addons/my_changes/styles.less"}

--

Also I've created

/themes_repository/(my_theme)/css/addons/my_changes/styles.less

that contain my own css.

--

But for some reason is not working. any idea what I'm doing wrong?

appreciate some help. 8)

Your in the wrong directory. Use

design\themes\responsive

The themes_repository directory is not the Live template directory. It contains the not uses templates.

Change the word responsive above to your 'template' name if not using the responisve theme.

Ah, yes, I was wrong. Now works perfect. Thanks Triplets! 8)

Hi all, sorry to bring up this post again, but have you been able to use the above methods in 4.3.8? I have 2 cs-cart stores, one has my_changes working just fine (not 4.3.8 though) and the other is a fresh install, but I cannot get my_changes to work at all.

Any ideas?

hello,

can someone check if workarround is working with 4.4.3 (trial)

regards

hello,

can someone check if workarround is working with 4.4.3 (trial)

regards

The solution from post #1 will work correctly on 4.3.3 trial

You are welcome!

I think, it is a most frequently asked question. So let me answer here for everyone.

The tutorial is actual for CS-Cart and Multi-Vendor 4.x

1. Make sure that the status of the My changes add-on is Active ( Add-ons -> Manage Add-ons )
2. Create the design/themes/[your theme]/templates/addons/my_changes/hooks/index/styles.post.tpl file with the following content

{style src="addons/my_changes/styles.less"}
3. Create the design/themes/[your_theme]/css/addons/my_changes/styles.less file
4. Add your CSS rules to this file
5. Clear the cache ( Administration > Storage > Clear cache )
6. Check the result

See also:
- How To Add Custom Javascript With My Changes Addon
- How To Add A New Carrier

{style src="addons/my_changes/styles.less"} not working, but when I change to {style src="addons/my_changes/styles.css"}, It's work. Should I enable LESS in Theme Editor to use styles.less and I'm confusing between 2 buttons "Enable LESS" and "convert CSS" in Theme Editor, styles.pcl.css was duplicated and auto inserted every add-on so my styles were overridden too much. Can you help me solve this problem?
Here is my site: https://www.classics-the-small-luxury.com/dev/?store_access_key=ctdvlpmnt

Yes, try to enable LESS again. If it does not work. please contact support team to solve the issue