protected function logSuccessfulOperation(\Ess\M2ePro\Model\Marketplace $marketplace) { // M2ePro\TRANSLATIONS // The "Details" Action for %amazon% Marketplace: "%mrk%" has been successfully completed. $tempString = $this->activeRecordFactory->getObject('Log\\AbstractLog')->encodeDescription('The "Details" Action for %amazon% Marketplace: "%mrk%" has been successfully completed.', array('!amazon' => $this->getHelper('Component\\Amazon')->getTitle(), 'mrk' => $marketplace->getTitle())); $this->getLog()->addMessage($tempString, \Ess\M2ePro\Model\Log\AbstractLog::TYPE_SUCCESS, \Ess\M2ePro\Model\Log\AbstractLog::PRIORITY_LOW); }
protected function getResponserParams() { $params = parent::getResponserParams(); if (!is_null($this->marketplace)) { $params['marketplace_id'] = $this->marketplace->getId(); } if (!is_null($this->account)) { $params['account_id'] = $this->account->getId(); } return $params; }
private function parseShippingAddress(array $shippingData, \Ess\M2ePro\Model\Marketplace $marketplace) { $location = isset($shippingData['location']) ? $shippingData['location'] : array(); $address = isset($shippingData['address']) ? $shippingData['address'] : array(); $parsedAddress = array('county' => isset($location['county']) ? trim($location['county']) : '', 'country_code' => isset($location['country_code']) ? trim($location['country_code']) : '', 'state' => isset($location['state']) ? trim($location['state']) : '', 'city' => isset($location['city']) ? trim($location['city']) : '', 'postal_code' => isset($location['postal_code']) ? $location['postal_code'] : '', 'recipient_name' => isset($shippingData['buyer']) ? trim($shippingData['buyer']) : '', 'phone' => isset($shippingData['phone']) ? $shippingData['phone'] : '', 'company' => '', 'street' => array(isset($address['first']) ? $address['first'] : '', isset($address['second']) ? $address['second'] : '', isset($address['third']) ? $address['third'] : '')); $parsedAddress['street'] = array_filter($parsedAddress['street']); $group = '/amazon/order/settings/marketplace_' . $marketplace->getId() . '/'; $useFirstStreetLineAsCompany = $this->getHelper('Module')->getConfig()->getGroupValue($group, 'use_first_street_line_as_company'); if ($useFirstStreetLineAsCompany && count($parsedAddress['street']) > 1) { $parsedAddress['company'] = array_shift($parsedAddress['street']); } return $parsedAddress; }
protected function buildRequestInstance() { $request = parent::buildRequestInstance(); $requestData = $request->getData(); if (!is_null($this->marketplace)) { $requestData['marketplace'] = $this->marketplace->getNativeId(); } if (!is_null($this->account)) { $requestData['account'] = $this->account->getChildObject()->getServerHash(); } $request->setData($requestData); return $request; }
protected function getResponserParams() { $tempProductsData = array(); foreach ($this->listingsProducts as $listingProduct) { $tempProductsData[$listingProduct->getId()] = isset($this->listingProductRequestsData[$listingProduct->getId()]) ? $this->listingProductRequestsData[$listingProduct->getId()] : array(); } return array('account_id' => $this->account->getId(), 'marketplace_id' => $this->marketplace->getId(), 'logs_action_id' => $this->logsActionId, 'status_changer' => $this->params['status_changer'], 'params' => $this->params, 'products' => $tempProductsData); }
public function setMarketplaceFilter(\Ess\M2ePro\Model\Marketplace $marketplace) { $this->joinActionData(); $this->addFieldToFilter('mapa.marketplace_id', (int) $marketplace->getId()); return $this; }