本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::setSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::setSettings方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::setSettings怎么用?PHP Ess_M2ePro_Model_Listing_Product::setSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::setSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setListAttemptData
private function setListAttemptData(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$additionalData = $listingProduct->getAdditionalData();
$additionalData['last_list_attempt_date'] = Mage::helper('M2ePro')->getCurrentGmtDate();
$listingProduct->setSettings('additional_data', $additionalData);
$listingProduct->save();
}
示例2: isMeetListRequirements
/**
* @param Ess_M2ePro_Model_Listing_Product $listingProduct
* @return bool
* @throws Ess_M2ePro_Model_Exception
* @throws Ess_M2ePro_Model_Exception_Logic
* @throws Exception
*/
public function isMeetListRequirements(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->isNotListed() || $listingProduct->isBlocked()) {
return false;
}
if (!$listingProduct->isListable()) {
return false;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
$amazonListingProduct = $listingProduct->getChildObject();
$variationManager = $amazonListingProduct->getVariationManager();
$searchGeneralId = $amazonListingProduct->getListingSource()->getSearchGeneralId();
$searchWorldwideId = $amazonListingProduct->getListingSource()->getSearchWorldwideId();
if ($variationManager->isVariationProduct()) {
if ($variationManager->isPhysicalUnit() && !$variationManager->getTypeModel()->isVariationProductMatched()) {
return false;
}
if ($variationManager->isRelationParentType() && $amazonListingProduct->getGeneralId()) {
return false;
}
if ($variationManager->isRelationChildType()) {
if (!$amazonListingProduct->getGeneralId() && !$amazonListingProduct->isGeneralIdOwner()) {
return false;
}
}
if ($variationManager->isIndividualType()) {
if (!$amazonListingProduct->getGeneralId() && ($listingProduct->getMagentoProduct()->isSimpleTypeWithCustomOptions() || $listingProduct->getMagentoProduct()->isBundleType())) {
return false;
}
}
if ($variationManager->isRelationParentType() && empty($searchGeneralId) && !$amazonListingProduct->isGeneralIdOwner()) {
return false;
}
}
if (!$amazonListingProduct->getGeneralId() && !$amazonListingProduct->isGeneralIdOwner() && empty($searchGeneralId) && empty($searchWorldwideId)) {
return false;
}
$amazonSynchronizationTemplate = $amazonListingProduct->getAmazonSynchronizationTemplate();
if (!$amazonSynchronizationTemplate->isListMode()) {
return false;
}
if ($listingProduct->isLockedObject('in_action')) {
return false;
}
$variationResource = Mage::getResourceModel('M2ePro/Listing_Product_Variation');
$additionalData = $listingProduct->getAdditionalData();
if ($amazonSynchronizationTemplate->isListStatusEnabled()) {
if (!$listingProduct->getMagentoProduct()->isStatusEnabled()) {
// M2ePro_TRANSLATIONS
// Product was not automatically Listed according to the List Rules in Synchronization Policy. Status of Magento Product is Disabled (%date%) though in Synchronization Rules “Product Status” is set to Enabled.
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Status of Magento Product is Disabled (%date%) though in Synchronization Rules “Product Status”
is set to Enabled.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
} else {
if ($variationManager->isPhysicalUnit() && $variationManager->getTypeModel()->isVariationProductMatched()) {
$temp = $variationResource->isAllStatusesDisabled($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
if (!is_null($temp) && $temp) {
// M2ePro_TRANSLATIONS
// Product was not automatically Listed according to the List Rules in Synchronization Policy. Status of Magento Product Variation is Disabled (%date%) though in Synchronization Rules “Product Status“ is set to Enabled.
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Status of Magento Product Variation is Disabled (%date%) though in Synchronization Rules
“Product Status“ is set to Enabled.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
}
}
}
}
if ($amazonSynchronizationTemplate->isListIsInStock()) {
if (!$listingProduct->getMagentoProduct()->isStockAvailability()) {
// M2ePro_TRANSLATIONS
// Product was not automatically Listed according to the List Rules in Synchronization Policy. Stock Availability of Magento Product is Out of Stock though in Synchronization Rules “Stock Availability” is set to In Stock.
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Stock Availability of Magento Product is Out of Stock though in
Synchronization Rules “Stock Availability” is set to In Stock.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
} else {
if ($variationManager->isPhysicalUnit() && $variationManager->getTypeModel()->isVariationProductMatched()) {
$temp = $variationResource->isAllDoNotHaveStockAvailabilities($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
if (!is_null($temp) && $temp) {
// M2ePro_TRANSLATIONS
// Product was not automatically Listed according to the List Rules in Synchronization Policy. Stock Availability of Magento Product Variation is Out of Stock though in Synchronization Rules “Stock Availability” is set to In Stock.
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Stock Availability of Magento Product Variation is Out of Stock though
in Synchronization Rules “Stock Availability” is set to In Stock.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
//.........这里部分代码省略.........
示例3: isMeetListRequirements
public function isMeetListRequirements(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->isNotListed()) {
return false;
}
if (!$listingProduct->isListable()) {
return false;
}
/** @var Ess_M2ePro_Model_Ebay_Listing_Product $ebayListingProduct */
$ebayListingProduct = $listingProduct->getChildObject();
$ebaySynchronizationTemplate = $ebayListingProduct->getEbaySynchronizationTemplate();
if (!$ebaySynchronizationTemplate->isListMode()) {
return false;
}
$additionalData = $listingProduct->getAdditionalData();
if ($ebaySynchronizationTemplate->isScheduleEnabled() && (!$ebaySynchronizationTemplate->isScheduleIntervalNow() || !$ebaySynchronizationTemplate->isScheduleWeekNow())) {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the Schedule Settings in Synchronization Policy.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
}
if (!$ebayListingProduct->isSetCategoryTemplate()) {
return false;
}
$variationResource = Mage::getResourceModel('M2ePro/Listing_Product_Variation');
if ($ebaySynchronizationTemplate->isListStatusEnabled()) {
if (!$listingProduct->getMagentoProduct()->isStatusEnabled()) {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Status of Magento Product is Disabled (%date%) though in Synchronization Rules “Product Status”
is set to Enabled.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
} else {
if ($ebayListingProduct->isVariationsReady()) {
$temp = $variationResource->isAllStatusesDisabled($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
if (!is_null($temp) && $temp) {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Status of Magento Product Variation is Disabled (%date%) though in Synchronization Rules
“Product Status“ is set to Enabled.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
}
}
}
}
if ($ebaySynchronizationTemplate->isListIsInStock()) {
if (!$listingProduct->getMagentoProduct()->isStockAvailability()) {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Stock Availability of Magento Product is Out of Stock though in
Synchronization Rules “Stock Availability” is set to In Stock.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
} else {
if ($ebayListingProduct->isVariationsReady()) {
$temp = $variationResource->isAllDoNotHaveStockAvailabilities($listingProduct->getId(), $listingProduct->getListing()->getStoreId());
if (!is_null($temp) && $temp) {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Stock Availability of Magento Product Variation is Out of Stock though
in Synchronization Rules “Stock Availability” is set to In Stock.', array('date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
$additionalData['synch_template_list_rules_note'] = $note;
$listingProduct->setSettings('additional_data', $additionalData)->save();
return false;
}
}
}
}
if ($ebaySynchronizationTemplate->isListWhenQtyMagentoHasValue()) {
$result = false;
$productQty = (int) $listingProduct->getMagentoProduct()->getQty(true);
$typeQty = (int) $ebaySynchronizationTemplate->getListWhenQtyMagentoHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getListWhenQtyMagentoHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getListWhenQtyMagentoHasValueMax();
$note = '';
if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::LIST_QTY_LESS) {
if ($productQty <= $minQty) {
$result = true;
} else {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Quantity of Magento Product is %product_qty% though in Synchronization Rules
“Magento Quantity“ is set to less then %template_min_qty%.', array('!template_min_qty' => $minQty, '!product_qty' => $productQty, '!date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
}
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::LIST_QTY_MORE) {
if ($productQty >= $minQty) {
$result = true;
} else {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Quantity of Magento Product is %product_qty% though in Synchronization Rules
“Magento Quantity” is set to more then %template_min_qty%.', array('!template_min_qty' => $minQty, '!product_qty' => $productQty, '!date' => Mage::helper('M2ePro')->getCurrentGmtDate()));
}
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::LIST_QTY_BETWEEN) {
if ($productQty >= $minQty && $productQty <= $maxQty) {
$result = true;
} else {
$note = Mage::getSingleton('M2ePro/Log_Abstract')->encodeDescription('Product was not automatically Listed according to the List Rules in Synchronization Policy.
Quantity of Magento Product is %product_qty% though in Synchronization Rules
//.........这里部分代码省略.........