AbanteCart Development > API Development
Shipping Method selection problem
Rawinder Dhillon:
ok admin :-(
Rawinder Dhillon:
if (!isset($this->session->data[ 'shipping_methods' ]) || !$this->config->get('config_shipping_session')) {
$quote_data = array();
$results = $this->model_checkout_extension->getExtensions('shipping');
foreach ($results as $result) {
$this->loadModel('extension/' . $result[ 'key' ]);
$quote = $this->{'model_extension_' . $result[ 'key' ]}->getQuote($shipping_address);
if ($quote) {
$quote_data[ $result[ 'key' ] ] = array(
'title' => $quote[ 'title' ],
'quote' => $quote[ 'quote' ],
'sort_order' => $quote[ 'sort_order' ],
'error' => $quote[ 'error' ]
);
}
}
$sort_order = array();
foreach ($quote_data as $key => $value) {
$sort_order[ $key ] = $value[ 'sort_order' ];
}
array_multisort($sort_order, SORT_ASC, $quote_data);
$this->session->data[ 'shipping_methods' ] = $quote_data;
}
this function from API print List of shipping methods when condition is true
can someone plz explain the line below?
!$this->config->get('config_shipping_session'))
abantecart:
config_shipping_session is used to be for optimize number of request to shipping providers and minimize re-qoute requests.
This will not be helpful in API case as session can not be used.
Rawinder Dhillon:
Thx
abantecart:
Rawinder,
Please feel free to provide some feedback and we would be glad to work together and improve Abantecart storefront API.
Version 1.2.17 is active in development now, we can incorporate API updates as well.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version