1

We are using Marketplace in my website also some product have more then one seller. Even every seller have unique SKU

In Back end Sales Order page it showing Base seller Sku Only

How to fetch Assign seller SKU

<div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?>
1
  • you need to provide markeplace code details
    – Amit Bera
    Jan 12, 2016 at 9:42

2 Answers 2

1
app/design/adminhtml/default/default/template/sales/items/column/name.phtml

to load sku you can get for order id and pass to collection

 $orderid=Mage::app()->getRequest()->getParam('order_id');
    $_collection = Mage::getModel('marketplace/saleslist')->getCollection();
        $_collection->addFieldToFilter('mageorderid',$orderid); 

        foreach($_collection as $res){
          $connectionresource = Mage::getSingleton('core/resource');
        $readconnection = $connectionresource->getConnection('core_read');




     $allrecord = $readconnection->select()->from(array('mpassignproduct'=>'marketplace_assignproduct'))->where('mpassignproduct.mpassignproduct_id_id=?', $res->getMpassignproductId()
     )
     ;
     $mpassignproduct =$readconnection->fetchAll($allrecord); 
     if(count($mpassignproduct)) {
     foreach($mpassignproduct as $assignproduct)
       { 
        $sku=$assignproduct['sku'];
       }

     }else {
    $sku=$_item->getSku();
    }}
3
1

Add bellow code in your files

<?php if ($_item = $this->getItem()): ?>
<?php $order = $_item->getOrder() ?>
<?php $collection = Mage::getModel('marketplace/saleslist')->getCollection()
    ->addFieldToFilter('mageorderid',$order->getId()); 
?>
    <h5 class="title"><span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span></h5>
    <?php foreach($collection as $res) : ?>
        <?php $connectionresource = Mage::getSingleton('core/resource');
              $readconnection = $connectionresource->getConnection('core_read');
              $allrecord = $readconnection->select()->from(array('mpassignproduct'=>'marketplace_assignproduct'))->where('mpassignproduct.mpassignproduct_id_id=?', $res->getMpassignproductId()
         );
            $mpassignproduct =$readconnection->fetchAll($allrecord); 
         ?>
         <?php if(count($mpassignproduct)):?>
                <?php foreach($mpassignproduct as $assignproduct):?> 
                    <div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?></div>
                <?php endforeach; ?>
         <?php else: ?>
                <div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?></div>
         <?php endif; ?>
    <?php endforeach; ?>

    <?php if ($this->getOrderOptions()): ?>
        <dl class="item-options">
        <?php foreach ($this->getOrderOptions() as $_option): ?>
            <dt><?php echo $_option['label'] ?></dt>
            <dd>
            <?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
                <?php echo $this->getCustomizedOptionValue($_option); ?>
            <?php else: ?>
                <?php $_option = $this->getFormattedOption($_option['value']); ?>
                <?php echo $_option['value']; ?><?php if (isset($_option['remainder']) && $_option['remainder']): ?><span id="<?php echo $_dots = 'dots' . uniqid()?>"> ...</span><span id="<?php echo $_id = 'id' . uniqid()?>"><?php echo $_option['remainder'] ?></span>
                    <script type="text/javascript">
                    $('<?php echo $_id ?>').hide();
                    $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
                    $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_dots?>').hide();});
                    $('<?php echo $_id ?>').up().observe('mouseout',  function(){$('<?php echo $_id ?>').hide();});
                    $('<?php echo $_id ?>').up().observe('mouseout',  function(){$('<?php echo $_dots ?>').show();});
                    </script>
                <?php endif; ?>
            <?php endif; ?>
            </dd>
        <?php endforeach; ?>
        </dl>
    <?php endif; ?>
    <?php echo $this->htmlEscape($_item->getDescription()) ?>
<?php endif; ?>
0

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.