0

我想从多商店网站获取特定商店的所有级别类别。我怎样才能得到这个。

直到现在我一直遵循这个

    <?php
    require_once('app/Mage.php'); //Path to Magento
    umask(0);
    Mage::app("default");

    $category = Mage::getModel('catalog/category');
    $tree = $category->getTreeModel();
    $tree->load();
    $ids = $tree->getCollection()->getAllIds();  

    $path = Mage::getBaseDir();

    $fp = fopen($path.'/media/stageAllLevelCategories.csv','w');

    if ($ids)
    {
        foreach ($ids as $id)
        {
             $cat = Mage::getModel('catalog/category');
             $cat->load($id);
             if($id != 3): 

                     $name = $cat->getName();
                     echo " ";
                     $catId = $cat->getId();
                     echo "</br>";              
                  fputcsv($fp,array($name,$catId ),',','"');
             endif;
        }
    }    
fclose($fp);
?>
4

1 回答 1

0
$collection_orders = Mage::getModel('mycomp_logistic/myorder')->getCollection()
                        ->addAttributeToSelect('*')
                        ->addAttributeToFilter('customer_id', array('in' => array_values($arrayCustomersId)))
                        ->addAttributeToFilter('payment_done_online', array('eq' => ($filter['is_from_where'] == 'from_web')))
                        ->addAttributeToFilter('pdv_ritiro_id', array('eq' => $filter['pdv_ritiro_code']))
                        ->addAttributeToFilter('pdv_ordinante_id', array('eq' => $filter['pdv_ordinante_code']))
                        ->addAttributeToFilter('rif_ordine_vsp', array('eq' => $filter['num_ord']))
                        ->addAttributeToFilter('data_ordine', array('from' => $daydate))
                        ->addAttributeToFilter('num_bolla', array('eq' => $filter['cod_bolla']))
                        ->addAttributeToFilter('sscc', array('eq' => $filter['sscc']))
                        ->addAttributeToFilter('stato', array('eq' => $filter['st_art']));

         $collection_orders->getSelect()->joinLeft(  array('myarticle' => '<table_name>'),
            'myarticle.rif_ordine_vsp = main_table.rif_ord_app',
             array('*'));    

希望这对你有用。:)

于 2014-02-10T12:05:30.680 回答