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.
Related
I recently updated my dev magento site with a new theme, configured it and selected it as the theme in the admin panel. However when i go to the front end it is still using all of the old pages for the main content but the header and footer are the new theme.
Image of theme selection
please have a look at your theme folder path. If it is app/design/frontend/intenso/default/
Then you have to use Current Package Name Under Package as intensio(your-theme-name) & Under Themes use Default as default
For more detail, check screenshot:
Screenshot explainig solution for showing old theme
Hope it helps
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
I've been working on customizations to a theme via a child theme and so far all has been well.
The Parent theme users the new customizer (files in inc/customizer) for visual theme settings in the wp-admin GUI.
When trying to replace these files the child theme simply doesn't override the parent themes files. Is this not possible?
If so. How would I go about adding options to the customizer or overriding the functions in these files?
Seems like noone has alot of knowledge about how this actually works or what files are actually overrridden.
However. The correct method of overriding a function in a file that isn't automaticly overridden via filename is to just load that function into functions.php. Ugly, but it does work.
I can't for the life of me manage to override the main shop page.
My understanding is that it's archive-product.php
I've attempted to copy it into the Woocommerce directory I created in my theme's root directory and modify it. No dice.
I've also attempted to modify it directly in the Woocommerce plugin directory. No dice there either.
I've even gone as far as adding an underscore before the archive-product.php file name in both locations (woocommerce directory and my theme template directory) in an attempt to hopefully BREAK it - just to see if I could impact SOME change - and that doesn't seem to have any effect either.
I'm not running any cache plugins and every other Woocommerce template file I've attempted to modify up until this point has worked fine.
Any ideas?
You are doing this correctly. You'll have to double check the locations as per:
Shop template is in
plugins/woocommerce/templates/archive-product.php
You can copy to my-themes/woocommerce/archive-product.php to
override the core woocommerce file.
I just had the same issue,
What worked for me, is removing the woocommerce.php file, because before, it applied the template woocommerce.php to the shop, and not the archive-product.
The answer is that when you updated to the newest version of WooCommerce, you have to "reinstall" the WooCommerce pages because the old system did not use the wc_get_page_id() function, which looks for the shop page.
Luckily this is super easy! Go to your admin, then to WooCommerce, then to System Status, then click on the Tools tab. Then click the button to the right of Install WooCommerce Pages. This will only install the missing WooCommerce pages and, get this, will reinstall the shop page with the proper wc_get_page_id.
NOTE: if you have content in the original WordPress shop page, although it didn't erase it for me, you might just want to copy the content first just in case.
I was able to fix this by using the suggestion here - Changes on archive-product.php doesn't work
but, it seems like a bug to me. WooCommerce claims that you need that root woocommerce.php page in order to incorporate the plugin into your custom theme - http://docs.woothemes.com/document/third-party-custom-theme-compatibility/ - but, this does work.
I'd love to know the reasoning behind this.
Switching to the twentyeleve/twentytwelve theme's and trying to override the archive-product.php file in the same fashion worked great, but they don't include a native woocommerce.php file in their root directory either. What gives?
I have attempted to upgrade Opencart 1.4.8 with custom theme using update script but it deleted the custom theme as it was actually set as default theme. How can I prevent this from happening so I can use this same theme for new version 1.5.1.2?
Also will this custom theme be compatible with 1.5.1.2 version?
No, it wont. The only way to stop it is to create a custom theme and set it to that. You don't need to copy all files over, but a few usually like header.tpl, footer.tpl and a stylesheet, then if you make any customisations, either use vQmod or create that tpl file in your theme folder, and copy the content over, then edit