本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Other::isStoppable方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Other::isStoppable方法的具体用法?PHP Ess_M2ePro_Model_Listing_Other::isStoppable怎么用?PHP Ess_M2ePro_Model_Listing_Other::isStoppable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Other
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Other::isStoppable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isMeetStopRequirements
private function isMeetStopRequirements(Ess_M2ePro_Model_Listing_Other $listingOther)
{
// eBay available status
//--------------------
if (!$listingOther->isListed()) {
return false;
}
if (!$listingOther->isStoppable()) {
return false;
}
if (is_null($listingOther->getProductId())) {
return false;
}
if ($this->getRunner()->isExistProduct($listingOther, Ess_M2ePro_Model_Listing_Product::ACTION_STOP, array())) {
return false;
}
//--------------------
/** @var $ebaySynchronizationTemplate Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization */
$ebaySynchronizationTemplate = $listingOther->getChildObject()->getSynchronizationModel();
// Correct synchronization
//--------------------
if (!$ebaySynchronizationTemplate->isMode()) {
return false;
}
//--------------------
// Check filters
//--------------------
if ($ebaySynchronizationTemplate->isStopStatusDisabled()) {
if (!$listingOther->getMagentoProduct()->isStatusEnabled()) {
return true;
}
}
if ($ebaySynchronizationTemplate->isStopOutOfStock()) {
if (!$listingOther->getMagentoProduct()->isStockAvailability()) {
return true;
}
}
if ($ebaySynchronizationTemplate->isStopWhenQtyHasValue()) {
$productQty = $listingOther->getChildObject()->getMappedQty();
if (!is_null($productQty)) {
$typeQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueMax();
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_LESS && $productQty <= $minQty) {
return true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_MORE && $productQty >= $minQty) {
return true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
return true;
}
}
}
//--------------------
return false;
}
示例2: isMeetStopRequirements
private function isMeetStopRequirements(Ess_M2ePro_Model_Listing_Other $listingOther)
{
// eBay available status
//--------------------
if (!$listingOther->isListed()) {
return false;
}
if (!$listingOther->isStoppable()) {
return false;
}
if (is_null($listingOther->getProductId())) {
return false;
}
if ($this->_runnerActions->isExistProductAction($listingOther, Ess_M2ePro_Model_Connector_Server_Ebay_Item_Dispatcher::ACTION_STOP, array())) {
return false;
}
//--------------------
// Correct synchronization
//--------------------
if (!$listingOther->getAccount()->getChildObject()->isOtherListingsMappedSynchronizationEnabled()) {
return false;
}
//--------------------
// Check filters
//--------------------
if ($listingOther->getChildObject()->getSynchronizationModel()->isStopStatusDisabled()) {
if ($listingOther->getMagentoProduct()->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
return true;
}
}
if ($listingOther->getChildObject()->getSynchronizationModel()->isStopOutOfStock()) {
if (!$listingOther->getMagentoProduct()->getStockAvailability()) {
return true;
}
}
if ($listingOther->getChildObject()->getSynchronizationModel()->isStopWhenQtyHasValue()) {
$productQty = $listingOther->getChildObject()->getMappedQty();
if (!is_null($productQty)) {
/** @var $ebaySynchronizationTemplate Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization */
$ebaySynchronizationTemplate = $listingOther->getChildObject()->getSynchronizationModel();
$typeQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueMax();
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_LESS && $productQty <= $minQty) {
return true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_MORE && $productQty >= $minQty) {
return true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
return true;
}
}
}
//--------------------
return false;
}
示例3: isMeetStopRequirements
/**
* @param Ess_M2ePro_Model_Listing_Other $listingOther
* @return bool
* @throws Ess_M2ePro_Model_Exception
* @throws Ess_M2ePro_Model_Exception_Logic
*/
public function isMeetStopRequirements(Ess_M2ePro_Model_Listing_Other $listingOther)
{
if (!$listingOther->isListed() || !$listingOther->isStoppable()) {
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->isStopStatusDisabled() && !$listingOther->getMagentoProduct()->isStatusEnabled()) {
return true;
}
if ($ebaySynchronizationTemplate->isStopOutOfStock() && !$listingOther->getMagentoProduct()->isStockAvailability()) {
return true;
}
if ($ebaySynchronizationTemplate->isStopWhenQtyHasValue()) {
$productQty = $ebayListingOther->getMappedQty();
if (!is_null($productQty)) {
$typeQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getStopWhenQtyHasValueMax();
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_LESS && $productQty <= $minQty) {
return true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_MORE && $productQty >= $minQty) {
return true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Listing_Other_Synchronization::STOP_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
return true;
}
}
}
return false;
}