Package to send customer specific prices to Magento from a Laravel application using a configurable source.

Overview

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 Magaplaza Better Tier Price module for customer specific prices. You can implement another customer specific price module, see Replacing Mageplaza.

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
  • Logs errors using JustBetter Error Logger
  • Checks if Magento products exist using JustBetter Magento Products

Installation

Require this package: composer require justbetter/laravel-magento-customer-prices

Publish the config

php artisan vendor:publish --provider="JustBetter\MagentoCustomerPrices\ServiceProvider" --tag="config"

Publish the activity log's migrations:

php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"

Run the migrations

php artisan migrate

Usage

Add the following commands to your scheduler:

<?php

protected function schedule(Schedule $schedule): void
{
    $schedule->command(\JustBetter\MagentoCustomerPrices\Commands\SyncCustomerPricesCommand::class)->everyMinute();

    // Retrieve all customer prices weekly
    $schedule->command(\JustBetter\MagentoCustomerPrices\Commands\RetrieveAllCustomerPricesCommand::class)->weekly();

    // Retrieve updated customer prices daily
    $schedule->command(\JustBetter\MagentoCustomerPrices\Commands\RetrieveUpdatedCustomerPricesCommand::class)->daily();
}

Retrieving Customer Prices

To retrieve prices you have to write a retriever. A retriever is a class that extends the \JustBetter\MagentoCustomerPrices\Retriever\CustomerPriceRetriever class.

You'll be required to write three methods:

retrieve(string $sku)

Must return an enumerable of \JustBetter\MagentoCustomerPrices\Data\CustomerPriceData objects

retrieveAllSkus()

Must return an enumerable of strings

retrieveUpdatedSkus()

Must return an enumerable of strings

Example

See the \JustBetter\MagentoCustomerPrices\Retriever\DummyCustomerPriceRetriever class for an example.

Replacing Mageplaza

By default this package uses the Magaplaza Better Tier Price module for updating prices to Magento. You can use another package by creating a class that implements JustBetter\MagentoCustomerPrices\Contracts\UpdatesMagentoCustomerPrices. See \JustBetter\MagentoCustomerPrices\Actions\UpdateMageplazaCustomerPrices for an example.

Don't forget to bind your own class!

<?php

app()->singleton(UpdatesMagentoCustomerPrices::class, YourCustomUpdater::class);

Quality

To ensure the quality of this package, run the following command:

composer quality

This will execute three tasks:

  1. Makes sure all tests are passed
  2. Checks for any issues using static code analysis
  3. 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

License

The MIT License (MIT). Please see License File for more information.

You might also like...
Magento extension which makes it impossible for a customer to log in until the account has been activated by the administrator.

This Magento 1 extension is orphaned, unsupported and no longer maintained. If you use it, you are effectively adopting the code for your own project.

Set a customer password with bin/magento.

Set a customer password Since Magento 2 no longer provides facilities to set a customers password, this command can come in handy during development w

Force Customer Login Module for Magento 2
Force Customer Login Module for Magento 2

Force Login Module for Magento® 2 The Force Login Module for Magento® 2 allows you to restrict which pages a visitor is able to see. Visitors get redi

Magento 2 Module that adds Donation Product Type. Enables the customer to add a donation (product) of a preferred amount to the cart.
Magento 2 Module that adds Donation Product Type. Enables the customer to add a donation (product) of a preferred amount to the cart.

Magento 2 Module Experius DonationProduct (RC1.0) Demo website: https://donationproduct.experius.nl Magento Marketplace: https://marketplace.magento.c

Magento 2 custom extension to add custom attributes(longitude, latitude) to customer address

Magento 2 custom extension to add custom attributes(longitude, latitude) to customer address. Then save them to quote model and copy them from quote address to order address on bakend, frontend, rest api

A Magento 2 module that enables configurable CORS Headers on the GraphQL and REST APIs

Magento 2 CORS Magento Version Support Ever try to work with the Magento GraphQL API or REST API from your browser and see the following? Access to XM

This plugin can be embedded in PHP application to give the web application specific routes/href

Routes Plugin PHP This plugin can be embedded in PHP application to give the web application specific routes/href location and for entering specific/l

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers

Magento 2 SMTP Extension - Gmail, G Suite, Amazon SES, Office 365, Mailgun, SendGrid, Mandrill and other SMTP servers. For Magento 2.0.x, 2.1.x, 2.2.x

The Laravel eCommerce Accept Payment Gateway allows the customer to make use of Accept payment gateway in the Bagisto eCommerce website.

Introduction Bagisto WeAccept add-on allow customers to pay for others using WeAccept payment gateway. Requirements: Bagisto: 1.3.2 Installation with

Releases(1.0.2)
  • 1.0.2(Oct 31, 2022)

    What's Changed

    • Add GitHub Actions for tests, static analysis and style check by @VincentBean in https://github.com/justbetter/laravel-magento-customer-prices/pull/1
    • Coverage action by @VincentBean in https://github.com/justbetter/laravel-magento-customer-prices/pull/2

    New Contributors

    • @VincentBean made their first contribution in https://github.com/justbetter/laravel-magento-customer-prices/pull/1

    Full Changelog: https://github.com/justbetter/laravel-magento-customer-prices/compare/1.0.1...1.0.2

    Source code(tar.gz)
    Source code(zip)
Owner
JustBetter
We're an innovative development agency from The Netherlands building awesome websites, webshops and web applications with Laravel and Magento.
JustBetter
Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices

Simple Configurable Products Extension For Magento This documentation applies to SCP versions 0.7 onwards. The documentation for SCP v0.6 and earlier

Simon King 288 Nov 7, 2022
Laravel Nova integration for justbetter/laravel-magento-customer-prices

Laravel Magento Customer Prices Nova Laravel Nova integration for justbetter/laravel-magento-customer-prices. Installation Install the package. compos

JustBetter 13 Nov 4, 2022
This package is the Laravel Nova integration for justbetter/laravel-magento-prices

Laravel Magento Products Nova This package is the Laravel Nova integration for justbetter/laravel-magento-products. Installation Install the package.

JustBetter 14 Nov 4, 2022
Laravel Nova integration for justbetter/laravel-magento-prices

Laravel Magento Prices Nova This package is the Laravel Nova integration for justbetter/laravel-magento-prices. Installation Install the package. comp

JustBetter 15 Nov 29, 2022
This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

Hugues Alary 95 Feb 11, 2022
SuiteCRM is the award-winning open-source, enterprise-ready Customer Relationship Management (CRM) software application.

SuiteCRM is the award-winning open-source, enterprise-ready Customer Relationship Management (CRM) software application.

SalesAgility 111 Dec 21, 2022
Magento 2 module to quickly acces products, orders and customer from admin menu

Magento 2 module to quickly access product, order or customer views Introduction The Magento 2 backend can be sluggish. Ever wanted to access a produc

null 1 Dec 3, 2021
Extends the customer functionality of Magento.

FireGento_Customer This extension extends the core functionality of the customer module of Magento. It is possible to temporarily lock the user accoun

FireGento e. V. 23 Apr 1, 2022