Author Topic: Custom Shipping Extension - Total Price not Changing  (Read 1002 times)

Offline Eric_2358

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
    • View Profile
Custom Shipping Extension - Total Price not Changing
« on: July 21, 2018, 10:50:14 AM »
I am making a custom shipping extension, which uses the prices of shipping methods from another site

Currently the shipping methods add to the shipment combo box on the checkout page
When any of the methods get selected, the shipping details do not add to the sub total price / total price of the checkout (the attachment shows this)


Here is my current code for adding the shipping methods to the combo box.
Quote
function getQuote($address) {
   
        $quote_data = array('custom_method' => array(
                'id' => 'custom_shipping.custom_method',
                'title' => 'Custom Method',
                'cost' => 5,
                'tax_class_id' => 0,
                'text' => $this->currency->format('5')));
       
   $method_data = array(
      'id'         => 'custom_shipping',
      'title'      => 'custom shipping',
      'quote'      => $quote_data,
      'sort_order' => 0,
      'error'      => false);
      
   return $method_data;
}
« Last Edit: July 21, 2018, 11:18:08 AM by Eric_2358 »

Offline Eric_2358

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
    • View Profile
Re: Custom Shipping Extension - Total Price not Changing
« Reply #1 on: July 21, 2018, 03:12:36 PM »
I have figured out my problem

Quote
function getQuote($address) {
   
        $quote_data = array('custom_method' => array(
                'id' => 'custom_shipping.custom_method',          <----------- the id value needs to be '[Extension ID].[array key]
                'title' => 'Custom Method',
                'cost' => 5,
                'tax_class_id' => 0,
                'text' => $this->currency->format('5')));
       
   $method_data = array(
      'id'         => 'custom_shipping',
      'title'      => 'custom shipping',
      'quote'      => $quote_data,
      'sort_order' => 0,
      'error'      => false);
     
   return $method_data;
}
« Last Edit: July 21, 2018, 03:14:14 PM by Eric_2358 »

 

Powered by SMFPacks Social Login Mod