Search code examples
cssopencart2.xopencart-module

Is it normal to rewrite all css classes for opencart template?


I started to rewrite Opencart 2.1 template classes with my own classes (I'm front-end and want to use my shop also as portfolio).

When I started to add modules I found out that probably it can be not the best idea taking in consideration that all modules use standard opencart styles to rewrite it via OCMOD. And I will need to make changes in all modules I add also.

I'm bit confused, so my questions are:

  1. Is it good to rewrite opencart standard template with my own classes and changes postions and different blocks in template?
  2. How to make it in better and smarter way?
  3. What if I use OCMOD to rewrite templates? In this case what going with already rewritten by module templates? Example: I have Extra tab module. It adds more custom tabs in product.tpl cia OCMOD. I need to add my styles in changed tamplate also with OCMOD. How it will work? Whether it will work?

Thank you!


Solution

  • You shouldn't remove the opencart's classes, you should add your extra. The main reason is that if you going to install any extension that adds a functionality into your eshop, then it won't render properly into your template and you will need to change it's code too.

    As for the question of "better and smarter" way, I can't understand what you mean.

    OCMOD will rewrite the templates but it will never rewrite the css files. So you will need extra css files.

    Suggestion: Keep the default theme and extend it or create a new one based on the default template.