2016-10-10 71 views
1

我正在使用奏鳴曲電子商務套裝。在安裝捆綁軟件並且它的依賴成功之後,我按照預期得到了管理儀表板頁面。索納塔產品列表錯誤(索納塔電子商務套裝)

但是,當我點擊產品的「添加新」選項時,我得到一個空白塊,沒有字段或按鈕。這裏是截圖 enter image description here

但是,這不是。當我點擊了產品的「列表」選項,我獲得以下錯誤

An exception occurred while executing 'SELECT count(DISTINCT p0_.id) AS sclr_0 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()': 

SQLSTATE [42000]:語法錯誤或訪問衝突:1064您的SQL語法錯誤;檢查與您的MySQL服務器版本相對應的手冊,以便在第1行'''附近使用正確的語法。

在淘金上,我在github上發現了一個帖子(https://github.com/sonata-project/ecommerce/issues/9)。我遵循了建議的解決方案即。

  • 創建使用php app/console sonata:product:generate Bowl sonata.ecommerce_demo.product.bowl
  • 進口創建app/config/sonata/sonata_product.yml資源
  • 如圖所示的文件
  • 在最後做成碗類繼承的產品類中的產品類型(碗)

我仍然有同樣的錯誤。

這裏是我的Bowl.php

<?php 

/* 
* This file is part of the <name> project. 
* 
* (c) <yourname> <youremail> 
* 
* For the full copyright and license information, please view the LICENSE 
* file that was distributed with this source code. 
*/ 

namespace Application\Sonata\ProductBundle\Entity; 

//use Sonata\ProductBundle\Entity\Product as Product; 

/** 
* This file has been generated by the Sonata product generation command (https://sonata-project.org/) 
* 
* References : 
* working with object : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en 
* 
* @author <yourname> <youremail> 
*/ 
class Bowl extends Product { 

    /** 
    * @var integer $id 
    */ 
    protected $id; 

    /** 
    * Get id 
    * 
    * @return integer $id 
    */ 
    public function getId() { 
     return $this->id; 
    } 

    /** 
    * @param int $id 
    */ 
    public function setId($id) { 
     $this->id = $id; 
    } 

} 

任何想法?

回答

1

想通了:

創建一個產品類型(http://sonata-project.org/bundles/ecommerce/master/doc/reference/tutorials/create-product.html)PHP應用程序/控制檯奏鳴曲:產品:生成碗sonata.ecommerce_demo.product.bowl

進口的所有資源

這正在做,編輯src/Application/Sonata/ProductBundle/Entity/Bowl.php使其繼承Product類。

碗類產品擴展{

}

注意:不要忘記導入sonata_product.yml(未在doccumentation提到)。將 - {resource:sonata/sonata_product.yml}添加到您的config.yml中