【问题标题】:Magento sort items orderedMagento 对订购的项目进行排序
【发布时间】:2013-01-28 19:55:36
【问题描述】:

当我在:index.php/admin/sales_order/view/order_id/[ID]/key/[KEY]/ 我可以看到:“Items Ordered”

我正在查找此表中加载产品的代码。我想按 SKU 对订购的商品进行排序。

有什么提示吗?

PS: 我正在查看 app/code/core/Mage/Adminhtml/Block/Sales/Order/View 但找不到任何东西。

【问题讨论】:

    标签: magento skus


    【解决方案1】:
    $collection->getSelect()->join(array(
                'item'=>$collection->getTable('sales/order_item')),
                'item.order_id=`main_table`.entity_id AND item.product_type="simple"',
                array(
                    'skus' => new Zend_Db_Expr('group_concat(item.sku SEPARATOR ", ")'),
                    'name' => new Zend_Db_Expr('group_concat(item.name SEPARATOR ", ")')
                ));
    
    $this->addColumn('skus', array(
                'header' => Mage::helper('sales')->__('SKU'),
                'index' => 'skus',
                'type' => 'text',
            ));
    
            $this->addColumn('name', array(
                'header' => Mage::helper('sales')->__('NAME'),
                'index' => 'name',
                'type' => 'text'
            ));
    

    【讨论】:

      【解决方案2】:

      您可以在“管理”的“管理属性”菜单中将 SKU 添加为选项。完成后,在系统 > 配置 > 目录 > 目录 > 产品列表排序方式中将其设置为默认值。

      试试this 或者你可能喜欢this

      【讨论】:

      • 谢谢。但这是前端,我的问题是关于后端的。
      • 我添加了链接,您可能会发现第二个更有用。
      • 我这里也有问题。这是一个棘手的问题...magento.stackexchange.com/questions/3719/…
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      • 2019-09-15
      • 1970-01-01
      • 2018-05-09
      • 2014-07-11
      相关资源
      最近更新 更多