Download the PHP package justbetter/laravel-magento-customer-prices without Composer
On this page you can find all versions of the php package justbetter/laravel-magento-customer-prices. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justbetter/laravel-magento-customer-prices
More information about justbetter/laravel-magento-customer-prices
Files in justbetter/laravel-magento-customer-prices
Package laravel-magento-customer-prices
Short Description Package to push customer specific prices to Magento
License MIT
Informations about the package laravel-magento-customer-prices
Laravel Magento Customer Prices
This package provides a way to add customer specific prices to Magento from a Laravel app. By default, it uses the JustBetter Magento 2 Customer Pricing module for customer specific prices. You can implement another customer specific price module, see Updating Customer Prices.
Features
This package can:
- Retrieve prices from any source
- Push customer specific prices to Magento
- Only update prices in Magento when are modified. i.e. when you retrieve the same price ten times it only updates once to Magento
- Automatically stop syncing when updating fails
- Logs activities using Spatie activitylog
- Checks if Magento products exist using JustBetter Magento Products
Check out Laravel Magento Prices for connecting regular prices to Magneto We also have a Magento Client to easily connect Laravel to Magento!
Installation
Require this package: composer require justbetter/laravel-magento-customer-prices
Publish the config
Publish the activity log's migrations:
Run the migrations
Laravel Nova
We have a Laravel Nova integration for this package.
Usage
Add the following commands to your scheduler:
Retrieving Customer Prices
This package works with a repository that retrieves prices per SKU which you have to implement.
Repository
This class is responsible for retrieving prices for products, retrieving sku's and settings.
Your class must extend \JustBetter\MagentoCustomerPrices\Repository\Repository
and implement the retrieve
method.
If there is no price for the SKU you may return null
. In all other cases you need to return a CustomerPriceData
object which contains two elements:
sku
Requiredprices
Optional, array of customer pricesprice
float of the pricecustomer_id
Magento 2 customer idquantity
Minimum quantity
You can view the rules in the CustomerPriceData
class to get an idea of what you need to provide.
Example
Retrieving SKU's
By default, the Repository
that you are extending will retrieve the SKU's from justbetter/laravel-magento-products.
If you wish to use this you have to add the commands to your scheduler to automatically import products.
If you have another source for your SKU's you may implement the skus
method yourself.
It accepts an optional carbon instance to only retrieve modified stock.
Configuring the repository
The repository class has a couple of settings that you can adjust:
After you've created and configured the repository you have to set it in your configuration file:
Magento 2 Customer Prices
By default, this package uses the JustBetter Magento 2 Customer Pricing module for updating prices to Magento.
If you use another Magento 2 module for customer specific pricing you can write your own class that updates prices in Magento.
You can do this by implementing JustBetter\MagentoCustomerPrices\Contracts\Update\UpdatesCustomerPrice
.
See \JustBetter\MagentoCustomerPrices\Actions\Update\UpdateCustomerPrice
for an example.
Don't forget to bind your own class!
Quality
To ensure the quality of this package, run the following command:
This will execute three tasks:
- Makes sure all tests are passed
- Checks for any issues using static code analysis
- Checks if the code is correctly formatted
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Vincent Boon
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-magento-customer-prices with dependencies
justbetter/laravel-magento-async Version ^1.0
justbetter/laravel-magento-client Version ^2.6.1
justbetter/laravel-magento-products Version ^1.4
laravel/framework Version ^11.0|^12.0
spatie/laravel-activitylog Version ^4.8