How to override .js file in strange structure - prestashop

I am working on prestashop 1.6. I have a .js file here:
\modules\my_module\views\js\custom.js
And I want to override it in theme.
I've tried for example:
\themes\my_theme\modules\my_module\views\js\custom.js
It didn't work. Nor did
\overrides\modules\my_module\views\js\custom.js
Where should this file be placed?

You should place your file under:
\themes\[theme]\js\modules\[js_path_in_module]
\themes\my_theme\js\modules\my_module\views\js\custom.js

Related

Spacemacs - is theere a way to use downloaded theme for spacemacs (.el file)

I'm new to spacemacs/emacs. I downloaded an theme file .el and put it in /private/themes dir. (themes dir I created) How can I see it when I hit M-x - load theme ? I read some articles about using add-to list load-path and require but dont know how to use it and where to place these instrcutions in the .spacemacs file.
Thank.
I Do this in .emacs file:
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(custom-set-variables
'(custom-enabled-themes '(spolsky))) -> loaded at startup
I think also that we can put the theme file inside ~/.emacs.d/etc/themes so that they are view as safe by emacs. Simply use M-x load-theme after.

How to edit css : Bigcommerce Stencil

How can I edit in CSS.
In Stencil framework can't found .css file.
In assets folder only found .scss file.
I want to edit in theme.css
How can I edit ?
Can any body help me ?
If you are developing a stencil theme locally and have ran stencil start it watches your SCSS files. So one option is you could add any custom CSS you want to the /assets/scss/theme.scss file.
Another option is you could create your own SCSS file, say for example custom.scss, and place it in /assets/scss/. Then import it to your theme.scss like this #import "custom" . Make sure you place it at the bottom of your theme.scss file so it overrides any css you are wishing to alter.
the .scss files are the css files. The stencil framework uses scss instead of the regular css.
This link should help guide you on how to edit the files: https://support.bigcommerce.com/articles/Public/Using-the-Stencil-Theme-Editor
the .scss files are the css files. The stencil framework uses scss instead of the regular css.
Please check this path /assets/scss/theme.scss

PrestaShop Using Default Module Instead of Theme Module

Today I starting design theme for prestashop and i'm Beginner on that.
i have a Question about Theme Module
i have Some module for my new Theme Located here:
prestashop/theme/mytheme/Module
and i want customize that for my new theme.
but the prestashop not using My Module instead using default module Located here:
Prestashop/Module/
What's Wrong and how to Fix this?
From the PrestaShop documentation:
Overriding a module's behavior
The modules are usually in the following format:
/modules/my_module/my_module.tpl
/modules/my_module/my_module.css
/modules/my_module/my_module.js
Since PrestaShop 1.5, they can and should also be in the following format:
/modules/my_module/views/templates/front/my_module.tpl
/modules/my_module/views/templates/front/my_module.css
/modules/my_module/views/templates/front/my_module.js
PrestaShop allows you to override or replace certain front-office module files
with new ones within the same theme. The override is governed by the
theme: once it contains a /modules folder (or more!), PrestaShop will
browse its content for files which have the same name and path as
those of existing modules, and replace these with the new ones.
This means, for PrestaShop 1.4-compatible modules:
/themes/my_theme/modules/my_module/my_module.tpl
/themes/my_theme/css/modules/my_module/my_module.css
/themes/my_theme/js/modules/my_module/my_module.js
Since PrestaShop 1.5, the path is slightly longer
/themes/my_theme/modules/my_module/views/templates/front/my_module.tpl
/themes/my_theme/css/modules/my_module/views/templates/front/my_module.css
/themes/my_theme/js/modules/my_module/views/templates/front/my_module.js
In general, the proper path to override a .tpl, .js or .css file
depends on the module's own path. That is the reason why if PrestaShop
1.5 has to work with a module without a view folder, it will need the same override path.
In short, you can keep overriding code in 1.5 just
as you did in 1.4.
The new files will be used when the customer loads
your shop.
Contrary to the override code that is to be placed manually
in the /override folder, module overrides are enabled as soon as the
module is installed. During installation, overriding code is merge
with those already in place (if any), otherwise they are copied to the
/override folder at the root of the PrestaShop folder.

Prestashop 1.5, How to copy a core module into my theme module folder?

I'de like to copy the [prestashop new theme]cart block (cartblock2 in the main module folder) into my theme/modules in order to customize it and keep the core module intact.
How do I do that ? I searched the documentation and it's not very clear...
What I did so far :
Copy cartblock2 from the main module folder into my theme/module folder, empty prestashop cache (it's turned off but just to be sure), I made my changes but nothing change it's only changing when I modify the module in the main module folder.
Thank you for your help
module folder name must same with root modules name
/modules/blockcart2
in themes
/themes/modules/blockcart2
and you can only edit blockcart2.tpl file in themes folder
and make sure blockcart2 installed in bacoffice

ActiveAdmin: changing css file?

I'm confused on where to put my new css file for ActiveAdmin to use. I have a folder called public/admin/active_admin.css and here https://github.com/gregbell/active_admin/issues/261, it says to put it in active_admin.rb but this doesn't exist in my application. Where does it go?
All you need to add is
# active_admin.rb
config.register_stylesheet 'active_admin_custom.css'
in the file config/application.rb (or an environment-specific config file) then the file /public/stylesheets/active_admin_custom.css
or you can create a new file:
config/initializers/active_admin.rb and put that line of code in there.