0

私のショッピング サイトには 100 個の商品があります。その中から1品を選びました。その製品のユーザー ID を取得するにはどうすればよいですか?

私はまだこれでもっと多くのことをしなければなりません、そしてこれは売り手ページにあります.

このコードを試しましたが、うまくいきませんでした。

<?php 
    $product_id = $this->getProduct()->getId();
    echo $product_id; // It's displaying Product ID
    $productowner=Mage::getModel('marketplacepartner/marketplacepartner')->isCustomerProducttemp($product_id['entity_id']);
    if($productowner['productid']!=""){
        $rowsocial=Mage::getModel('marketplaceprofile/marketplaceprofile')->getPartnerProfileById($productowner['userid']);
    }
?>

Magento CE 1.7.0.2 を使用しています

この製品の所有者 ID を取得する必要があります

何か案は ?

4

4 に答える 4

0

マーケットプレイス拡張機能を使用している場合は、これを試すことができます

$_marketProduct=Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('adminassign',array('eq'=>1))->addFieldToFilter('mageproductid','product_id');
foreach($_marketProduct as $_mp){
            $_vendorId =$_mp->getuserid();             
            $_customerDetails = Mage::getModel('customer/customer')->load($_vendorId);
            print_r($_customerDetails);           }

product_id を変更することを忘れないでください

于 2015-12-03T10:48:41.337 に答える
-1

('marketplacepartner/marketplacepartner')に変更('marketplace/Userprofile') _ ('marketplaceprofile/marketplaceprofile')_('marketplace/Userprofile')

お気に入り

$product_id = $this->getProduct()->getId();
//echo $product_id; // It's displaying Product ID
$productowner=Mage::getModel('marketplace/Userprofile')>isCustomerProducttemp($product_id['entity_id']);
if($productowner['userid']!=""){
  $rowsocial=Mage::getModel('marketplace/Userprofile')->getPartnerProfileById($productowner['userid']);
}
$customer=Mage::getModel('customer/customer')->load($productowner['userid']);

echo $customer->getName();
于 2015-02-25T10:54:44.597 に答える