예제 #1
0
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     $package = parent::getTestRatesData($schema, $errors);
     $package['srcAddress']['country'] = 'CA';
     $data = array('packages' => array($package));
     return $data;
 }
예제 #2
0
파일: Usps.php 프로젝트: kewaunited/xcart
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     $data = parent::getTestRatesData($schema, $errors);
     $config = \XLite\Core\Config::getInstance()->CDev->USPS;
     $package = array('weight' => $data['weight'], 'subtotal' => $data['subtotal'], 'length' => $config->length, 'width' => $config->width, 'height' => $config->height);
     $data['packages'] = array($package);
     unset($data['weight']);
     unset($data['subtotal']);
     return $data;
 }
예제 #3
0
파일: Fedex.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     $data = parent::getTestRatesData($schema, $errors);
     $package = array('weight' => $data['weight'], 'subtotal' => $data['subtotal']);
     $data['packages'] = array($package);
     unset($data['weight'], $data['subtotal']);
     return $data;
 }
예제 #4
0
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     $data = parent::getTestRatesData($schema, $errors);
     list($data['length'], $data['width'], $data['height']) = $data['dimensions'];
     unset($data['dimensions']);
     return array('package' => $data);
 }
예제 #5
0
파일: Aupost.php 프로젝트: kewaunited/xcart
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     $package = parent::getTestRatesData($schema, $errors);
     $package['from_postcode'] = $package['srcAddress']['zipcode'];
     $package['to_postcode'] = $package['dstAddress']['zipcode'];
     $package['country_code'] = $package['dstAddress']['country'];
     unset($package['srcAddress']);
     unset($package['dstAddress']);
     return array('packages' => array($package));
 }
예제 #6
0
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     return array('package' => parent::getTestRatesData($schema, $errors));
 }
예제 #7
0
 /**
  * Get input data to calculate test rates
  *
  * @param array $schema  Input data schema
  * @param array &$errors Array of fields which are not set
  *
  * @return array
  */
 protected function getTestRatesData(array $schema, &$errors)
 {
     $package = parent::getTestRatesData($schema, $errors);
     $data = array('packages' => array($package));
     return $data;
 }