PHP code example of gptinker / laravel-google-merchant

1. Go to this page and download the library: Download gptinker/laravel-google-merchant 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/ */

    

gptinker / laravel-google-merchant example snippets


GOOGLE_MERCHANT_ID="1234567890"
GOOGLE_MERCHANT_TARGET_COUNTRY="AE"
GOOGLE_MERCHANT_CONTENT_LANGUAGE="en"
GOOGLE_MERCHANT_CHANNEL="online"

$response = ProductApi::fetch();

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}

$response = ProductApi::insert($product);

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}

$response = ProductApi::get($product_id);

if($response['status'] == 'success'){
    // Found
}else{
    // Not Found
}

$response = ProductApi::update($product, $product_id);

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}

$response = ProductApi::delete($product_id);

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}