0

I am integrating carrier service API for shopify store. I have partner account and also i have created development store. After installed my app in my store and subscribed carrier service. But in store shipping settings page i got an error

There are no available services for the countries you’ve selected

How to overcome this issue?

I have in the settings page:

  • My Carrier Service 5588680759
  • Rate adjustment: 0% + $0.00

There are no available services for the countries you’ve selected.

Automatically offering future shipping services when they become available

Screenshot:

enter image description here

how can i implement on Checkout Page?

1
  • Did you ever solve this? Facing the same issue.
    – PJATX
    Jun 19, 2018 at 1:14

2 Answers 2

0

I had the same problem and i solved it changing the callback url of the carrier service to public on my shopify application, you have to check if the url is accessible for everyone. (sorry for my english)

Shopify Documentation

0

You have to define Call url in shipment carries

"callback_url"=> base_url().'shipment/rates'

add these in controller or file which you add in call url

$filename = time();
    $input = file_get_contents('php://input');
    file_put_contents($filename.'-input', $input);

    // parse the request
    $rates = json_decode($input, true);

    // log the array format for easier interpreting
    file_put_contents($filename.'-debug', print_r($rates, true));

    // total up the cart quantities for simple rate calculations
    $quantity = 0;
    foreach($rates['rate']['items'] as $item) {
        $quantity =+ $item['quantity'];
    }

    // use number_format because shopify api expects the price to be "25.00" instead of just "25"

    // overnight shipping is 5 per item
    $overnight_cost = number_format(5, 2, '', '');

    // overnight shipping is 1 to 2 days after today
    $on_min_date = date('Y-m-d H:i:s O', strtotime('+1 day'));
    $on_max_date = date('Y-m-d H:i:s O', strtotime('+2 days'));


    // build the array of line items using the prior values
    $output = array('rates' => array(
        array(
            'service_name' => 'Shipment Local',
            'service_code' => 'SL',
            'total_price' => $overnight_cost,
            'currency' => 'PKR',
            'min_delivery_date' => $on_min_date,
            'max_delivery_date' => $on_max_date
        )
    ));

    // encode into a json response
    $json_output = json_encode($output);

    // log it so we can debug the response
    file_put_contents($filename.'-output', $json_output);

    // send it back to shopify
    print $json_output;

Change According to you needs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.