베스트 셀러는 어떻게 결정됩니까?수량 대신 주문 수를 기반으로 할 수 있습니까?[닫은]

magento.stackexchange https://magento.stackexchange.com/questions/108257

  •  29-09-2020
  •  | 
  •  

문제

저는 BestSeller가 결정되는 방법을 알고 싶습니다. 그것은 단순히 주문한 제품의 양을 기반으로합니까? 제품에 대해 얼마나 많은 주문 수를 기반으로 할 수 있습니까?

예를 들어 제품 1은 500 정도의 수량이며 제품 2는 주문할 수있는 최소 수량이 없습니다. 제품 1의 500 개 주문을 주문한 다음 5 개의 제품 2의 5 개를 총 10 개월로 주문하십시오. 제품 2를 500으로 제품 1에 반대하는 것으로 보이는 베스트셀러를 보는 베스트 셀러 섹션 설정을 가질 수 있습니까?

도움이 되었습니까?

해결책

Best Sellers는 수량 주문 된 수정에보고됩니다. 판매 보고서에서 생성 된 SQL 쿼리를 보면서이 문제를 볼 수 있습니다.(참고 아래 SQL은 SQL이 내 동적 카테고리 제품 확장이지만 그것의 핵심은 동일합니다)

SELECT 
    SUM(order_items.qty_ordered) AS `ordered_qty`,
    `order_items`.`name` AS `order_items_name`,
    `order_items`.`product_id` AS `entity_id`,
    `e`.`entity_type_id`,
    `e`.`attribute_set_id`,
    `e`.`type_id`,
    `e`.`sku`,
    `e`.`has_options`,
    `e`.`required_options`,
    `e`.`created_at`,
    `e`.`updated_at`
FROM
    `sales_flat_order_item` AS `order_items`
        INNER JOIN
    `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id
        AND `order`.state <> 'canceled'
        AND (`order`.created_at BETWEEN '2014-11-15 0:00:00' AND '2016-03-29')
        LEFT JOIN
    `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped' , 'configurable', 'bundle'))
        AND e.entity_id = order_items.product_id
        AND e.entity_type_id = 4
        INNER JOIN
    `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id
        AND product_website.website_id IN ('1')
WHERE
    (parent_item_id IS NULL)
        AND (e.entity_id IN (SELECT DISTINCT
            `e`.`entity_id`
        FROM
            `catalog_product_entity` AS `e`
        GROUP BY `e`.`entity_id`))
GROUP BY `order_items`.`product_id`
HAVING (SUM(order_items.qty_ordered) > 0)
ORDER BY `ordered_qty` DESC , `order_items_name` ASC
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top