drpp5680 2012-05-01 15:18 采纳率: 0%
浏览 43

如何加载Magento产品并查找分配给它的商店

I've been asked to reverse engineer some orders (from an Ebay Extension) and find out which store they really used.

To flesh out an example; we run several stores from one Magento backend selling various products. These are all sold on eBay using a single merchant account.

So what I need to do is load the order as it stands assigned against the eBay store, load the items attached to that order and then see what other stores that item is used on. Once I get that far I can simply filter out the admin storeID and the eBay storeID which will leave with the store I'm looking for.

this is what I have so far:

foreach($collection->getItems() as $order):
   // need to do this to load correct order information
   $order = Mage::getModel('sales/order')->loadByIncrementID($order->getIncrementId());
   $items = $order->getItemsCollection();
   foreach($items as $item) {
      // need to do this to get the actual item, not the item on the order
      $item = Mage::getModel('catalog/product')->load($item->getItemId());
      // do something to get the other store ids
   }
endforeach;
  • 写回答

2条回答 默认 最新

  • dongwo5940 2012-05-01 15:45
    关注

    try this

    $item = Mage::getModel('catalog/product')->load($item->getItemId());
    
    $storeId = $item->getStoreId();
    

    this works just fine for me.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用