I am using wordpress and plugin WooCommerce I need to change order of things on product page to: title with price in one row, then product description, and finally in last row number of pieces and add to cart button. I was trying to rewrite almost everything in WooCommerce templates but I can't do it. (I got woocommerce folder in my template folder.
我正在使用wordpress和插件WooCommerce我需要将产品页面上的事物顺序更改为:标题包含一行中的价格,然后是产品描述,最后是最后一行的数量并添加到购物车按钮。我试图在WooCommerce模板中重写几乎所有内容,但我不能这样做。 (我的模板文件夹中有woocommerce文件夹。
1 个解决方案
#1
1
first of all, to override any of the woocommerce template files, you need to follow appropriate directory structure within your theme folder.
首先,要覆盖任何woocommerce模板文件,您需要在主题文件夹中遵循适当的目录结构。
In your case, you would want to override template files that are responsible for the display of single product page i.e. woocommerce/templates/single-product/
在您的情况下,您可能希望覆盖负责显示单个产品页面的模板文件,即woocommerce / templates / single-product /
Now to override the template file in your theme, follow below directory structure
现在要覆盖主题中的模板文件,请按照以下目录结构
your-theme-folder/woocommerce/single-product/<file.php>
If you are using child-theme (recommended) then,
如果您使用的是儿童主题(推荐),那么,
your-child-theme-folder/woocommerce/single-product/<file.php>
Also there is a way to override woocommerce template file from plugin. For more information, read this article - http://wisdmlabs.com/blog/override-woocommerce-templates-plugin/
还有一种方法可以从插件中覆盖woocommerce模板文件。有关更多信息,请阅读本文 - http://wisdmlabs.com/blog/override-woocommerce-templates-plugin/
#1
1
first of all, to override any of the woocommerce template files, you need to follow appropriate directory structure within your theme folder.
首先,要覆盖任何woocommerce模板文件,您需要在主题文件夹中遵循适当的目录结构。
In your case, you would want to override template files that are responsible for the display of single product page i.e. woocommerce/templates/single-product/
在您的情况下,您可能希望覆盖负责显示单个产品页面的模板文件,即woocommerce / templates / single-product /
Now to override the template file in your theme, follow below directory structure
现在要覆盖主题中的模板文件,请按照以下目录结构
your-theme-folder/woocommerce/single-product/<file.php>
If you are using child-theme (recommended) then,
如果您使用的是儿童主题(推荐),那么,
your-child-theme-folder/woocommerce/single-product/<file.php>
Also there is a way to override woocommerce template file from plugin. For more information, read this article - http://wisdmlabs.com/blog/override-woocommerce-templates-plugin/
还有一种方法可以从插件中覆盖woocommerce模板文件。有关更多信息,请阅读本文 - http://wisdmlabs.com/blog/override-woocommerce-templates-plugin/