The WordPress plugin WooCommerce allows me to overwrite any of its files by making a copy of that file and placing it in my child theme directory. This does not work for other plugins.
How does this functionality work for WooCommerce?
Why doesn't it work for other plugins?
How can I make it work for other plugins?
Not all plugins need this functionality so it is not standard, it's just something you can allow your plugins users to do if it is relevant to its functionality / theming.
There is a great article here on how to achieve it for your own plugins, however you cannot apply this to existing plugins unless you want your copy of an existing authors work to fall out of date.
http://jeroensormani.com/how-to-add-template-files-in-your-plugin/
How does this functionality work for WooCommerce?
The magic is in the coding of Woocommerce. They have added functionalities in to cater for this because of the technicality of their system and the demand for customization.
Why doesn't it work for other plugins?
Woocommerce have added this functionality within their development to cater for this functionality, simply said other plugins have not added this functionality to extend or customize their add-ons.
How can I make it work for other plugins?
The answer to this is hooks. The same way plugins "HOOK" onto wordpress, you can create a hook to do the same for the plugin. Have a search at "custom hooks"
This is because WooCommerce has implemented this functionality in their plugin.
Overwriting plugins is not a Wordpress core functionnality.
You can't overwrite a custom plugin, the only way is to duplicate his content creating a new plugin, and customize this new plugin made by yourself..
Related
I have been working with the Woo Commerce plug-in which allows to override its templates by placing a new version of them in a /woocommerce folder at the directory of a theme.
However, I can't seem to do the same when I need to override markup for th particular Woo Commerce Gateway Paypal Express Checkout plug-in. Am I missing something? I noticed that markup is directly built in classes which is slightly different to how Woo Commerce arranges it with templates.
The markup I want to override allows for the order confirmation and payment confirmation pages to be customized. These seem to render with page.php. But the markup is present across various files in the plug-in.
I am considering creating a copy of the plug-in and add my own overrides but as I understand this comes at a cost of future updates.
For context no layout plugins like Div or Elementor are being used, this is a theme written from scratch that makes use of .twig templates.
Any thoughts or information on how to go about this would be deeply appreciated.
I am new to Wordpress/WooCommerce and PHP, although I have experience in other web platforms and languages.
I have read numerous articles about adding code to WooCommerce and where to place your code, and of course there are many different answers.
It seems that the most common answers are to place you code in the child themes functions file, while others say that you should create your own plug-in and place the code there.
I am leaning toward my own plug-in so that if the theme is updated or changed, the code wont be lost.
Can a hook (created by calling add_action()) and it's associated function be
created in my own plug-in?
Thanks,
Eric
Yes, you can override actions/filters of wordpress or any other plugin via your plugin.
Apart from that, if you use child theme (inheriting parent theme) you do not loose the customization you have made via child theme even when the parent theme is updated.
If the theme is changed all together, there is possibility that your customization may behave different as the actions/hooks can be used differently in themes.
Hope this helps.
I have created a custom module for the backend. Now I need to configure an admin template for my custom module.
I am able to create a new template for the frontend in magento. But I still don't understand, how to create a new theme for the admin side.
And also, I have designed my own header, footer and sidebars (left and right) for my new admin theme.
Can anyone help me with this?
See the following link from Inchoo. They have an excellent module solution for creating a custom admin theme, without chopping up the default one. Its ridiculously simple as well. Its also upgrade proof. I used it to add a few more attribute selections to the product list.
http://inchoo.net/ecommerce/magento/custom-admin-theme-in-magento/
You then just create your theme in /var/www/app/design/adminhtml/default/NAMEOFYOURTHEME
You can also just make css tweaks by adding /var/www/skin/adminhtml/default/NAMEOFYOURTHEME/custom.css (which is located in the default theme, so override it)
I knew that we can create child themes for wordpress. But i want to know can we create child plugins. The reason for this is i want to insert some text or something to the existing plugin without touching the plugin files. So my changes will not be affected while upgrading the plugin. Please advice it is possible or not. Thanks
Use hooks & filters to modify your plugin function from your theme's functions.php. So it won't be affected at plugin upgrade time.
Have a look # PluginAPI
there is no "child" plugin in wordpress... just create a separate plugin to do what you want it to do. It sounds like you would need to use a filter.
I have installed the shopp plugin for WordPress.
I have also purchased the FlexiShop theme (which is primarily for the wp e-commerce plugin).
The issue I'm having is with integrating the Flexishop theme with the shopp plugin. I know Flexishop was built for wp e-commerce, however, e-commerce is limited in its functionality, which is why I have now gone with shopp.
I purchased the theme and I don't want it to go to waste.
Has anyone achieved something similar or could they point me in the right direction to get this theme to work with shopp plugin?
Thanks!
I would assume that the synergies between two different plugins like those two are very few. If you really like the way your theme looks though, you can always grab its markup code a reconstruct the theme with Shopp template tags & functions.
Approaching this is a lot like making a new theme entirely. You would need to know HTML, CSS and PHP; If you do, the job can largely be reduced to copy & paste by downloading a theme for Shopp and then work through template file by template file, replacing the existing markup code with the one from you theme. But be aware that if Shopp has functionality that was not included in WP E-commerce, your theme will likely not have provided styles for it.