本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Other::getStatusChanger方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Other::getStatusChanger方法的具体用法?PHP Ess_M2ePro_Model_Listing_Other::getStatusChanger怎么用?PHP Ess_M2ePro_Model_Listing_Other::getStatusChanger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Other
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Other::getStatusChanger方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: addProductFromOther
public function addProductFromOther(Ess_M2ePro_Model_Listing_Other $listingOtherProduct, $checkingMode = false, $checkHasProduct = true)
{
if (!$listingOtherProduct->getProductId()) {
return false;
}
$productId = $listingOtherProduct->getProductId();
$result = $this->getParentObject()->addProduct($productId, $checkingMode, $checkHasProduct);
if ($checkingMode) {
return $result;
}
if (!$result instanceof Ess_M2ePro_Model_Listing_Product) {
return false;
}
$listingProduct = $result;
$listingProduct->getChildObject()->getPlayItem()->setData('store_id', $this->getParentObject()->getStoreId())->save();
$dataForUpdate = array('general_id' => $listingOtherProduct->getChildObject()->getGeneralId(), 'play_listing_id' => $listingOtherProduct->getChildObject()->getPlayListingId(), 'link_info' => $listingOtherProduct->getChildObject()->getLinkInfo(), 'general_id_type' => $listingOtherProduct->getChildObject()->getGeneralIdType(), 'sku' => $listingOtherProduct->getChildObject()->getSku(), 'online_price_gbr' => $listingOtherProduct->getChildObject()->getOnlinePriceGbr(), 'online_price_euro' => $listingOtherProduct->getChildObject()->getOnlinePriceEuro(), 'online_shipping_price_gbr' => 0, 'online_shipping_price_euro' => 0, 'online_qty' => $listingOtherProduct->getChildObject()->getOnlineQty(), 'condition' => $listingOtherProduct->getChildObject()->getCondition(), 'condition_note' => $listingOtherProduct->getChildObject()->getConditionNote(), 'dispatch_to' => $listingOtherProduct->getChildObject()->getDispatchTo(), 'dispatch_from' => $listingOtherProduct->getChildObject()->getDispatchFrom(), 'status' => $listingOtherProduct->getStatus(), 'status_changer' => $listingOtherProduct->getStatusChanger());
$listingProduct->addData($dataForUpdate)->save();
return $listingProduct;
}
示例3: addProductFromOther
public function addProductFromOther(Ess_M2ePro_Model_Listing_Other $listingOtherProduct, $checkingMode = false, $checkHasProduct = true)
{
if (!$listingOtherProduct->getProductId()) {
return false;
}
$productId = $listingOtherProduct->getProductId();
$result = $this->getParentObject()->addProduct($productId, $checkingMode, $checkHasProduct);
if ($checkingMode) {
return $result;
}
if (!$result instanceof Ess_M2ePro_Model_Listing_Product) {
return false;
}
$listingProduct = $result;
$listingProduct->getChildObject()->getBuyItem()->setData('store_id', $this->getParentObject()->getStoreId())->save();
$dataForUpdate = array('general_id' => $listingOtherProduct->getChildObject()->getGeneralId(), 'sku' => $listingOtherProduct->getChildObject()->getSku(), 'online_price' => $listingOtherProduct->getChildObject()->getOnlinePrice(), 'online_qty' => $listingOtherProduct->getChildObject()->getOnlineQty(), 'condition' => $listingOtherProduct->getChildObject()->getCondition(), 'condition_note' => $listingOtherProduct->getChildObject()->getConditionNote(), 'shipping_standard_rate' => $listingOtherProduct->getChildObject()->getShippingStandardRate(), 'shipping_expedited_mode' => $listingOtherProduct->getChildObject()->getShippingExpeditedMode(), 'shipping_expedited_rate' => $listingOtherProduct->getChildObject()->getShippingExpeditedRate(), 'status' => $listingOtherProduct->getStatus(), 'status_changer' => $listingOtherProduct->getStatusChanger());
$listingProduct->addData($dataForUpdate)->save();
return $listingProduct;
}
示例4: addProductFromOther
/**
* @param Ess_M2ePro_Model_Listing_Other $listingOtherProduct
* @param bool $checkingMode
* @param bool $checkHasProduct
* @return bool|Ess_M2ePro_Model_Listing_Product
* @throws Ess_M2ePro_Model_Exception_Logic
*/
public function addProductFromOther(Ess_M2ePro_Model_Listing_Other $listingOtherProduct, $checkingMode = false, $checkHasProduct = true)
{
if (!$listingOtherProduct->getProductId()) {
return false;
}
$productId = $listingOtherProduct->getProductId();
$result = $this->getParentObject()->addProduct($productId, $checkingMode, $checkHasProduct);
if ($checkingMode) {
return $result;
}
if (!$result instanceof Ess_M2ePro_Model_Listing_Product) {
return false;
}
$listingProduct = $result;
/** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
$amazonListingProduct = $listingProduct->getChildObject();
$variationManager = $amazonListingProduct->getVariationManager();
if ($variationManager->isRelationParentType()) {
$variationManager->switchModeToAnother();
}
$amazonListingProduct->getAmazonItem()->setData('store_id', $this->getParentObject()->getStoreId())->save();
/** @var Ess_M2ePro_Model_Amazon_Listing_Other $amazonListingOther */
$amazonListingOther = $listingOtherProduct->getChildObject();
$dataForUpdate = array('general_id' => $amazonListingOther->getGeneralId(), 'sku' => $amazonListingOther->getSku(), 'online_price' => $amazonListingOther->getOnlinePrice(), 'online_qty' => $amazonListingOther->getOnlineQty(), 'is_afn_channel' => (int) $amazonListingOther->isAfnChannel(), 'is_isbn_general_id' => (int) $amazonListingOther->isIsbnGeneralId(), 'status' => $listingOtherProduct->getStatus(), 'status_changer' => $listingOtherProduct->getStatusChanger());
$listingProduct->addData($dataForUpdate)->save();
return $listingProduct;
}
示例5: addProductFromOther
public function addProductFromOther(Ess_M2ePro_Model_Listing_Other $listingOtherProduct, $checkingMode = false, $checkHasProduct = true)
{
if (!$listingOtherProduct->getProductId()) {
return false;
}
$productId = $listingOtherProduct->getProductId();
$result = $this->getParentObject()->addProduct($productId, $checkingMode, true);
if ($checkingMode) {
return $result;
}
if (!$result instanceof Ess_M2ePro_Model_Listing_Product) {
return false;
}
$listingProduct = $result;
/** @var $collection Mage_Core_Model_Mysql4_Collection_Abstract */
$collection = Mage::getModel('M2ePro/Ebay_Item')->getCollection()->addFieldToFilter('account_id', $listingOtherProduct->getAccount()->getId())->addFieldToFilter('item_id', $listingOtherProduct->getChildObject()->getItemId());
$ebayItem = $collection->getFirstItem();
$ebayItem->setData('store_id', $this->getParentObject()->getStoreId())->save();
$dataForUpdate = array('ebay_item_id' => $ebayItem->getId(), 'online_sku' => $listingOtherProduct->getChildObject()->getSku(), 'online_title' => $listingOtherProduct->getChildObject()->getTitle(), 'online_buyitnow_price' => $listingOtherProduct->getChildObject()->getOnlinePrice(), 'online_qty' => $listingOtherProduct->getChildObject()->getOnlineQty(), 'online_qty_sold' => $listingOtherProduct->getChildObject()->getOnlineQtySold(), 'online_bids' => $listingOtherProduct->getChildObject()->getOnlineBids(), 'start_date' => $listingOtherProduct->getChildObject()->getStartDate(), 'end_date' => $listingOtherProduct->getChildObject()->getEndDate(), 'status' => $listingOtherProduct->getStatus(), 'status_changer' => $listingOtherProduct->getStatusChanger());
$listingProduct->addData($dataForUpdate)->save();
return $listingProduct;
}
示例6: addProductFromOther
public function addProductFromOther(Ess_M2ePro_Model_Listing_Other $listingOtherProduct)
{
if (!$listingOtherProduct->getProductId()) {
return false;
}
$productId = $listingOtherProduct->getProductId();
$listingProduct = $this->getParentObject()->addProduct($productId);
if (!$listingProduct instanceof Ess_M2ePro_Model_Listing_Product) {
return false;
}
$listingProduct->getChildObject()->getAmazonItem()->setData('store_id', $this->getParentObject()->getStoreId())->save();
$dataForUpdate = array('general_id' => $listingOtherProduct->getChildObject()->getGeneralId(), 'sku' => $listingOtherProduct->getChildObject()->getSku(), 'online_price' => $listingOtherProduct->getChildObject()->getOnlinePrice(), 'online_qty' => $listingOtherProduct->getChildObject()->getOnlineQty(), 'is_afn_channel' => (int) $listingOtherProduct->getChildObject()->isAfnChannel(), 'is_isbn_general_id' => (int) $listingOtherProduct->getChildObject()->isIsbnGeneralId(), 'start_date' => $listingOtherProduct->getChildObject()->getStartDate(), 'end_date' => $listingOtherProduct->getChildObject()->getEndDate(), 'status' => $listingOtherProduct->getStatus(), 'status_changer' => $listingOtherProduct->getStatusChanger());
$listingProduct->addData($dataForUpdate)->save();
return $listingProduct;
}