本文整理汇总了PHP中Ess_M2ePro_Model_Magento_Product类的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Magento_Product类的具体用法?PHP Ess_M2ePro_Model_Magento_Product怎么用?PHP Ess_M2ePro_Model_Magento_Product使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ess_M2ePro_Model_Magento_Product类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getDescription
private function getDescription(Ess_M2ePro_Model_Magento_Product $magentoProduct, Ess_M2ePro_Model_Listing_Product $listingProduct = NULL)
{
$descriptionTemplateData = $this->_getSession()->getTemplateData();
$descriptionModeProduct = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_PRODUCT;
$descriptionModeShort = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_SHORT;
$descriptionModeCustom = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_CUSTOM;
if ($descriptionTemplateData['description_mode'] == $descriptionModeProduct) {
$description = $magentoProduct->getProduct()->getDescription();
} elseif ($descriptionTemplateData['description_mode'] == $descriptionModeShort) {
$description = $magentoProduct->getProduct()->getShortDescription();
} elseif ($descriptionTemplateData['description_mode'] == $descriptionModeCustom) {
$description = $descriptionTemplateData['description_template'];
} else {
$description = '';
}
if (empty($description)) {
return $description;
}
$renderer = Mage::helper('M2ePro/Module_Renderer_Description');
$description = $renderer->parseTemplate($description, $magentoProduct);
if (!is_null($listingProduct)) {
/** @var Ess_M2ePro_Model_Ebay_Listing_Product_Description_Renderer $renderer */
$renderer = Mage::getSingleton('M2ePro/Ebay_Listing_Product_Description_Renderer');
$renderer->setListingProduct($listingProduct->getChildObject());
$description = $renderer->parseTemplate($description);
}
$this->addWatermarkInfoToDescriptionIfNeed($description);
return $description;
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:29,代码来源:DescriptionController.php
示例2: getBundleProductDynamicSpecialValue
protected function getBundleProductDynamicSpecialValue(Ess_M2ePro_Model_Magento_Product $product)
{
if ($this->getIsSalePrice() && !$product->isSpecialPriceActual()) {
return 0;
}
return parent::getBundleProductDynamicSpecialValue($product);
}
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:7,代码来源:PriceCalculator.php
示例3: 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];
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:15,代码来源:Service.php
示例4: 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];
}
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:15,代码来源:Specific.php
示例5: 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];
}
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:15,代码来源:Attribute.php
示例6: 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];
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:15,代码来源:Specific.php
示例7: 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];
}
开发者ID:ppkowalski,项目名称:M2E,代码行数:15,代码来源:Listing.php
示例8: getOptions
private function getOptions(Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
$variation = $this->proxyItem->getLowerCasedVariation();
$magentoOptions = $magentoProduct->getProductVariationsForOrder();
// Variation info unavailable - return first value for each required option
// ---------------
if (empty($variation)) {
$firstOptions = array();
foreach ($magentoOptions as $option) {
$firstOptions[$option['option_id']] = $option['values'][0]['value_id'];
}
return $firstOptions;
}
// ---------------
// Map variation with magento options
// ---------------
$mappedOptions = array();
foreach ($magentoOptions as $option) {
$optionValueLabel = $this->getMappedOptionValueLabel($variation, $option['labels']);
if ($optionValueLabel == '') {
continue;
}
$optionValueId = $this->getMappedOptionValueId($optionValueLabel, $option['values']);
if (is_null($optionValueId)) {
continue;
}
$mappedOptions[$option['option_id']] = $optionValueId;
}
// ---------------
return $mappedOptions;
}
开发者ID:xiaoguizhidao,项目名称:beut,代码行数:31,代码来源:Item.php
示例9: insertMediaGalleries
private function insertMediaGalleries($text, Ess_M2ePro_Model_Magento_Product $magentoProduct)
{
preg_match_all("/#media_gallery\\[(.*?)\\]#/", $text, $matches);
if (!count($matches[0])) {
return $text;
}
$blockObj = Mage::getSingleton('core/layout')->createBlock('M2ePro/adminhtml_renderer_description_gallery');
$search = array();
$replace = array();
$attributeCounter = 0;
foreach ($matches[0] as $key => $match) {
$tempMediaGalleryAttributes = explode(',', $matches[1][$key]);
$realMediaGalleryAttributes = array();
for ($i = 0; $i < 8; $i++) {
if (!isset($tempMediaGalleryAttributes[$i])) {
$realMediaGalleryAttributes[$i] = '';
} else {
$realMediaGalleryAttributes[$i] = $tempMediaGalleryAttributes[$i];
}
}
$imagesQty = (int) $realMediaGalleryAttributes[5];
if ($imagesQty == self::IMAGES_QTY_ALL) {
$imagesQty = $realMediaGalleryAttributes[3] == self::IMAGES_MODE_GALLERY ? 100 : 25;
}
$galleryImagesLinks = $magentoProduct->getGalleryImagesLinks($imagesQty);
if (!count($galleryImagesLinks)) {
$search = $matches[0];
$replace = '';
break;
}
if (!in_array($realMediaGalleryAttributes[4], array(self::LAYOUT_MODE_ROW, self::LAYOUT_MODE_COLUMN))) {
$realMediaGalleryAttributes[4] = self::LAYOUT_MODE_ROW;
}
$data = array('width' => (int) $realMediaGalleryAttributes[0], 'height' => (int) $realMediaGalleryAttributes[1], 'margin' => (int) $realMediaGalleryAttributes[2], 'linked_mode' => (int) $realMediaGalleryAttributes[3], 'layout' => $realMediaGalleryAttributes[4], 'gallery_hint' => trim($realMediaGalleryAttributes[6], '"'), 'watermark' => (int) $realMediaGalleryAttributes[7], 'images_count' => count($galleryImagesLinks), 'image_counter' => 0);
$tempHtml = '';
$attributeCounter++;
foreach ($galleryImagesLinks as $imageLink) {
$data['image_counter']++;
$data['attribute_counter'] = $attributeCounter;
$data['src'] = $imageLink;
$tempHtml .= $blockObj->addData($data)->toHtml();
}
$search[] = $match;
$replace[] = preg_replace('/\\s{2,}/', '', $tempHtml);
}
$text = str_replace($search, $replace, $text);
return $text;
}
开发者ID:aligent,项目名称:M2E,代码行数:48,代码来源:Description.php
示例10: 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];
}
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:15,代码来源:Description.php
示例11: changeProductQty
private function changeProductQty(Ess_M2ePro_Model_Magento_Product $magentoProduct, Ess_M2ePro_Model_Magento_Product_StockItem $magentoStockItem, $action, $qty)
{
$result = true;
switch ($action) {
case self::ACTION_ADD:
$magentoStockItem->addQty($qty, false);
break;
case self::ACTION_SUB:
try {
$magentoStockItem->subtractQty($qty, false);
} catch (Exception $e) {
$result = false;
$this->order->setActionRequired(true);
$this->order->addErrorLog('Qty for product "%name%" cannot be reserved. Reason: %msg%', array('!name' => $magentoProduct->getName(), 'msg' => $e->getMessage()));
}
break;
}
return $result;
}
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:19,代码来源:Reserve.php
示例12: getBundleProductDynamicValue
protected function getBundleProductDynamicValue(Ess_M2ePro_Model_Magento_Product $product)
{
$value = 0;
$variationsData = $product->getVariationInstance()->getVariationsTypeStandard();
foreach ($variationsData['variations'] as $variation) {
$variationValue = 0;
foreach ($variation as $option) {
/** @var $childProduct Ess_M2ePro_Model_Magento_Product */
$childProduct = Mage::getModel('M2ePro/Magento_Product')->setProductId($option['product_id']);
$optionValue = (double) $childProduct->getSpecialPrice();
$optionValue <= 0 && ($optionValue = (double) $childProduct->getPrice());
$variationValue += $optionValue;
}
if ($variationValue < $value || $value == 0) {
$value = $variationValue;
}
}
return $this->convertValueFromStoreToMarketplace($value);
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:19,代码来源:PriceCalculator.php
示例13: getVariationsStockAvailabilities
private function getVariationsStockAvailabilities(array $variationsProductsIds)
{
$productsIds = array();
foreach ($variationsProductsIds as $variationProductsIds) {
foreach ($variationProductsIds as $variationProductId) {
$productsIds[] = $variationProductId;
}
}
$productsIds = array_values(array_unique($productsIds));
$catalogInventoryTable = Mage::getSingleton('core/resource')->getTableName('cataloginventory_stock_item');
$select = $this->_getReadAdapter()->select()->from(array('cisi' => $catalogInventoryTable), array('product_id', 'is_in_stock', 'manage_stock', 'use_config_manage_stock'))->where('cisi.product_id IN (' . implode(',', $productsIds) . ')');
$stocks = $select->query()->fetchAll();
$variationsProductsStocks = array();
foreach ($variationsProductsIds as $key => $variationProductsIds) {
foreach ($variationProductsIds as $id) {
$count = count($stocks);
for ($i = 0; $i < $count; $i++) {
if ($stocks[$i]['product_id'] == $id) {
$stockAvailability = Ess_M2ePro_Model_Magento_Product::calculateStockAvailability($stocks[$i]['is_in_stock'], $stocks[$i]['manage_stock'], $stocks[$i]['use_config_manage_stock']);
$variationsProductsStocks[$key][] = $stockAvailability;
break;
}
}
}
}
$variationsStocks = array();
foreach ($variationsProductsStocks as $key => $variationProductsStocks) {
$variationsStocks[$key] = min($variationProductsStocks);
}
return $variationsStocks;
}
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:31,代码来源:Variation.php
示例14: getDescription
private function getDescription($descriptionMode, $customDescription, Ess_M2ePro_Model_Magento_Product $magentoProduct, Ess_M2ePro_Model_Listing_Product $listingProduct = NULL)
{
$description = '';
$descriptionModeProduct = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_PRODUCT;
$descriptionModeShort = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_SHORT;
$descriptionModeCustom = Ess_M2ePro_Model_Ebay_Template_Description::DESCRIPTION_MODE_CUSTOM;
if ($descriptionModeProduct == $descriptionMode) {
$description = $magentoProduct->getProduct()->getDescription();
} elseif ($descriptionModeShort == $descriptionMode) {
$description = $magentoProduct->getProduct()->getShortDescription();
} elseif ($descriptionModeCustom == $descriptionMode) {
$description = $customDescription;
}
if (empty($description)) {
return $description;
}
$renderer = Mage::helper('M2ePro/Module_Renderer_Description');
$description = $renderer->parseTemplate($description, $magentoProduct);
if (!is_null($listingProduct)) {
/** @var Ess_M2ePro_Model_Ebay_Listing_Product_Description_Renderer $renderer */
$renderer = Mage::getSingleton('M2ePro/Ebay_Listing_Product_Description_Renderer');
$renderer->setListingProduct($listingProduct->getChildObject());
$description = $renderer->parseTemplate($description);
}
return $description;
}
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:26,代码来源:DescriptionController.php
示例15: match
private function match()
{
$this->validate();
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Matcher_Attribute $attributeMatcher */
$attributeMatcher = Mage::getModel('M2ePro/Amazon_Listing_Product_Variation_Matcher_Attribute');
if (!is_null($this->magentoProduct)) {
if ($this->magentoProduct->isGroupedType()) {
$this->matchedTheme = null;
return $this;
}
$attributeMatcher->setMagentoProduct($this->magentoProduct);
}
if (!empty($this->sourceAttributes)) {
$attributeMatcher->setSourceAttributes($this->sourceAttributes);
$attributeMatcher->canUseDictionary(false);
}
foreach ($this->themes as $themeName => $themeAttributes) {
$attributeMatcher->setDestinationAttributes($themeAttributes['attributes']);
if ($attributeMatcher->isAmountEqual() && $attributeMatcher->isFullyMatched()) {
$this->matchedTheme = $themeName;
break;
}
}
return $this;
}
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:25,代码来源:Theme.php
示例16: getSourceOptionNames
private function getSourceOptionNames($sourceOption)
{
$magentoOptionNames = $this->magentoProduct->getVariationInstance()->getTitlesVariationSet();
$resultNames = array();
foreach ($magentoOptionNames as $attribute => $data) {
$resultNames[$attribute] = $this->prepareOptionNames($sourceOption[$attribute], $data['values'][$sourceOption[$attribute]]);
}
return $resultNames;
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:9,代码来源:Option.php
示例17: getMagentoProduct
public function getMagentoProduct()
{
if (is_null($this->getProductId())) {
return NULL;
}
if (is_null($this->magentoProduct)) {
$this->magentoProduct = Mage::getModel('M2ePro/Magento_Product');
$this->magentoProduct->setStoreId($this->getOrder()->getStoreId())->setProductId($this->getProductId());
}
return $this->magentoProduct;
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:11,代码来源:Item.php
示例18: getSourceAttributesData
private function getSourceAttributesData()
{
if (!is_null($this->magentoProduct)) {
$magentoAttributesNames = $this->magentoProduct->getVariationInstance()->getTitlesVariationSet();
$resultData = array();
foreach ($magentoAttributesNames as $attribute => $data) {
$resultData[$attribute] = $data['titles'];
}
return $resultData;
}
return array_fill_keys($this->sourceAttributes, array());
}
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:12,代码来源:Attribute.php
示例19: getSourceOptionNames
private function getSourceOptionNames($sourceOption)
{
$magentoOptionNames = $this->magentoProduct->getVariationInstance()->getTitlesVariationSet();
$resultNames = array();
foreach ($sourceOption as $attribute => $option) {
$names = array();
if (isset($magentoOptionNames[$attribute])) {
$names = $magentoOptionNames[$attribute]['values'][$option];
}
$resultNames[$attribute] = $this->prepareOptionNames($option, $names);
}
return $resultNames;
}
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:13,代码来源:Option.php
示例20: getSourceAttributesData
private function getSourceAttributesData()
{
if (!is_null($this->magentoProduct)) {
$magentoAttributesNames = $this->magentoProduct->getVariationInstance()->getTitlesVariationSet();
$magentoStandardVariations = $this->magentoProduct->getVariationInstance()->getVariationsTypeStandard();
$resultData = array();
foreach (array_keys($magentoStandardVariations['set']) as $attribute) {
$titles = array();
if (isset($magentoAttributesNames[$attribute])) {
$titles = $magentoAttributesNames[$attribute]['titles'];
}
$resultData[$attribute] = $titles;
}
return $resultData;
}
return array_fill_keys($this->getSourceAttributes(), array());
}
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:17,代码来源:Attribute.php
注:本文中的Ess_M2ePro_Model_Magento_Product类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论