0

How can we apply full join between reports/product_collection and catalog/product_collection.

$products = Mage::getResourceModel('reports/product_collection');
$products->getSelect()->join('catalog_category_product','main_table.product_id = report_viewed_product_index.entity_id', array('category_id'))
        ->where("catalog_category_product.product_id = report_viewed_product_index.entity_id");
        $products->addFieldToFilter('created_time', array('gt' => Mage::getModel('core/date')->date('Y-m-d H:i:s', strtotime('-1 week'))))
        ->addAttributeToSelect('*')
        ->setStoreId($storeId)
        ->addStoreFilter($storeId)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.