本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getDescriptionTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getDescriptionTemplate方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getDescriptionTemplate怎么用?PHP Ess_M2ePro_Model_Listing_Product::getDescriptionTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getDescriptionTemplate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addImagesData
protected function addImagesData(Ess_M2ePro_Model_Listing_Product $listingProduct, array &$requestData)
{
$requestData['images'] = array('gallery_type' => $listingProduct->getGeneralTemplate()->getChildObject()->getGalleryType(), 'images' => $listingProduct->getChildObject()->getImagesForEbay(), 'supersize' => $listingProduct->getDescriptionTemplate()->getChildObject()->isUseSupersizeImagesEnabled());
}
示例2: getImagesData
public function getImagesData(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params = array())
{
if (!$listingProduct->getChildObject()->isListingTypeFixed() || !$listingProduct->getGeneralTemplate()->getChildObject()->isVariationMode() || $listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return array();
}
$tempSpecifics = array();
if ($listingProduct->getMagentoProduct()->isConfigurableType() && $listingProduct->getDescriptionTemplate()->getChildObject()->isVariationConfigurableImages()) {
$attributeCode = $listingProduct->getDescriptionTemplate()->getChildObject()->getVariationConfigurableImages();
$attributeData = $listingProduct->getMagentoProduct()->getProduct()->getResource()->getAttribute($attributeCode)->getData();
$tempProduct = $listingProduct->getMagentoProduct()->getProduct();
$configurableAttributes = $tempProduct->getTypeInstance()->setStoreFilter($listingProduct->getListing()->getStoreId())->getConfigurableAttributesAsArray($tempProduct);
foreach ($configurableAttributes as $configurableAttribute) {
if ((int) $attributeData['attribute_id'] == (int) $configurableAttribute['attribute_id']) {
$tempSpecifics = array($configurableAttribute['label'], $configurableAttribute['frontend_label'], $configurableAttribute['store_label']);
break;
}
}
}
if ($listingProduct->getMagentoProduct()->isGroupedType()) {
$tempSpecifics = array(Ess_M2ePro_Model_Magento_Product::GROUPED_PRODUCT_ATTRIBUTE_LABEL);
}
$requestData = array('specific' => '', 'images' => array());
if (count($tempSpecifics) > 0) {
$productVariations = $listingProduct->getVariations(true);
foreach ($productVariations as $variation) {
/** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
if ($variation->isDelete()) {
continue;
}
$productVariationsOptions = $variation->getOptions(true);
foreach ($productVariationsOptions as $option) {
/** @var $option Ess_M2ePro_Model_Listing_Product_Variation_Option */
$findedSpecific = false;
foreach ($tempSpecifics as $tempSpecific) {
if (strtolower($tempSpecific) == strtolower($option->getAttribute())) {
$findedSpecific = $option->getAttribute();
}
}
if ($findedSpecific === false) {
continue;
}
$requestData['specific'] = $findedSpecific;
$images = $option->getChildObject()->getImagesForEbay();
if (count($images) > 0) {
$requestData['images'][$option->getOption()] = array_slice($images, 0, 1);
/*!isset($requestData['images'][$option->getOption()]) &&
$requestData['images'][$option->getOption()] = array();
$requestData['images'][$option->getOption()] =
array_merge($requestData['images'][$option->getOption()],$images);
$requestData['images'][$option->getOption()] =
array_unique($requestData['images'][$option->getOption()]);
$requestData['images'][$option->getOption()] =
array_slice($requestData['images'][$option->getOption()],0,12);*/
}
}
}
}
if ($requestData['specific'] == '' || count($requestData['images']) <= 0) {
return array();
}
return $requestData;
}