meeeet-dev/laravel-facebook-catalog

Laravel Facebook Catalog 包,用于导出格式化的XML数据

v1.3 2024-03-12 12:37 UTC

This package is auto-updated.

Last update: 2024-09-12 13:47:39 UTC


README

安装

您可以通过composer安装此包

composer require meeeet-dev/laravel-facebook-catalog

用法

use MeeeetDev\LaravelFacebookCatalog\LaravelFacebookCatalog;

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

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' => 'in stock',
    "price" => 99.99,
    'brand' => 'Foo brand',
    'condition' => 'new',
]);

return LaravelFacebookCatalog::display();

预期的数组示例

[
    "id" 	            		        => "", // Unique Example SKU
    "title" 	            		    => "", // Max 200 Characters, recommend 65 maximum
    "description"            	        => "",
    "rich_text_description"             => "", // A description of the item containing rich text (HTML) formatting
    "availability"           	        => "in stock", // values: in stock, out of stock
    "condition" 	            	    => "new", // values: new, refurbished, used
    "price" 		            	    => 0.00,
    "link"		                        => "",
    "image_link"		                => "",
    "brand" 		            	    => "",
    // required fileds for payments in USA only and optional everywhere else
    "quantity_to_sell_on_facebook"      => 10, // previously name "inventory"
    "google_product_category"           => "",
    "fb_product_category"               => null,
    "size"                              => null,
    // required in india and optional everywhere else
    "origin_country"                    => null, // Ex: US
    "importer_name"                     => null, // if the origin country is not INDIA
    "importer_address"                  => null,
    "manufacturer_info"                 => null,
    "wa_compliance_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, // separated by a comma (,), semicolon (;), space ( ) or vertical bar (|)
    "gender"                            => null, // female, male, unisex
    "color"                             => null, // The main colour of the item. Describe the colour in words, not a hex code. Character limit: 200.
    "age_group"                         => null, // Values: adult, all ages, teen, kids, toddler, infant, newborn.
    "material" 	                        => null, // The material the item is made from, such as cotton, polyester, denim or leather
    "pattern"	                        => null, // The pattern or graphic print on the item
    "shipping"                          => null,
    "shipping_weight"                   => null,
]

更多详情请见 > https://web.facebook.com/business/help/120325381656392?id=725943027795860

测试

composer test

更新日志

请参阅更新日志获取最近更改的详细信息。

贡献

请参阅贡献指南获取详细信息。

安全漏洞

请查看我们的安全策略了解如何报告安全漏洞。

致谢

许可证

MIT许可证(MIT)。请参阅许可证文件获取更多信息。