override wedevs-dokan-plugin template file from theme wordpress - php

I'm using the wedevs-dokan-plugin (wedevs.com/dokan) for a WordPress frontend user store, which allows sellers to manage their store from the frontend.
I want to override one of the template files of this plugin. The file which I want to override is located at:
plugins/wedevs-dokan-plugin/templates/product-edit.php
And to override this file, I copied the file and made some changes, putting this new file in the theme directory like this:
themes/mytheme/wedevs-dokan-plugin/product-edit.php
But this isn't working for me. After that I also tried:
themes/mytheme/wedevs-dokan-plugin/templates/product-edit.php
But that's also not working.
Is there any way to override the plugin files from within a WordPress theme?

themes/mytheme/wedevs-dokan-plugin/product-edit.php
Instead of "wedevs-dokan-plugin" the directory name should be "dokan" and you can only edit the "templates" directory files of this plugin.
So, the new directory will look like these.
themes/mytheme/dokan/store.php
themes/mytheme/dokan/dashboard/dashboard.php
Thanks

Related

PrestaShop 1.7 override src file in own module

I create own module and I want to override some file so in views folder I create folder PrestaShop and in it I add complete path to file like Admin/Catalog/Product/List/somefile.php and this override works, but when I want override file from src folder there is nothing happend. For example I want to override file public_html/src/Adapter/Product/PriceCalculator.php so in my module I have public_html/modules/mycustommodule/views/PrestaShop/src/Adapter/Product/PriceCalculator.php and this is not work. There is any possibility to override those files?
I think that is not possible to override this folder, you can't overrides of other things than classes/controllers/modules with /override/ directory is not available anymore.
You can reed informations about that in their post : planned to ovverride

Magento2 : How can override vendor/module-catalog to magento default theme?

I am trying to override vendor/magento/module-catalog/* ( * for whole module ).
I copied,
vendor/magento/module-catalog/view/templates/*
files under
app/design/frontend/Magento/Magento_Catalog/*
But I can't get any change of copied files. I don't have any custom theme.
How can I do this? I want to keep original files unchanged with my custom changes.
You can override all files from vendor to our theme using below method.
Goto vendor\magento\module-catalog\view\frontend
Copy all folders and files to
app\design\frontend\{Your_vendor}\{Theme_name}\Magento_Catalog
Clear your cache using below command.
php bin/magento cache:clean
Refresh your page you can see files from your theme.
You can use this as a theme.
app/design/frontend/Magento/Magento_Catalog/
First, you have to create your own theme containing folder like:
app/design/frontend/Mytheme/Theme/Magento_Catalog
And select the theme from admin.
Then this folder will override core module_catalog

How to override this WordPress plugin template file

So in plugins/yith-woocommerce-ajax-search/templates/yith-woocommerce-ajax-search.php, there is a line I want to change in the label, from "Search for:" to "Search". If I change it in this file, it's fine, but of course I want to keep the change in my own theme rather than modify it here.
So, I copied the entire plugin folder over into my theme folder and made the change, but it's not working. The path is themes/MYTHEME/yith-woocommerce-ajax-search/templates/yith-woocommerce-ajax-search.php
Any clues why this isn't working?
The plugin uses wc_get_template() to load yith-woocommerce-ajax-search.php. This means that you can put the template file directly in the themes/YOURTHEME/woocommerce/ directory, then your template should be loaded correctly.

WooCommerce: Can't find woocommerce/templates/ directory

I am trying to set up a shop for my site using WooCommerce. My goal is removing the "Product Categories" (and maybe "Search" box) on product archive/shop base page. I know editing the "product-archive.php" file is required. But I just can't find it! It should be somewhere in woocommerce/templates/ directory, but there's no such directory!
I'm using Fruitful theme by Fruitfulcode. I'm using the latest versions of WordPress and WooCommerce. I tried virtually anything: installing and reinstalling WooCommerce, installing an older version of WooCommerce... Nothing works. There's no woocommerce/templates directory anywhere in my theme!
Could you please assist me? Am I doing something wrong?
I think you're a bit confused about how WooCommerce template overrides work. Here's some important info you should be aware of:
Installing WooCommerce won't modify your theme at all.
You shouldn't have a woocommerce/templates/ directory in your theme, even if the theme is overriding default WooCommerce templates. Rather, you may have a woocommerce/ directory (without the templates/ directory).
WooCommerce templates are overridden by copying template files from /wp-content/plugins/woocommerce/templates/xxx.php to wp-content/themes/yourtheme/woocommerce/xxx.php
If you aren't seeing a woocommerce directory in your theme, that means that your theme is using the default WooCommerce templates. If you would like to override them, you need to copy the product-archive.php template from the WooCommerce plugin templates directory into a woocommerce/ directory within your theme.
More info in the WooCommerce documentation.
Reading your answer twice I think you may be speaking of widgets since you mention categories and search box. This is usually in the sidebar. You don't need to edit woocommerce template files to change this.
Look for the widget that is being displayed on the archive pages and remove the ones you don't need.
Go to Appearance/widgets and look for the sidebar that is being displayed on the shop and delete the unwanted elements.
You could also use the customizer to view it visually while doing it.
Hope this helps
Im sorry if this doesn't help answer your question but the file you're looking for is archive-product.php not product-archive.php, this is the second question I've seen with this non-existent file mentioned.
If a child theme is being used, the absolute path to the parent theme directory will be returned. Use get_stylesheet_directory() to get the absolute path to the child theme directory.
You need to use get_stylesheet_directory_uri() instead of get_template_directory() in your child theme.
echo get_template_directory()
/*Retrieve theme directory URI.*/
get_template_directory_uri()
require get_theme_file_path( 'inc/post-types.php' );
By default, there won't be any woocommerce fil s inside your theme folder. If you want to customize the Woocommerce tempalte files, you need to copy the files which you want to edit from TEMPLATES folder inside the Woocommerce plugin folder and paste inside your theme folder under folder name called WOOCOMMERCE.

ShareThis plugin on WordPress MU - default in all blogs

I have one instance of Wordpress Multiuser and need ShareThis plugin to be automatically activated in all new created blogs.
I've seen a post:
Plugins placed in wp-content/mu-plugins are automatically enabled for all blogs in the system. They cannot be turned off by the users.
When putting the plugin files into root blog (/plugins/ folder), the plugin is functional, but when putting it into /mu-plugins , the plugin is not working.
What else do i need to do to make it work?
Plugins put in /mu-plugins cannot be in folders.
/mu-plugins can only contain plugin files like what-ever-plugin.php.
The mu-plugins directory will not read plugins in a subfolder, so your ShareThis plugin must be modified to individual file to work.
Any plugin files in a subfolder will be ignored unless included in the primary plugin file.

Categories