PHP code example of donmbelembe / laravel-facebook-catalog

1. Go to this page and download the library: Download donmbelembe/laravel-facebook-catalog 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/ */

    

donmbelembe / laravel-facebook-catalog example snippets


use Donmbelembe\LaravelFacebookCatalog\LaravelFacebookCatalog;

LaravelFacebookCatalog::setTitle('Example feed');
LaravelFacebookCatalog::setDescription('Example feed of the Example shop');
LaravelFacebookCatalog::setLink('https://example.shop');

LaravelFacebookCatalog::addItem([
    'link' => 'https://example.shop/p/foo-bar',
    'id' => 'SKU123',
    'title' => 'Foo bar',
    'image_link' => 'https://example.shop/images/foo-bar.png',
    'description' => 'Foo bar best product',
    'availability' => 'new',
    "price" => 99.99,
    'brand' => 'Foo brand',
    'condition' => 'new',
]);

return LaravelFacebookCatalog::display();

[
    "id" 	            		    => "", // Unique Example SKU
    "title" 	            		    => "", // Max 150 Characters
    "description"            	    => "",
    "availability"           	    => "in stock", // values: in stock, available for order, out of stock
    "condition" 	            	    => "new", // values: new, refurbished, used
    "price" 		            	    => 0.00,
    "link"		                    => "",
    "image_link"		                => "",
    "brand" 		            	    => "",
    // ompliance_category"         => null,
    // Optional fields
    "sale_price"                     => null,
    "sale_price_effective_date"      => null,
    "item_group_id"                  => null,
    "status"                         => null, // Values: active, archived (or staging)
    "additional_image_link"          => null,
    "gender"                         => null,
    "color"                          => null,
    "age_group"                      => null, // Values: adult, all ages, teen, kids, todler, infant, newborn.
    "material" 	                    => null,
    "patern"	                        => null,
    "shipping"                       => null,
    "shipping_weight"                => null,
]