Download the PHP package loyaltyengage/loyaltyshop without Composer

On this page you can find all versions of the php package loyaltyengage/loyaltyshop. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package loyaltyshop

LoyaltyEngage LoyaltyShop for Magento 2

A Magento 2 module that allows customers to add products to their cart based on loyalty points.

Features

Cart Safety and Recovery

Minimum spend is checked using the quote's store configuration after totals collection and before order submission, including quantity-only reductions. Ineligible rewards are removed and their removal events persisted once. If submission removes rewards, customers must review their cart before proceeding.

Physical reservation recovery retires an applied journal only when an exact completed removal cycle is proven. It examines at most 1,001 recent removal rows (up to 1,000 provable cycles); older or ambiguous history remains protected. It never blindly repeats an uncertain purchase. Recovery processes at most 25 records per run with a 45-second budget checked between records; an in-flight API request can exceed that budget. Supporting indexes belong only to loyaltyshop_mutation, not Magento sales tables.

Shipping rate collection is forced only when loyalty eligibility changes; Magento's own invalidation for address/cart changes remains intact.

General Features

Requirements

Installation

Via Composer (Recommended)

  1. Add the repository to your Magento 2 project's composer.json:

  2. Enable the module:

Cron and Consumer Ownership

The module does not write to app/etc/env.php or change cron_consumers_runner. Manage these settings through your deployment. Existing runner settings are not restored or modified on upgrade, including settings written by older module versions.

New events use loyaltyshop_outbox. Ensure your platform runs Magento's default cron group: loyaltyshop_deliver_events runs every minute, loyaltyshop_recover_mutations every five minutes and loyalty_cart_expiry every fifteen minutes. Running AMQP consumers alone does not deliver the outbox. Inspect cron_schedule for these jobs and use bin/magento loyalty:events to inspect delivery state.

The six consumers in etc/queue_consumer.xml remain for draining legacy messages. They explicitly use the db connection, independently of your platform's AMQP workers. If you have a legacy backlog, run the needed consumers using your existing worker supervisor, for example:

The other declared names are loyaltyshop_return_event_consumer, loyaltyshop_free_product_purchase_event_consumer, loyaltyshop_free_product_remove_event_consumer, loyaltyshop_review_event_consumer and loyaltyshop_redeem_discount_event_consumer. These transfer legacy messages to the outbox, which still requires the default cron group.

If your deployment intentionally uses Magento's cron consumer runner instead of supervised workers, maintain its cron_consumers_runner configuration in your deployment template. Preserve platform-wide choices for cron_run, max_messages and the consumer allowlist. No runner setting is required specifically for new LoyaltyShop outbox events. Review any old auto-added entries with your operations team; this upgrade cannot infer which entries your deployment owns.

Manual Installation

  1. Create a directory structure in your Magento installation: app/code/LoyaltyEngage/LoyaltyShop
  2. Download the module and extract its contents to the directory you created
  3. Enable the module:

Configuration

  1. Log in to your Magento Admin Panel
  2. Navigate to Stores > Configuration > LoyaltyEngage > LoyaltyShop
  3. Configure the following settings:
    • API Connection Settings
    • Cart Expiry Options
    • Order Processing Settings

Usage

Purchase and Return Tax Basis

Under Stores > Configuration > Loyalty Engage > Loyalty > Loyalty Export Settings, set Purchase and Return Price Tax Basis to Excluding Tax (default) or Including Tax. It is configurable per website/store view, using the order's store for both events. The default preserves existing export behavior.

This changes the product unit price in newly generated Purchase and Return payloads, in the order currency. Inclusive mode reads the stored price_incl_tax, preserving the historical tax treatment without querying current catalog prices or tax rules. For creditmemos missing that value, the original order item's inclusive unit price is used. If neither historical value exists, the existing exclusive price is retained rather than inventing tax or exporting zero. Zero prices remain zero. Quantities, coupon/discount handling, shipping, adjustments and tier-price exclusions are unchanged.

Already queued or delivered events are not recalculated. The setting is read when an event is created, not snapshotted at purchase time: changing it can make a later Return use a different basis from its older Purchase. Coordinate a cutover and historical returns with Loyalty Engage, rather than switching during an active refund cycle. This setting selects a tax basis; it does not change the payload into the net refunded total after coupons or adjustments.

