本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getMagentoProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getMagentoProduct方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getMagentoProduct怎么用?PHP Ess_M2ePro_Model_Listing_Product::getMagentoProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getMagentoProduct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isAddedNewVariationsAttributes
public function isAddedNewVariationsAttributes(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return false;
}
// Prepare Magento Variations
//-----------------------------
$tempMagentoVariations = $listingProduct->getMagentoProduct()->getProductVariations();
$tempMagentoVariations = $this->validateChannelConditions($tempMagentoVariations, false);
//-----------------------------
// Get Variations
//-----------------------------
$magentoVariations = $this->prepareMagentoVariations($tempMagentoVariations);
$currentVariations = $this->prepareCurrentVariations($listingProduct->getVariations(true));
//-----------------------------
if (!isset($magentoVariations[0]) && !isset($currentVariations[0])) {
return false;
}
if (!isset($magentoVariations[0]) || !isset($currentVariations[0])) {
return true;
}
if (count($magentoVariations[0]['options']) != count($currentVariations[0]['options'])) {
return true;
}
return false;
}
示例2: process
public function process()
{
if (is_null($this->listingProduct)) {
throw new Exception('Listing Product was not set.');
}
$this->listingProduct->getMagentoProduct()->enableCache();
foreach ($this->getSortedProcessors() as $processor) {
$this->getProcessorModel($processor)->process();
}
$this->listingProduct->setData('variation_parent_need_processor', 0);
$this->listingProduct->save();
}
示例3: updateVariations
public function updateVariations(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->getMagentoProduct()->isProductWithVariations()) {
return;
}
$rawMagentoVariations = $listingProduct->getMagentoProduct()->getProductVariations();
$rawMagentoVariations = $this->validateLimitsConditions($rawMagentoVariations, $listingProduct);
$magentoVariations = $this->prepareMagentoVariations($rawMagentoVariations);
$currentVariations = $this->prepareCurrentVariations($listingProduct->getVariations(true));
$addedVariations = $this->getAddedVariations($magentoVariations, $currentVariations);
$deletedVariations = $this->getDeletedVariations($magentoVariations, $currentVariations);
$this->addNewVariations($listingProduct, $addedVariations);
$this->markAsDeletedVariations($deletedVariations);
$this->saveVariationsSets($listingProduct, $rawMagentoVariations);
}
示例4: updateAfterAction
public function updateAfterAction(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return;
}
// TODO next release
}
示例5: process
public function process(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->getMagentoProduct()->isProductWithVariations()) {
return;
}
$rawMagentoVariations = $listingProduct->getMagentoProduct()->getVariationInstance()->getVariationsTypeStandard();
$rawMagentoVariations = Mage::helper('M2ePro/Component_Ebay')->reduceOptionsForVariations($rawMagentoVariations);
$rawMagentoVariations = $this->validateExistenceConditions($rawMagentoVariations, $listingProduct);
$rawMagentoVariations = $this->validateLimitsConditions($rawMagentoVariations, $listingProduct);
$magentoVariations = $this->prepareMagentoVariations($rawMagentoVariations);
$currentVariations = $this->prepareCurrentVariations($listingProduct->getVariations(true));
$addedVariations = $this->getAddedVariations($magentoVariations, $currentVariations);
$deletedVariations = $this->getDeletedVariations($magentoVariations, $currentVariations);
$this->addNewVariations($listingProduct, $addedVariations);
$this->markAsDeletedVariations($deletedVariations);
$this->saveVariationsSets($listingProduct, $rawMagentoVariations);
}
示例6: getRequestData
public function getRequestData(Ess_M2ePro_Model_Listing_Product $listingProduct, array &$requestData)
{
/** @var $categoryTemplate Ess_M2ePro_Model_Ebay_Template_Category */
$categoryTemplate = $listingProduct->getChildObject()->getCategoryTemplate();
$categoryTemplate->setMagentoProduct($listingProduct->getMagentoProduct());
/** @var $otherCategoryTemplate Ess_M2ePro_Model_Ebay_Template_OtherCategory */
$otherCategoryTemplate = $listingProduct->getChildObject()->getOtherCategoryTemplate();
if (!is_null($otherCategoryTemplate)) {
$otherCategoryTemplate->setMagentoProduct($listingProduct->getMagentoProduct());
}
$this->addMainCategoriesData($categoryTemplate, $otherCategoryTemplate, $requestData);
$this->addStoreCategoriesData($otherCategoryTemplate, $requestData);
$this->addMotorsSpecificsData($listingProduct, $listingProduct->getListing()->getMarketplace(), $categoryTemplate, $requestData);
$this->addItemSpecificsData($listingProduct, $categoryTemplate, $requestData);
$this->addCustomItemSpecificsData($listingProduct, $categoryTemplate, $requestData);
$this->clearConflictedItemSpecificsData($requestData);
$this->addAttributeSetData($listingProduct, $categoryTemplate, $requestData);
}
示例7: checkChangeAsNotVariationProduct
private function checkChangeAsNotVariationProduct(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
/** @var Ess_M2ePro_Model_Buy_Listing_Product_Variation_Manager $variationManager */
$variationManager = $listingProduct->getChildObject()->getVariationManager();
$isVariationMagentoProduct = $listingProduct->getMagentoProduct()->isProductWithVariations();
if ($isVariationMagentoProduct || !$variationManager->isVariationProduct()) {
return false;
}
$variationManager->clearVariationData();
$listingProduct->setData('is_variation_product', 0)->save();
return true;
}
示例8: getSpecifics
public function getSpecifics(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$attributeCode = Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/ebay/motor/', 'motors_specifics_attribute');
if (empty($attributeCode)) {
return false;
}
$attributeValue = $listingProduct->getMagentoProduct()->getAttributeValue($attributeCode);
if (empty($attributeValue)) {
return array();
}
$epids = explode(self::VALUE_SEPARATOR, $attributeValue);
return Mage::getModel('M2ePro/Ebay_Motor_Specific')->getCollection()->addFieldToFilter('epid', array('in' => $epids))->getItems();
}
示例9: filterReceivedItemsFullTitleMatch
protected function filterReceivedItemsFullTitleMatch($receivedItems)
{
$return = array();
$magentoProductTitle = $this->listingProduct->getMagentoProduct()->getName();
$magentoProductTitle = trim(strtolower($magentoProductTitle));
foreach ($receivedItems as $item) {
$itemTitle = trim(strtolower($item['title']));
if ($itemTitle == $magentoProductTitle) {
$return[] = $item;
}
}
return $return;
}
示例10: updateVariations
public function updateVariations(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$options = array();
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
$listingProduct->setData('is_variation_product', Ess_M2ePro_Model_Play_Listing_Product::IS_VARIATION_PRODUCT_NO)->save();
if ($listingProduct->getChildObject()->isVariationMatched()) {
$listingProduct->getChildObject()->updateVariationOptions($options);
$listingProduct->getChildObject()->unsetMatchedVariation();
}
return;
}
$listingProduct->setData('is_variation_product', Ess_M2ePro_Model_Play_Listing_Product::IS_VARIATION_PRODUCT_YES)->save();
$magentoVariations = $listingProduct->getMagentoProduct()->getProductVariations();
foreach ($magentoVariations['set'] as $attribute => $value) {
$options[] = array('attribute' => $attribute, 'option' => NULL);
}
if (!$listingProduct->getChildObject()->isVariationMatched()) {
$listingProduct->getChildObject()->updateVariationOptions($options);
return;
}
// observe variation removal in Magento
$currentVariation = $this->prepareCurrentVariations($listingProduct->getVariations(true));
if (!isset($currentVariation[0]) || !isset($currentVariation[0]['options'])) {
return;
}
$currentVariation = reset($currentVariation);
$magentoVariations = $this->prepareMagentoVariations($magentoVariations);
foreach ($magentoVariations as $magentoVariation) {
if ($this->isEqualVariations($magentoVariation['options'], $currentVariation['options'])) {
return;
}
}
foreach ($listingProduct->getVariations(true) as $variation) {
$variation->deleteInstance();
}
$listingProduct->getChildObject()->updateVariationOptions($options);
$listingProduct->getChildObject()->unsetMatchedVariation();
}
示例11: isAddedNewVariationsAttributes
public function isAddedNewVariationsAttributes(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->getChildObject()->isListingTypeFixed() || !$listingProduct->getChildObject()->isVariationMode()) {
return false;
}
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return false;
}
$rawMagentoVariations = $listingProduct->getMagentoProduct()->getProductVariations();
$rawMagentoVariations = $this->validateLimitsConditions($rawMagentoVariations, NULL);
$magentoVariations = $this->prepareMagentoVariations($rawMagentoVariations);
$currentVariations = $this->prepareCurrentVariations($listingProduct->getVariations(true));
if (!isset($magentoVariations[0]) && !isset($currentVariations[0])) {
return false;
}
if (!isset($magentoVariations[0]) || !isset($currentVariations[0])) {
return true;
}
if (count($magentoVariations[0]['options']) != count($currentVariations[0]['options'])) {
return true;
}
return false;
}
示例12: calculateCurrentData
private function calculateCurrentData()
{
if (!empty($this->currentQuery) || $this->currentStep > self::STEP_MAGENTO_TITLE) {
return;
}
switch ($this->currentStep) {
case self::STEP_GENERAL_ID:
$tempQuery = $this->listingProduct->getChildObject()->getGeneralId();
empty($tempQuery) && ($tempQuery = $this->listingProduct->getChildObject()->getAddingGeneralId());
!empty($tempQuery) && ($this->currentStep = self::STEP_GENERAL_ID);
!empty($tempQuery) && ($this->currentQuery = (string) $tempQuery);
break;
case self::STEP_MAGENTO_TITLE:
$tempQuery = '';
if ($this->listingProduct->getGeneralTemplate()->getChildObject()->isSearchByMagentoTitleModeEnabled()) {
$tempQuery = $this->listingProduct->getMagentoProduct()->getName();
}
!empty($tempQuery) && ($this->currentStep = self::STEP_MAGENTO_TITLE);
!empty($tempQuery) && ($this->currentQuery = (string) $tempQuery);
break;
}
empty($this->currentQuery) && $this->currentStep++;
$this->calculateCurrentData();
}
示例13: checkChangeAsNotVariationProduct
private function checkChangeAsNotVariationProduct(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager $variationManager */
$variationManager = $listingProduct->getChildObject()->getVariationManager();
$isVariationMagentoProduct = $listingProduct->getMagentoProduct()->isProductWithVariations();
if ($isVariationMagentoProduct || !$variationManager->isVariationProduct()) {
return false;
}
$variationManager->getTypeModel()->clearTypeData();
if ($variationManager->isRelationParentType()) {
$listingProduct->setData('general_id', NULL);
$listingProduct->setData('is_general_id_owner', Ess_M2ePro_Model_Amazon_Listing_Product::IS_GENERAL_ID_OWNER_NO);
$listingProduct->setData('status', Ess_M2ePro_Model_Listing_Product::STATUS_NOT_LISTED);
$listingProduct->deleteInstance();
} else {
$variationManager->setSimpleType();
}
return true;
}
示例14: getRequestData
public function getRequestData(Ess_M2ePro_Model_Listing_Product $listingProduct, array &$requestData)
{
$requestData['shipping'] = array();
/** @var $shippingTemplate Ess_M2ePro_Model_Ebay_Template_Shipping */
$shippingTemplate = $listingProduct->getChildObject()->getShippingTemplate();
$shippingTemplate->setMagentoProduct($listingProduct->getMagentoProduct());
$accountId = $listingProduct->getListing()->getAccountId();
$this->addLocalShippingData($shippingTemplate, $accountId, $requestData);
$this->addInternationalShippingData($shippingTemplate, $accountId, $requestData);
$this->addGlobalShippingProgramData($shippingTemplate, $requestData);
$this->addExcludedLocationsData($shippingTemplate, $requestData);
if ($shippingTemplate->isLocalShippingFlatEnabled() && $shippingTemplate->isLocalShippingRateTableEnabled() && !$shippingTemplate->isInternationalShippingCalculatedEnabled() && !isset($requestData['shipping']['calculated'])) {
$calculatedData = $this->getCalculatedData($shippingTemplate, $listingProduct);
unset($calculatedData['package_size']);
unset($calculatedData['originating_postal_code']);
unset($calculatedData['dimensions']);
$requestData['shipping']['calculated'] = $calculatedData;
}
$this->addAdditionalData($shippingTemplate, $requestData);
$this->addLocationData($shippingTemplate, $requestData);
$this->addInternationalTradeData($shippingTemplate, $requestData);
}
示例15: checkVariationStructureChanges
private function checkVariationStructureChanges(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager $variationManager */
$variationManager = $listingProduct->getChildObject()->getVariationManager();
if ($variationManager->isRelationParentType()) {
$this->parentListingsProductsForProcessing[$listingProduct->getId()] = $listingProduct;
return;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_PhysicalUnit $typeModel */
$typeModel = $variationManager->getTypeModel();
if (!$listingProduct->getMagentoProduct()->isSimpleType()) {
$typeModel->inspectAndFixProductOptionsIds();
}
if (!$typeModel->isActualProductAttributes()) {
if ($variationManager->isRelationChildType()) {
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Child $typeModel */
$this->parentListingsProductsForProcessing[$typeModel->getParentListingProduct()->getId()] = $typeModel->getParentListingProduct();
return;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Individual $typeModel */
$typeModel->resetProductVariation();
return;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_PhysicalUnit $typeModel */
if ($typeModel->isVariationProductMatched() && !$typeModel->isActualProductVariation()) {
if ($variationManager->isRelationChildType()) {
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Child $typeModel */
$this->parentListingsProductsForProcessing[$typeModel->getParentListingProduct()->getId()] = $typeModel->getParentListingProduct();
return;
}
$typeModel->unsetProductVariation();
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Child $typeModel */
if ($variationManager->isRelationChildType() && $typeModel->getParentTypeModel()->getVirtualChannelAttributes()) {
if (!$typeModel->getParentTypeModel()->isActualVirtualChannelAttributes()) {
$this->parentListingsProductsForProcessing[$typeModel->getParentListingProduct()->getId()] = $typeModel->getParentListingProduct();
}
}
}