Show Posts


Messages - Rawinder Dhillon

Pages: 1 [2]
16
API Development / Re: Shipping Method selection problem
« on: October 26, 2020, 12:41:09 PM »
Thx

17
API Development / Re: Shipping Method selection problem
« on: October 22, 2020, 12:06:33 PM »
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'))

18
API Development / Re: Shipping Method selection problem
« on: October 21, 2020, 01:13:10 PM »
ok admin :-(

19
API Development / Re: Shipping Method selection problem
« on: October 21, 2020, 10:39:27 AM »
I am trying to clarify the question. Are you expecting to see the same list all the time?

What version of Abantecart do you have?


im using an older version

20
API Development / Re: Shipping Method selection problem
« on: October 21, 2020, 10:38:59 AM »
I am trying to clarify the question. Are you expecting to see the same list all the time?

What version of Abantecart do you have?

no, from android app , (as i already know the shipping methods) i dont need to access list with mode =List
so i want to use "mode= Select" Command(that selects shipping Method)
but Mode=Select Command returns list of shipping Method options
its actual output must be
{
    "status": 1,
    "shipping_select": "success"
}


in postman it returns this output on when i Run this command 2nd time .




21
dont know it is helpful or not for parveen now but may be helpful for someone else :-)
i solved this one
in 2nd step use
rt: a/account/account instead of rt: a/account/login
and we need to send cookies in headers that mainly include session and customer cookies that we received in step 1.



22
parveen , did you solved the problem ???

23
API Development / Re: getting 401 unauthorized response from API
« on: August 03, 2020, 02:23:36 PM »
problem solved by sending data in x-www-form-urlencoded format

24
API Development / getting 401 unauthorized response from API
« on: August 01, 2020, 03:37:48 PM »
i'm not a php developer , but can understand php code
problem is i'm trying to login through API. As i understand it , it includes 2 steps , first send email , password and api_key through Post Url
htps://MYDOMAIN.com/?rt=a/account/login&email=xxxxxx@gmail.com&password=xxxxxxx&api_key=12345
according to me , it will hit login.php & return me a Token and code 200.(as i can see from login .php in API Folder )
but it is returning 401, unauthorized
Now the questions are ?
M
ay be it is due to first step and yet no functionality  for resend data with tokens, but how can i get token in first step?
as i'm not getting one, i thought it is in the form of json , and  as response of command .


*with text_api.php i'm able to login with customer credentials
** Able to fetch Product with Get Command from Browser
 

Pages: 1 [2]

Powered by SMFPacks Social Login Mod