Exclude Quantity-Tier Discounts from Purchase Events

Go to Stores > Configuration > Loyalty Engage > Loyalty > Loyalty Export Settings > Exclude Applied Tier Prices from Purchase Export. The setting defaults to No and can be overridden per website or store view. Enable Purchase Export to display it.

When enabled, newly placed Magento-quote orders record whether a quantity tier above one actually lowered each order line's price. Only those lines are excluded from Purchase events. Products merely having tier prices, quantities below the threshold, quantity-one group prices, and a lower/equal special or catalog-rule price are not automatically excluded. Native configurable selection pricing and fixed/dynamic bundle pricing are supported. Explicit custom quote prices are not classified as native tier discounts.

Cart price rules, coupon codes and order-item discount_amount do not trigger this exclusion. A coupon-only discounted line stays eligible; a line with both an applied quantity tier and a coupon is excluded because of the tier, not the coupon.

For example, with regular price 15.97, tier 10 at 13.29 and tier 50 at 12.59: 9 units remain eligible, while 10 or 50 units are excluded if their tier determines the price. An active special price of 11.56 keeps the line eligible because it beats both tiers. All units on a tier-priced line are excluded, not only the units above the threshold.

The decision is stored in existing order-item product_options, without schema changes to sales tables or product lookups during Purchase/Return export. Returns use that same snapshot even after settings, quantities or catalog prices change. Mixed orders still export their eligible lines; an entirely excluded order produces no empty Purchase event. Physical-redemption completion and coupon-redemption events are unchanged.

This is an earning/export filter, not a checkout discount-stacking restriction: it does not block coupons or spending coins. Existing orders and already queued events are not retroactively changed. Direct imports that bypass Magento quote-to-order conversion have no snapshot and keep the existing export behavior. Test third-party price overrides separately; if pricing inspection fails, checkout continues, a warning is logged, and no exclusion is guessed. The setting-off path performs no additional pricing calculations.

Frontend

The module adds functionality to the customer's shopping cart, allowing them to:

API Endpoints

The REST endpoints require the store's configured Basic Auth credentials. Use the appropriate /rest/<store-code>/ prefix:

Customer sync fields

For a store-specific sync, call POST /rest/<store-code>/V1/loyalty/customer/update with that store's credentials. For example:

le_reserved_coins already works in 2.6.9. The optional le_contact_id is an opaque string; send it as a JSON string to preserve leading zeros and large numeric IDs. The contact ID is stored per customer and store view, separately from the loyalty balances. Missing, null or blank IDs do not erase a previously saved ID. Non-blank IDs must be at most 255 bytes without control characters. Successful writes list le_contact_id under updated_fields without returning its value. The ID is not treated as opt-in or included in CSV exports. It is only shown to the signed-in customer as part of their invitation link when that feature is configured.

Deploy the module and run bin/magento setup:upgrade before expecting Magento to persist the ID. Magento 2.6.9 module installations ignore this unknown top-level field rather than saving it. le_bought_discount_code is not supported by this update endpoint.

Invitation links

In Stores > Configuration > Loyalty Engage > Loyalty > Customer Invitations, choose the store view and set Invitation URL Template to the actual referral URL for the program. Put {contact_id} in the path or query, for example https://shop.example.com/invite/{contact_id} or https://shop.example.com/join?ref={contact_id}. These are examples, not Loyalty Engage endpoints. An empty value disables the feature. Only a signed-in customer with an ID synced to that store sees the copy button in My Account. The configured destination must support this identifier for attribution; Magento only constructs and copies the link. It does not track conversions, issue rewards or send emails.

Storefront scripts use session-authenticated POST routes /loyalty/cart/add and /loyalty/discount/claim. The /loyaltyshop/ aliases remain supported. Prefer a valid Magento form_key; same-origin Magento AJAX requests remain compatible.

Cron Jobs

The module includes the following cron jobs:

Magento's normal cron must run. Inspect failures with bin/magento loyalty:events. For upgrade steps, recovery commands, compatibility changes and test instructions, see Production Readiness.

Support

For support, please contact:

License

This module is licensed under the MIT License - see the LICENSE file for details.


All versions of loyaltyshop with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
magento/framework Version ^103.0 || ^104.0 || ^105.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package loyaltyengage/loyaltyshop contains the following files

Loading the files please wait ...