2011-05-02 70 views
0

有誰知道我可以從哪裏開始嘗試從未註冊的用戶那裏獲取購物車信息。我希望能夠從沒有登錄的人那裏看到放棄購物車的情況。這似乎不是magento的默認功能,但我有一種感覺,它在某處的數據庫中。在Magento中跟蹤未註冊的放棄購物車

回答

0

如果有人有興趣,這是我想出了越來越直接放棄購物車的物品從數據庫的SQL查詢。你需要改變我已經檢查日期

SELECT quote_id, sku, qty, price, custom_price, row_total, created_at, product_id, store_id 
FROM mage_sales_flat_quote_item 
WHERE created_at > "2011-04-01" 
AND quote_id NOT IN (SELECT quote_item_id AS quote_id FROM mage_sales_flat_order_item) 
AND store_id IS NOT NULL 
1

所有報價都存儲在sales_flat_quote表

0

此查詢,找到一個或兩種情況下,一些成果中丟失了結果,但顯示了Magento的廢棄車的報告。這是我試過的。

SELECT entity_id, customer_firstname, customer_email, items_count, grand_total, created_at 
FROM sales_flat_quote 
WHERE entity_id NOT IN (SELECT quote_item_id AS quote_id FROM sales_flat_order_item) 
AND items_count >0 
AND customer_email IS NOT NULL 
ORDER BY `sales_flat_quote`.`created_at` DESC 
0

這更像是它。

SELECT `main_table`.*, GROUP_CONCAT(item.sku) AS `skus`, (main_table.base_subtotal_with_discount*main_table.base_to_global_rate) AS `subtotal`, `cust_email`.`email`, `cust_fname`.`value` AS `firstname`, `cust_lname`.`value` AS `lastname`, CONCAT_WS(' ', cust_fname.value, cust_lname.value) AS `customer_name` FROM `sales_flat_quote` AS `main_table` 
INNER JOIN `sales_flat_quote_item` AS `item` ON item.quote_id = main_table.entity_id 
INNER JOIN `customer_entity` AS `cust_email` ON cust_email.entity_id = main_table.customer_id 
INNER JOIN `customer_entity_varchar` AS `cust_fname` ON cust_fname.entity_id = main_table.customer_id AND cust_fname.attribute_id = 5 
INNER JOIN `customer_entity_varchar` AS `cust_lname` ON cust_lname.entity_id = main_table.customer_id AND cust_lname.attribute_id = 7 WHERE (items_count != '0') AND (main_table.is_active = '1') AND (main_table.created_at >= '2013-02-04 00:00:00' AND main_table.created_at <= '2013-02-04 24:00:00') AND (main_table.updated_at >= '2013-02-04 00:00:00' AND main_table.updated_at <= '2013-02-04 24:00:00') GROUP BY `item`.`quote_id` ORDER BY updated_at DESC