本文整理汇总了PHP中Ess_M2ePro_Model_Magento_Product::getProductId方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Magento_Product::getProductId方法的具体用法?PHP Ess_M2ePro_Model_Magento_Product::getProductId怎么用?PHP Ess_M2ePro_Model_Magento_Product::getProductId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Magento_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Magento_Product::getProductId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareAssociatedProducts
public function prepareAssociatedProducts(array $associatedProducts)
{
if ($this->magentoProduct->isSimpleType() || $this->magentoProduct->isDownloadableType()) {
return array($this->magentoProduct->getProductId());
}
if ($this->magentoProduct->isBundleType()) {
$bundleAssociatedProducts = array();
foreach ($associatedProducts as $key => $productIds) {
$bundleAssociatedProducts[$key] = reset($productIds);
}
return $bundleAssociatedProducts;
}
if ($this->magentoProduct->isConfigurableType()) {
$configurableAssociatedProducts = array();
foreach ($associatedProducts as $productIds) {
if (count($configurableAssociatedProducts) == 0) {
$configurableAssociatedProducts = $productIds;
} else {
$configurableAssociatedProducts = array_intersect($configurableAssociatedProducts, $productIds);
}
}
if (count($configurableAssociatedProducts) != 1) {
throw new LogicException('There is no associated product found for configurable product.');
}
return $configurableAssociatedProducts;
}
if ($this->magentoProduct->isGroupedType()) {
return array_values($associatedProducts);
}
return array();
}
示例2: getSource
/**
* @param Ess_M2ePro_Model_Magento_Product $magentoProduct
* @return Ess_M2ePro_Model_Ebay_Template_Category_Specific_Source
*/
public function getSource(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$productId = $magentoProduct->getProductId();
if (!empty($this->categorySpecificSourceModels[$productId])) {
return $this->categorySpecificSourceModels[$productId];
}
$this->categorySpecificSourceModels[$productId] = Mage::getModel('M2ePro/Ebay_Template_Category_Specific_Source');
$this->categorySpecificSourceModels[$productId]->setMagentoProduct($magentoProduct);
$this->categorySpecificSourceModels[$productId]->setCategorySpecificTemplate($this);
return $this->categorySpecificSourceModels[$productId];
}
示例3: getSource
/**
* @param Ess_M2ePro_Model_Magento_Product $magentoProduct
* @return Ess_M2ePro_Model_Play_Listing_Source
*/
public function getSource(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$productId = $magentoProduct->getProductId();
if (!empty($this->listingSourceModels[$productId])) {
return $this->listingSourceModels[$productId];
}
$this->listingSourceModels[$productId] = Mage::getModel('M2ePro/Play_Listing_Source');
$this->listingSourceModels[$productId]->setMagentoProduct($magentoProduct);
$this->listingSourceModels[$productId]->setListing($this->getParentObject());
return $this->listingSourceModels[$productId];
}
示例4: getSource
/**
* @param Ess_M2ePro_Model_Magento_Product $magentoProduct
* @return Ess_M2ePro_Model_Buy_Template_NewProduct_Attribute_Source
*/
public function getSource(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$productId = $magentoProduct->getProductId();
if (!empty($this->newProductAttributeSourceModels[$productId])) {
return $this->newProductAttributeSourceModels[$productId];
}
$this->newProductAttributeSourceModels[$productId] = Mage::getModel('M2ePro/Buy_Template_NewProduct_Attribute_Source');
$this->newProductAttributeSourceModels[$productId]->setMagentoProduct($magentoProduct);
$this->newProductAttributeSourceModels[$productId]->setNewProductAttributeTemplate($this);
return $this->newProductAttributeSourceModels[$productId];
}
示例5: getSource
/**
* @param Ess_M2ePro_Model_Magento_Product $magentoProduct
* @return Ess_M2ePro_Model_Amazon_Template_Description_Specific_Source
*/
public function getSource(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$productId = $magentoProduct->getProductId();
if (!empty($this->descriptionSpecificSourceModels[$productId])) {
return $this->descriptionSpecificSourceModels[$productId];
}
$this->descriptionSpecificSourceModels[$productId] = Mage::getModel('M2ePro/Amazon_Template_Description_Specific_Source');
$this->descriptionSpecificSourceModels[$productId]->setMagentoProduct($magentoProduct);
$this->descriptionSpecificSourceModels[$productId]->setDescriptionSpecificTemplate($this);
return $this->descriptionSpecificSourceModels[$productId];
}
示例6: getSource
/**
* @param Ess_M2ePro_Model_Magento_Product $magentoProduct
* @return Ess_M2ePro_Model_Ebay_Template_Shipping_Service_Source
*/
public function getSource(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$productId = $magentoProduct->getProductId();
if (!empty($this->shippingServiceSourceModels[$productId])) {
return $this->shippingServiceSourceModels[$productId];
}
$this->shippingServiceSourceModels[$productId] = Mage::getModel('M2ePro/Ebay_Template_Shipping_Service_Source');
$this->shippingServiceSourceModels[$productId]->setMagentoProduct($magentoProduct);
$this->shippingServiceSourceModels[$productId]->setShippingServiceTemplate($this);
return $this->shippingServiceSourceModels[$productId];
}
示例7: getSource
/**
* @param Ess_M2ePro_Model_Magento_Product $magentoProduct
* @return Ess_M2ePro_Model_Ebay_Template_Description_Source
*/
public function getSource(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$productId = $magentoProduct->getProductId();
if (!empty($this->descriptionSourceModels[$productId])) {
return $this->descriptionSourceModels[$productId];
}
$this->descriptionSourceModels[$productId] = Mage::getModel('M2ePro/Ebay_Template_Description_Source');
$this->descriptionSourceModels[$productId]->setMagentoProduct($magentoProduct);
$this->descriptionSourceModels[$productId]->setDescriptionTemplate($this->getParentObject());
return $this->descriptionSourceModels[$productId];
}