[英]Sonata ecommerce product list error
I sucessfully installed the sonata ecommerce bundle into my project. 我成功地将奏鸣曲电子商务套装安装到我的项目中。 But when I go into the product list from the admin dashboard I get the following error from doctrine. 但是,当我从管理仪表板进入产品列表时,我从doctrine获得以下错误。
An exception occurred while executing 'SELECT count(DISTINCT p0_.id)
AS sclr0 FROM product__product p0_ LEFT JOIN product__product_category p1_ ON p0_.id = p1_.product_id LEFT JOIN classification__category c2_ ON p1_.category_id = c2_.id LEFT JOIN product__product_collection p3_ ON p0_.id = p3_.product_id LEFT JOIN classification__collection c4_ ON p3_.collection_id = c4_.id WHERE p0_.product_type IN ()':
I dont know whats going on as media bundle and categories seems to be working fine so far. 我不知道最新情况是什么媒体包和类别似乎到目前为止工作正常。
Pretty simple actually. 其实很简单。 I stumbled upon this problem as well. 我偶然发现了这个问题。
Create a Product type ( http://sonata-project.org/bundles/ecommerce/master/doc/reference/tutorials/create-product.html ) php app/console sonata:product:generate Bowl sonata.ecommerce_demo.product.bowl 创建产品类型( http://sonata-project.org/bundles/ecommerce/master/doc/reference/tutorials/create-product.html)php app / console sonata:product:generate Bowl sonata.ecommerce_demo.product.bowl
import all resources 导入所有资源
This being done, edit the src/Application/Sonata/ProductBundle/Entity/Bowl.php to make it inherits the Product class. 这样做,编辑src / Application / Sonata / ProductBundle / Entity / Bowl.php使其继承Product类。
class Bowl extends Product { class Bowl extends Product {
} }
Note: don't forget to import sonata_product.yml(which isn't mentioned in the doccumentation). 注意:不要忘记导入sonata_product.yml(在doccumentation中没有提到)。 Add - { resource: sonata/sonata_product.yml }
to your config.yml 将- { resource: sonata/sonata_product.yml }
到config.yml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.