PHP code example of google / shopping-merchant-ordertracking
1. Go to this page and download the library: Download google/shopping-merchant-ordertracking library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
google / shopping-merchant-ordertracking example snippets
Google\ApiCore\ApiException;
Google\Shopping\Merchant\OrderTracking\V1\Client\OrderTrackingSignalsServiceClient;
Google\Shopping\Merchant\OrderTracking\V1\CreateOrderTrackingSignalRequest;
Google\Shopping\Merchant\OrderTracking\V1\OrderTrackingSignal;
Google\Shopping\Merchant\OrderTracking\V1\OrderTrackingSignal\LineItemDetails;
Google\Shopping\Merchant\OrderTracking\V1\OrderTrackingSignal\ShippingInfo;
Google\Shopping\Merchant\OrderTracking\V1\OrderTrackingSignal\ShippingInfo\ShippingState;
Google\Type\DateTime;
$formattedParent = OrderTrackingSignalsServiceClient::accountName('[ACCOUNT]');
$orderTrackingSignalOrderId = '[ORDER_ID]';
$orderTrackingSignalShippingInfoShipmentId = '[SHIPMENT_ID]';
$orderTrackingSignalShippingInfoShippingStatus = ShippingState::SHIPPING_STATE_UNSPECIFIED;
$orderTrackingSignalShippingInfoOriginPostalCode = '[ORIGIN_POSTAL_CODE]';
$orderTrackingSignalShippingInfoOriginRegionCode = '[ORIGIN_REGION_CODE]';
$orderTrackingSignalLineItemsLineItemId = '[LINE_ITEM_ID]';
$orderTrackingSignalLineItemsProductId = '[PRODUCT_ID]';
$orderTrackingSignalLineItemsQuantity = 0;
create_order_tracking_signal_sample(
$formattedParent,
$orderTrackingSignalOrderId,
$orderTrackingSignalShippingInfoShipmentId,
$orderTrackingSignalShippingInfoShippingStatus,
$orderTrackingSignalShippingInfoOriginPostalCode,
$orderTrackingSignalShippingInfoOriginRegionCode,
$orderTrackingSignalLineItemsLineItemId,
$orderTrackingSignalLineItemsProductId,
$orderTrackingSignalLineItemsQuantity
);