1

I created a module which is changing some of the behaviours on the bundle product. I also need to create some CSS and I did create a file and attach in a layout by doing this:

<css src="Bachus_BundleContextPros::css/bundle_style.css"/>. 

Now the problem is that the store is multi-store with different colour shapes.

My question is how do apply to different versions of my bundle_style.css for each store ?

0

You just have to copy that CSS file in : /web/i18n/code_ISO/css/style.css then your css will be loaded for that store So:

  1. app/code/Bachus/BundleContextPros/view/frontend/layout/bachus_bundlecontextpros_index.xml

    ...
    <head>
        <css src="Bachus_BundleContextPros::css/bundle_style_store1.css"/> //french store for exemple
        <css src="Bachus_BundleContextPros::css/bundle_style_store2.css"/> //English store
        <css src="Bachus_BundleContextPros::css/bundle_style_store3.css"/> //Russian store
    </head>
    ...
    
  2. app/code/Bachus/BundleContextPros/view/frontend/web/i18n/fr_FR/css/bundle_style_store1.css

    app/code/Bachus/BundleContextPros/view/frontend/web/i18n/en_US/css/bundle_style_store2.css

    app/code/Bachus/BundleContextPros/view/frontend/web/i18n/ru_RU/css/bundle_style_store3.css

  3. Deploy the static content :

    php bin/magento setup:static-content:deploy -f
    
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.