0

I see that there are not any relationships from sales_shipping_aggregated to the sales_flat_order table. I'm trying to determine if there is a relationship to anything other than sales_shipping_aggregated_order.

What is the purpose of these two tables (ssa and ssao) and do they relate to the individual orders at all?

Background: I'm trying to merge two different Magento stores into one instance. Needing to migrate data.

  • 1
    Those tables are use for reporting (see Admin -> report -> sales -> shipping) see Mage_Adminhtml_Block_Report_Sales_Shipping_Grid – Renon Stewart Nov 4 '14 at 20:17
  • Interesting. Does the same go for the other aggregated tables? 'sales_invoiced_aggregated';, 'sales_invoiced_aggregated_order';, 'sales_order_aggregated_created'; and 'sales_order_aggregated_updated'; – sparecycle Nov 4 '14 at 20:20
  • 1
    I have not work with report that much but to my knowledge all _aggregated_ are use for report related functionality – Renon Stewart Nov 4 '14 at 20:25
  • Awesome! That at least gives me something to go on. I appreciate it. – sparecycle Nov 4 '14 at 20:26
1

Those tables are use for reporting (see Admin -> report -> sales -> shipping)

See

/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php

class Mage_Adminhtml_Block_Report_Sales_Shipping_Grid extends Mage_Adminhtml_Block_Report_Grid_Abstract
{
    ...

    public function getResourceCollectionName()
    {
        return ($this->getFilterData()->getData('report_type') == 'created_at_shipment')
            ? 'sales/report_shipping_collection_shipment'
            : 'sales/report_shipping_collection_order';
    }

/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php

class Mage_Sales_Model_Resource_Report_Shipping_Collection_Shipment
    extends Mage_Sales_Model_Resource_Report_Shipping_Collection_Order
{
    /**
     * Initialize custom resource model
     *
     */
    public function __construct()
    {
        $this->setModel('adminhtml/report_item');
        $this->_resource = Mage::getResourceModel('sales/report')->init('sales/shipping_aggregated');
        $this->setConnection($this->getResource()->getReadConnection());
    }
}

/app/code/core/Mage/Sales/etc/config.xml

<sales_resource>
    ....
    <shipping_aggregated>
       <table>sales_shipping_aggregated</table>
    </shipping_aggregated>
    <shipping_aggregated_order>
        <table>sales_shipping_aggregated_order</table>
    </shipping_aggregated_order>

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.