/**
  * Convert Customer custom values
  * 
  * @param string $name Field name
  * @param mixed $value Field value
  * @return mixed Converted value
  */
 protected function convertField($name, $value)
 {
     if ($name == 'addresses') {
         $addresses = array();
         foreach ($value as $address) {
             $addresses[] = array('customerAddressID' => $address->customerAddressID, 'customerID' => $address->customerID, 'customerAddressIsDefaultBilling' => $address->customerAddressIsDefaultBilling, 'customerAddressIsDefaultShipping' => $address->customerAddressIsDefaultShipping, 'customerAddressFirstName' => $address->customerAddressFirstName, 'customerAddressLastName' => $address->customerAddressLastName, 'customerAddressCompany' => $address->customerAddressCompany, 'customerAddressLine1' => $address->customerAddressLine1, 'customerAddressLine2' => $address->customerAddressLine2, 'customerAddressCity' => $address->customerAddressCity, 'cityID' => $address->cityID, 'stateCode' => $address->stateCode, 'countryCode' => $address->countryCode, 'customerAddressZip' => $address->customerAddressZip, 'customerAddressPhone' => $address->customerAddressPhone, 'customerAddressFax' => $address->customerAddressFax, 'customerAddressVatNumber' => $address->customerAddressVatNumber, 'customerAddressTaxNumber' => $address->customerAddressTaxNumber, 'customerAddressTaxOffice' => $address->customerAddressTaxOffice, 'customerAddressPersonalNumber' => $address->customerAddressPersonalNumber, 'customerAddressInvoiceContactPerson' => $address->customerAddressInvoiceContactPerson, 'customerAddressIsCompany' => $address->customerAddressIsCompany, 'customerAddressBankName' => $address->customerAddressBankName, 'customerAddressBankAccount' => $address->customerAddressBankAccount);
         }
         return $addresses;
     }
     return parent::convertField($name, $value);
 }
Beispiel #2
0
 /**
  * Convert Order custom values
  *
  * @param string $name Field name
  * @param mixed $value Field value
  * @return mixed Converted value
  */
 protected function convertField($name, $value)
 {
     if ($name == 'items') {
         $items = array();
         foreach ($value as $item) {
             $items[] = array('orderItemID' => $item->orderItemID, 'orderID' => $item->orderID, 'parentOrderItemID' => $item->parentOrderItemID, 'productID' => $item->productID, 'productVariantID' => $item->productVariantID, 'productImageID' => $item->productImageID, 'orderItemProductCode' => $item->orderItemProductCode, 'orderItemProductName' => $item->orderItemProductName, 'orderItemCustomerLanguageProductName' => $item->orderItemCustomerLanguageProductName, 'orderItemCategoryName' => $item->orderItemCategoryName, 'orderItemCustomerLanguageCategoryName' => $item->orderItemCustomerLanguageCategoryName, 'orderItemBrandName' => $item->orderItemBrandName, 'orderItemCustomerLanguageBrandName' => $item->orderItemCustomerLanguageBrandName, 'orderItemQty' => $item->orderItemQty, 'orderItemDiscount' => $item->orderItemDiscount, 'orderItemPrice' => $item->orderItemPrice, 'orderItemDistributorPrice' => $item->orderItemDistributorPrice, 'orderItemTotal' => $item->orderItemTotal, 'orderItemTaxesAmount' => $item->orderItemTaxesAmount, 'orderItemTaxesRate' => $item->orderItemTaxesRate, 'orderItemCustomerCurrencyDiscount' => $item->orderItemCustomerCurrencyDiscount, 'orderItemCustomerCurrencyPrice' => $item->orderItemCustomerCurrencyPrice, 'orderItemCustomerCurrencyTotal' => $item->orderItemCustomerCurrencyTotal, 'orderItemCustomerCurrencyTaxesAmount' => $item->orderItemCustomerCurrencyTaxesAmount, 'orderItemBonusPointsSpent' => $item->orderItemBonusPointsSpent, 'shippingModuleID' => $item->shippingModuleID, 'orderItemShippingMethodCode' => $item->orderItemShippingMethodCode, 'orderItemShippingModuleName' => $item->orderItemShippingModuleName, 'orderItemCustomerLanguageShippingModuleName' => $item->orderItemCustomerLanguageShippingModuleName, 'orderItemShippingMethodName' => $item->orderItemShippingMethodName, 'orderItemCustomerLanguageShippingMethodName' => $item->orderItemCustomerLanguageShippingMethodName, 'vendorID' => $item->vendorID, 'orderItemVendorName' => $item->orderItemVendorName, 'vendorOrderID' => $item->vendorOrderID, 'vendorOrderCreateTimestamp' => $item->vendorOrderCreateTimestamp, 'orderItemOriginalProductCode' => $item->orderItemOriginalProductCode);
         }
         return $items;
     }
     if ($name == 'totalLines') {
         $totalLines = array();
         foreach ($value as $totalLine) {
             $totalLines[] = array('orderTotalLineID' => $totalLine->orderTotalLineID, 'orderID' => $totalLine->orderID, 'orderTotalLineType' => $totalLine->orderTotalLineType, 'orderTotalLineName' => $totalLine->orderTotalLineName, 'orderTotalLineCustomerLanguageName' => $totalLine->orderTotalLineCustomerLanguageName, 'orderTotalLineAmount' => $totalLine->orderTotalLineAmount, 'orderTotalLineCustomerCurrencyAmount' => $totalLine->orderTotalLineCustomerCurrencyAmount, 'orderTotalLineSort' => $totalLine->orderTotalLineSort);
         }
         return $totalLines;
     }
     return parent::convertField($name, $value);
 }
Beispiel #3
0
 /**
  * Convert Product custom values
  *
  * @param string $name Field name
  * @param mixed $value Field value
  * @return mixed Converted value
  */
 protected function convertField($name, $value)
 {
     if ($name == 'categories') {
         $categories = array();
         foreach ($value as $category) {
             $categories[] = array('categoryID' => $category->categoryID);
         }
         return $categories;
     }
     if ($name == 'images') {
         $images = array();
         foreach ($value as $image) {
             $images[] = array('productImageID' => $image->productImageID, 'productImage' => $image->productImage, 'productImageWidth' => $image->productImageWidth, 'productImageHeight' => $image->productImageHeight, 'productImageSize' => $image->productImageSize, 'productImageSort' => $image->productImageSort, 'productImageFeaturedStyle' => $image->productImageFeaturedStyle);
         }
         return $images;
     }
     return parent::convertField($name, $value);
 }