本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Other::isRelistable方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Other::isRelistable方法的具体用法?PHP Ess_M2ePro_Model_Listing_Other::isRelistable怎么用?PHP Ess_M2ePro_Model_Listing_Other::isRelistable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Other
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Other::isRelistable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isMeetRelistRequirements
/**
* @param Ess_M2ePro_Model_Listing_Other $listingOther
* @return bool
* @throws Ess_M2ePro_Model_Exception
* @throws Ess_M2ePro_Model_Exception_Logic
*/
public function isMeetRelistRequirements(Ess_M2ePro_Model_Listing_Other $listingOther)
{
if (!$listingOther->isStopped() || !$listingOther->isRelistable()) {
return false;
}
if (is_null($listingOther->getProductId())) {
return false;
}
/** @var Ess_M2ePro_Model_Ebay_Listing_Other $ebayListingOther */
$ebayListingOther = $listingOther->getChildObject();
$ebaySynchronizationTemplate = $ebayListingOther->getSynchronizationModel();
if (!$ebaySynchronizationTemplate->isMode()) {
return false;
}
if (!$ebaySynchronizationTemplate->isRelistMode()) {
return false;
}
if ($ebaySynchronizationTemplate->isRelistFilterUserLock() && $listingOther->getStatusChanger() == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_USER) {
return false;
}
if ($ebaySynchronizationTemplate->isRelistStatusEnabled() && !$listingOther->getMagentoProduct()->isStatusEnabled()) {
return false;
}
if ($ebaySynchronizationTemplate->isRelistIsInStock() && !$listingOther->getMagentoProduct()->isStockAvailability()) {
return false;
}
if ($ebaySynchronizationTemplate->isRelistWhenQtyHasValue()) {
$productQty = $ebayListingOther->getMappedQty();
if (!is_null($productQty)) {
$result = false;
$typeQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyHasValueMax();
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::RELIST_QTY_LESS && $productQty <= $minQty) {
$result = true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::RELIST_QTY_MORE && $productQty >= $minQty) {
$result = true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::RELIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
$result = true;
}
if (!$result) {
return false;
}
}
}
return true;
}
示例2: isMeetRelistRequirements
private function isMeetRelistRequirements(Ess_M2ePro_Model_Listing_Other $listingOther)
{
// eBay available status
//--------------------
if ($listingOther->isListed()) {
return false;
}
if (!$listingOther->isRelistable()) {
return false;
}
if (is_null($listingOther->getProductId())) {
return false;
}
if ($this->_runnerActions->isExistProductAction($listingOther, Ess_M2ePro_Model_Connector_Ebay_Item_Dispatcher::ACTION_RELIST, array())) {
return false;
}
//--------------------
// Correct synchronization
//--------------------
if (!$listingOther->getAccount()->getChildObject()->isOtherListingsMappedSynchronizationEnabled()) {
return false;
}
if (!$listingOther->getChildObject()->getSynchronizationModel()->isRelistMode()) {
return false;
}
if ($listingOther->getChildObject()->getSynchronizationModel()->isRelistFilterUserLock() && $listingOther->getStatusChanger() == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_USER) {
return false;
}
//--------------------
// Check filters
//--------------------
if ($listingOther->getChildObject()->getSynchronizationModel()->isRelistStatusEnabled()) {
if ($listingOther->getMagentoProduct()->getStatus() != Mage_Catalog_Model_Product_Status::STATUS_ENABLED) {
return false;
}
}
if ($listingOther->getChildObject()->getSynchronizationModel()->isRelistIsInStock()) {
if (!$listingOther->getMagentoProduct()->getStockAvailability()) {
return false;
}
}
if ($listingOther->getChildObject()->getSynchronizationModel()->isRelistWhenQtyHasValue()) {
$productQty = $listingOther->getChildObject()->getMappedQty();
if (!is_null($productQty)) {
$result = false;
/** @var $ebaySynchronizationTemplate Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization */
$ebaySynchronizationTemplate = $listingOther->getChildObject()->getSynchronizationModel();
$typeQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getRelistWhenQtyHasValueMax();
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::RELIST_QTY_LESS && $productQty <= $minQty) {
$result = true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::RELIST_QTY_MORE && $productQty >= $minQty) {
$result = true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::RELIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
$result = true;
}
if (!$result) {
return false;
}
}
}
//--------------------
return true;
}