timothydc / laravel-lightspeed-ecom-product-feeds
Laravel package for Lightspeed product feeds
Requires
- php: ^7.4|^8.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0|^11.0
- laravel/legacy-factories: ^1.0.5
- spatie/array-to-xml: ^2.10|^3.0
- timothydc/laravel-lightspeed-ecom-api: ^1.1
Requires (Dev)
- dev-master
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.1.0
- dev-feature/add-support-for-L10-L11
- dev-feature/laravel9
This package is auto-updated.
Last update: 2024-10-23 16:23:56 UTC
README
Installation
Via Composer
$ composer require timothydc/laravel-lightspeed-ecom-product-feeds
You can publish all resources, or you may choose to publish them separately:
$ php artisan vendor:publish --tag="lightspeed-ecom-product-feed" $ php artisan vendor:publish --tag="lightspeed-ecom-product-feed:config" $ php artisan vendor:publish --tag="lightspeed-ecom-product-feed:migrations"
Run your migrations to create the product_feeds
table.
$ php artisan migrate
You can choose to automatically run the created feeds via the task scheduler.
It is also possible to generate the feeds directly or via a queue job. See config/lightspeed-ecom-product-feed.php
for more configuration options.
return [ 'feed_disk' => env('LS_PRODUCT_FEEDS_FEED_DISK', 'public'), 'scheduled_tasks' => [ 'auto_run' => env('LS_PRODUCT_FEEDS_AUTO_RUN', true), 'use_queue' => env('LS_PRODUCT_FEEDS_USE_QUEUE', true), 'queue' => env('LS_PRODUCT_FEEDS_QUEUE', 'default') ], ];
Custom feed mapping
Create your own class and let it implement ProductPayloadMappingInterface
. Or take a look at TimothyDC\LightspeedEcomProductFeed\Feeds\StandardFeed
for some XML data structure inspiration.
use TimothyDC\LightspeedEcomProductFeed\Interfaces\ProductPayloadMappingInterface; class CustomProductXml implements ProductPayloadMappingInterface { public function execute(string $baseUrl, array $product): array { return ['product_id' => $product['id']]; } }
This package also offers some template feeds for:
- Sooqr (
TimothyDC\LightspeedEcomProductFeed\Feeds\SooqrFeed
)
Available commands
Create a new product feed and answer the presented questions. Enter a valid cron expression when asked. Use a FQN for your custom class.
$ php artisan ecom-feed:create > Enter your custom mapping class: > Enter your cron interval: > Enter your webshop API key: > Enter your webshop API secret: > What language should your feed be in?
Show a list of all the currently created product feeds.
$ php artisan ecom-feed:list
Update a product feed.
$ php artisan ecom-feed:update {id}
Show a product feed configuration.
$ php artisan ecom-feed:show {id}
Remove a product feed.
$ php artisan ecom-feed:remove {id}
Generate an XML by providing a product feed ID.
$ php artisan ecom-feed:generate {id}
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Credits
License
MIT. Please see the license file for more information.