本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::addAdditionalWarningMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::addAdditionalWarningMessage方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::addAdditionalWarningMessage怎么用?PHP Ess_M2ePro_Model_Listing_Product::addAdditionalWarningMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::addAdditionalWarningMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRequestData
public function getRequestData(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params = array())
{
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return array();
}
if (!$listingProduct->getChildObject()->isListingTypeFixed()) {
$listingProduct->addAdditionalWarningMessage('The product was listed as a simple product as it has limitation for multi-variation items. ' . 'Reason: listing type "auction" does not support multi-variations.');
return array();
}
if ($listingProduct->getChildObject()->getEbaySellingFormatTemplate()->isIgnoreVariationsEnabled()) {
$listingProduct->addAdditionalWarningMessage('The product was listed as a simple product as it has limitation for multi-variation items. ' . 'Reason: ignore variation option is enabled in selling format policy.');
return array();
}
if (!$listingProduct->getChildObject()->getCategoryTemplate()->isVariationEnabled()) {
$listingProduct->addAdditionalWarningMessage('The product was listed as a simple product as it has limitation for multi-variation items. ' . 'Reason: eBay primary category allows to list only single items.');
return array();
}
$requestData = array();
// Get Request Variations Data
//-----------------------------
$productVariations = $listingProduct->getVariations(true);
foreach ($productVariations as $variation) {
/** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
$tempItem = array('price' => $variation->getChildObject()->getPrice(), 'qty' => $variation->getChildObject()->isDelete() ? 0 : $variation->getChildObject()->getQty(), 'sku' => $variation->getChildObject()->getSku(), 'specifics' => array());
$tempParamKey = 'return_variation_has_sales_key_when_qty_is_zero';
if (isset($params[$tempParamKey]) && $params[$tempParamKey] && $tempItem['qty'] <= 0) {
$temp = $variation->getChildObject()->hasSales();
$temp && ($tempItem['has_sales'] = $temp);
}
$productVariationsOptions = $variation->getOptions(true);
foreach ($productVariationsOptions as $option) {
/** @var $option Ess_M2ePro_Model_Listing_Product_Variation_Option */
$tempItem['specifics'][$option->getAttribute()] = $option->getOption();
}
$requestData[] = $tempItem;
}
//-----------------------------
return $requestData;
}
示例2: addNotFoundAttributesMessage
public function addNotFoundAttributesMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, $optionTitle, array $attributesCodes)
{
$attributesTitles = array();
foreach ($attributesCodes as $attributeCode) {
$attributesTitles[] = Mage::helper('M2ePro/Magento_Attribute')->getAttributeLabel($attributeCode, $listingProduct->getListing()->getStoreId());
}
$message = Mage::helper('M2ePro')->__('%s: attribute(s) %s were not found in this product and its value was not sent.', $optionTitle, implode(',', $attributesTitles));
$listingProduct->addAdditionalWarningMessage($message);
}