2
나는 Magentor gem을 사용하려고합니다. 문서가 매우 약합니다. 나는 Magento::Category.info(1)
에게 전화를 성공했다.Magentor gem을 사용하는 방법
그러나 Magento::Category.create(args)
에 전화하지 못했습니다.
메소드 정의는 다음과 같습니다.
# catalog_category.create
# Create new category and return its id.
#
# Return: int
#
# Arguments:
#
# int $parentId - ID of parent category
# array $categoryData - category data (array(’attribute_code’⇒‘attribute_value’)
# mixed $storeView - store view ID or code (optional)
def create(attributes)
id = commit("create", attributes)
record = new(attributes)
record.id = id
record
end
는 여기에 내가 뭘하려합니다. (부모 ID가 1)
args = [1, {:name => 'Cars', :description => 'Great Cars', :is_active => '1', :url_key => 'cars'}]
category_id = Magento::Category.create(args)
exception: 1 -> SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)
아무도 메서드를 호출의 예를 제공 할 수 있습니까?
흥미로운 프로젝트처럼 보인다. 생성 된 rdocs는 실제로 예상보다 훨씬 좋아 보인다. – pguardiario