Is it possible for my overridden local.xml to indicate that the parent file should be ran as well?
No. Unfortunately for local.xml
the same fallback mechanism applies as for all other theme files, i.e. the first one in the theme inheritance tree is used and there is no way to include a parent explicitly.
Or is there a better way to accomplish what I'm trying to do in general?
Yes, but it's still not ideal. Since Magento 1.9 you can use theme.xml
for layout updates and it is actually the preferred way over local.xml
. (Read more: https://erfanimani.com/dont-use-local-xml/)
If the purchased theme uses only local.xml
and no layout updates in theme.xml
, you can use theme.xml
for your own changes. But note that theme.xml
is loaded before local.xml
, so if the order of actions matters, this might not work for you.
What if the parent uses theme.xml
for layout updates as well? Now, the layout updates of parent theme.xml
files are not loaded either, but since theme.xml
works different than local.xml
, there is a fix for that: https://github.com/ericthehacker/magento-themefallbackfix
And there is another option, which is probably the "right" way: You can also define layout files in theme.xml
. You'll still need to copy these definition for child themes but that's only a few lines.
Example
mytheme/default/etc/theme.xml
<theme>
<parent>base/default</parent>
<layout>
<updates>
<mytheme_default><file>mytheme_default.xml</file></mytheme_default>
</updates>
</layout>
</theme>
mytheme/child/etc/theme.xml
<theme>
<parent>mytheme/default</parent>
<layout>
<updates>
<mytheme_default><file>mytheme_default.xml</file></mytheme_default>
<mytheme_child><file>mytheme_child.xml</file></mytheme_child>
</updates>
</layout>
</theme>
Best Answer
For example, We have our folder structure of current theme:
We should focus four files:
Layout
Template:
We can create our own custom jQuery plugin.
Create a RequireJS configuration file.
Clear Magento Cache and run static content deploy:
We can read more here how to create custom Javascript: http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html