Magento javascripts where are they loading from? - magento

I'm working on Magento installation that is causing me frustration.
I CAN find what seems to be the correct page.xml file loading the theme's Javascript (i.e prototype, scriptaculous, etc) in the header, but editing this file and removing scripts does not do ANYTHING for me. When I try and remove/add any new scripts, nothing happens.
Maybe a cache issue? But I have deleted all files from the cache folder. I also tried to find the "Cache Management" menu in Admin, but there is not one there.
I'm 99% confident that I have looked in all of the folders that would call all Javascript.
I am new to Magento, so maybe I've missed something completely.
Any suggestions on where I could find where the basic scripts would be loading from?

I do not know if I got it right. But what you want to know is the directory where the file .js is located, correct?
Try looking in: yourdomain/skin/frontend/yourtheme/default/js/
or: yourdomain/skin/frontend/default/yourtheme/js/

Page.xml is the correct file you need to modify. If not a caching issue, the only other thing I can think of is you have a theme installed but trying to modify the default(base) page.xml.

Related

Where should I place a language dictionary for module-checkout for magento 2?

I am trying to translate the "Go to Checkout" of Magento 2. If I place the file in /vendor/magento/module-checkout/i18n/de_DE.csv it works. Content of de_DE.csv:
"Go to Checkout","Zur Kasse"
But this seems as a bad idea as adding/changing stuff in /vendor is bad practice at least.
I have tried to place it practically everywhere, but no luck...
You can achieve the same by overriding it in your custom theme like given in below example. More over doing the changes in the vendor/magento is not advisable.
app/design/frontend/{{Vendor}}/{{Theme}}/i18n/de_DE.csv
Once all the translations are set save the file and run the below given command in the terminal.
Clear cache (bin/magento cache:clean) and check your changes.
Hope this will make your day!.
Thanks
You can add your csv file in app/i18n/vendorname/modulename, it will get translated everywhere the site., In your case you are saying that tried with place the translated file in vendor..So you can just override that in your custom theme too..Like path app/design/frontend/VendorName/CustomModuleName/Magento_Checkout/i18n/.csv,
And run the commands like upgrade deploy compile if it is necessary..
And clean cache too..
Hope this will help.

Opencart 2 caching

Has opencart 2.1 a cache system apart from modification?
I'm trying to restyle an opencart 2.1 site.
I've modified catalog/view/theme/my-theme/template/product/product.tpl
but I'm not able to see my updates.
The site has only 1 modification that affects Admin area...I've also tried to disable it and update cache, but without success.
I've tried to open site in another browser, but nothing.
Finally I've tried to rename product.tpl to product111.tpl (also in view/theme/default/product)... but the original product page is still loaded.
Does someone know why this happens?
UPDATE : I haven't found a solution, so I made a fresh installation, applied custom theme and then copied modified files... everything is Ok now. If I modify product.tpl, all changes are visible in product page.
If you have vQmod installed there is a vqcache also.
You can check to see if you have vQmod installed like this:
yoursite.com/vqmod/install
It should usually clear itself, but if it doesn't then you can safely rename the vqcache folder to clear it.
The reason I say rename rather than delete is that sometimes a change to the cache will show an error which wasn't spotted when the original change was made and might prevent orders until it's fixed. If you rename then you can place the folder back and it will work again but of course you should fix the error when you can.

Joomla cannot unset mod_languages/css/template.css

Joomla 3.x
The following code is not working
unset($doc->_styleSheets[JURI::root(true).'/media/mod_languages/css/template.css']);
thank you
The code is correct and I tested it, it's working fine.
Possibly you are running it in a plugin event after the head is rendered, or you have cached the page and the code is not really running.
In either case, try to put it at the component level, clear cache, and it should work
Update
to identify the component: turn SEF off, and look at the URL it shows as option=com_componentname;
to identify the module, simply rename the modules folder, and update the site; if it works, it's a module.
For plugins, rename the plugins/system and plugins/content first, then drill down until you spot it.
Alternatively, but much slower, you can turn modules and plugins on and off from the backend, until you find the culprit.
A variation which I've used with success in the past:
unset($doc->_styleSheets[$this->baseurl.'/media/mod_languages/css/template.css']);
Update
Here's an alternate method using a module override which should work for you.
if it doesn't already exist, create a new directory titled html in your template's folder, ie: /templates/your-template/html/
inside this, create an new mod_languages folder, ie /templates/your-template/html/mod_languages/
copy the file from joomla-site-root/modules/mod_languages/tmp/default.php to the folder above, ie /templates/your-template/html/mod_languages/default.php
open this file with a text editor and around line 12 look for the line where JHtml is loading the mod_languages CSS, and comment it out.
// JHtml::_('stylesheet', 'mod_languages/template.css', array(), true);
That's it, hopefully, this will do the trick for you.
Overriding Joomla core output using this method is safe and you won't loose your work with future Joomla updates.
More info about Joomla overrides:
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Good luck!

Finding the file that is being loaded on the fly in joomla

im using a joomla template in my localhost. I would like to edit one of the on-screen module's position. i used chrome and firefox to inspect the elements and even changed the properties. it works the way i want, but the problem is, im not sure where these actual files are residing in my localhost. There are 100s of files and its frustrating there isn't an easy way to find out the exact file that i have to edit.
I understand that joomla contents are generated on the fly and thus it isn't easy to find the exact file. I have also seen some of the past related questions in stackoverflow.com, asked by desperate users like myself, nothing works.
Im hoping someone knows of a tool or a trick that can help me. I even tried indexing the localhost folder (c:\wamp\www\demo) to search file contents, it doesn't seem to work for some reason.
Pls help.
The position of the module is almost certainly determined only by the css in your template. Using web inspector in Firefox or Chrome you can see which file (and the file path) of any styles that are currently being applied to the module, so you can simply modify the rules in that files.
I love Mac
Since my files are in the localhost, i have been trying to search for the div class that is generated on the fly, but my pc couldn't thoroughly search the contents of the file.
On my mac, i searched for the div class word and hey! it showed me a list of files that contained the div class and i found the file in a matter of seconds! how cool is that!!
Thanks Guys, hope this helps someone too!

Magento - Editing phtml files in adminhtml folder having no effect

When I make a change to “app/design/adminhtml/default/default/template/page/head.phtml” or other files in the adminhtml folders, the changes I make have no effect on the site. The site seems to be using old versions of my files but I have no idea where it is getting them from. I have deleted the cache multiple times and logged in/out of admin. I’ve also managed to turn on path hints in the admin panel and can see that the correct files are being used but the code in the files is incorrect. If I rename the file to _head.phtml then as you'd expect, the styling, js and meta tags etc go missing but when I make a simple edit to that same file the change is not reflected.
I recently upgraded from 1.6.2 to 1.7 - Am I missing something?

Resources