News:

AbanteCart v1.4.3 is released.

Main Menu

Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Rawinder Dhillon

#16
API Development / Re: Shipping Method selection problem
October 26, 2020, 12:41:09 PM
Thx
#17
API Development / Re: Shipping Method selection problem
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
October 21, 2020, 01:13:10 PM
ok admin :-(
#19
API Development / Re: Shipping Method selection problem
October 21, 2020, 10:39:27 AM
Quote from: maxter on October 21, 2020, 08:57:51 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
October 21, 2020, 10:38:59 AM
Quote from: maxter on October 21, 2020, 08:57:51 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
problem solved by sending data in x-www-form-urlencoded format
#24
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

Forum Rules Code of conduct
AbanteCart.com 2010 -