Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8303751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:36:58+00:00 2026-06-08T17:36:58+00:00

I am working on amazon to vtiger integration, and a code snippet from amazon

  • 0

I am working on amazon to vtiger integration, and a code snippet from amazon MWS Client library looks like

if ($order->isSetShippingAddress()) {
    echo("                        ShippingAddress\n");
    $shippingAddress = $order->getShippingAddress();
    if ($shippingAddress->isSetName()) {
        echo("                            Name\n");
        echo("                                " . $shippingAddress->getName() . "\n");
    }
    if ($shippingAddress->isSetAddressLine1()) {
        echo("                            AddressLine1\n");
        echo("                                " . $shippingAddress->getAddressLine1() . "\n");
    }

I want to access sub function items like $shippingAddress->AddressLine1()

and my code looks like

$module          = 'Invoice';
$shippingAddress = $order->getShippingAddress();
$orderTotal      = $order->getOrderTotal();
$record          = $client->doCreate($module,Array(

                                                  'subject'   => $order->getAmazonOrderId(),
                                                  'customerno'=> $order->getAmazonOrderId(),
                                                  bill_city' => $shippingAddress->getAddressLine1(),
                                                  'bill_state'=> $shippingAddress->getStateOrRegion(),
                                                  'bill_code' => $shippingAddress->getPostalCode(),

when I try this, I get error

Fatal error: Call to a member function getAddressLine1() on a non-object

is this a scope error?? how can I use subfunction of $shippingAddress??

help me please

COMPLETE CODE

function invokeListOrders(MarketplaceWebServiceOrders_Interface $service, $request) 
  {
      try {
              $response = $service->listOrders($request);

                if ($response->isSetListOrdersResult()) { 
                    echo("            ListOrdersResult\n");
                    $listOrdersResult = $response->getListOrdersResult();

                    if ($listOrdersResult->isSetOrders()) { 
                        echo("                Orders\n");
                        $orders = $listOrdersResult->getOrders();
                        $orderList = $orders->getOrder();
                        foreach ($orderList as $order) {
                            $shippingAddress = $order->getShippingAddress();
    include_once('vtwsclib/Vtiger/WSClient.php');                       
$url = 'http://vijayholdings.com/admin';
$client = new Vtiger_WSClient($url);
$login = $client->doLogin('admin', 'MYSECRETKEY');
if(!$login) echo 'Login Failed';                            
            else{   
                    $module = 'Invoice';
                    $shippingAddress = $order->getShippingAddress();
                     $orderTotal = $order->getOrderTotal();
                    $record = $client->doCreate($module,Array(

          'subject'=>$order->getAmazonOrderId(), 
          'customerno'=>$order->getAmazonOrderId(),
          'invoicestatus'=>'Credit Invoice',/*
          'assigned_user_id'=>'spatel',
          'currency_id'=>'1',
          'conversion_rate'=>'1',  not working*/
          'bill_street'=>$order->getShippingAddress(),/* 
          'bill_city'=>$shippingAddress->getCity(),
          'bill_state'=>$shippingAddress->getStateOrRegion(), 
          'bill_code'=>$shippingAddress->getPostalCode(),
          'bill_country'=>$order->$shippingAddress->getCounty(), */
          'cf_652'=>'Deepdiscounts.co Amazon FBA',/* 
          'cf_653'=>$shippingAddress->getPhone(),
          'cf_656'=>$shippingAddress->getAddressLine2(), */
          'cf_660'=>$order->getShipServiceLevel(),
          'cf_658'=>$order->getSalesChannel(),
          'cf_661'=>$order->getFulfillmentChannel(),
          'cf_663'=>$order->getBuyerName(),       
          'cf_659'=>$order->getBuyerEmail(), 
          'cf_662'=>$order->getPaymentMethod()
          ));
            }
    if($record) {
        $recordid = $client->getRecordId($record['id']);
  echo "The id is ".$recordid;
    }


                 } 
                }
                }

     } catch (MarketplaceWebServiceOrders_Exception $ex) {
         echo("Caught Exception: " . $ex->getMessage() . "\n");
         echo("Response Status Code: " . $ex->getStatusCode() . "\n");
         echo("Error Code: " . $ex->getErrorCode() . "\n");
         echo("Error Type: " . $ex->getErrorType() . "\n");
         echo("Request ID: " . $ex->getRequestId() . "\n");
         echo("XML: " . $ex->getXML() . "\n");
         echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
     }

OUTPUT OF RAW_DUMP
HERE IS ONE SALE ORDER FORM THE LIST ON WHICH I AM WORKING

(1) { [“_fields:protected”]=> array(11) { [“Name”]=> array(2) {
[“FieldValue”]=> string(16) “Jason A. Stewart” [“FieldType”]=>
string(6) “string” } [“AddressLine1”]=> array(2) { [“FieldValue”]=>
string(15) “101 Young Drive” [“FieldType”]=> string(6) “string” }
[“AddressLine2”]=> array(2) { [“FieldValue”]=> NULL [“FieldType”]=>
string(6) “string” } [“AddressLine3”]=> array(2) { [“FieldValue”]=>
NULL [“FieldType”]=> string(6) “string” } [“City”]=> array(2) {
[“FieldValue”]=> string(6) “Smyrna” [“FieldType”]=> string(6) “string”
} [“County”]=> array(2) { [“FieldValue”]=> NULL [“FieldType”]=>
string(6) “string” } [“District”]=> array(2) { [“FieldValue”]=> NULL
[“FieldType”]=> string(6) “string” } [“StateOrRegion”]=> array(2) {
[“FieldValue”]=> string(2) “TN” [“FieldType”]=> string(6) “string” }
[“PostalCode”]=> array(2) { [“FieldValue”]=> string(5) “37167”
[“FieldType”]=> string(6) “string” } [“CountryCode”]=> array(2) {
[“FieldValue”]=> string(2) “US” [“FieldType”]=> string(6) “string” }
[“Phone”]=> array(2) { [“FieldValue”]=> string(10) “6152231070”
[“FieldType”]=> string(6) “string” } } }

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:36:59+00:00Added an answer on June 8, 2026 at 5:36 pm

    All this means is that your $shippingAddress var does not have an object in it. It is likely that your call to getShippingAddress() has failed.

    Do a var_dump($shippingAddress) to see what’s in there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working for a scientific project and would like to use the Amazon
I am using Amazon EC2 services & and its working correctly but suddenly from
I'm working on an application that utilizes Amazon's MWS API written mostly in PHP.
I am currently working on system that generated product recommendations like those on Amazon
I'm trying to get a simple example with amazon MWS working. I downloaded the
I am working with Amazon In-app-purchases for Android on flash using native extentions. So,
I am working with amazon boto and I have 2 lists. List 1 contains
I'm working on a Hadoop streaming workflow for Amazon Elastic Map Reduce and it
I'm trying to get Heroku working with European buckets on amazon s3 webserivces using
I took my first step today on working with cloud servers and chosed Amazon

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.