Installing Store Credit
This guide covers installing Store Credit with Composer, both with a license key and via the Hyvä Commerce GitLab repositories for agency and technology partners.
Pre-release Feature
Store Credit has not been tagged for release yet, so Composer needs a relaxed stability constraint to resolve it. Follow the beta upgrade notes for what your root composer.json needs, and install it in a development environment before anywhere else.
Installation
For prerequisites, see Hyvä Commerce Installation Page.
Installation via Hyvä Commerce Metapackage Recommended
The below steps are for installing Store Credit only. While this is supported to provide greater flexibility and control over installed features, in most cases, we recommend installing all Hyvä Commerce features using our metapackage.
-
Require the
hyva-themes/commerce-module-store-creditpackage: -
(Optional) Require the
hyva-themes/commerce-module-store-credit-graph-qlpackage for the GraphQL API: -
Run a setup upgrade:
-
Clear your browser cache.
Installing as an Agency or Technology Partner
If you have access to the Hyvä Commerce GitLab repositories as a Gold/Platinum Agency Partner or a Technology Partner, you can install Hyvä Commerce in development environments using SSH key authentication.
You can configure the Git repositories in your root composer.json and use them directly as Git repos beneath your vendor directory. This lets you check out tags and branches, make commits, and push contributions.
Development Environments Only
This installation method is not suited for deployments, because GitLab requires SSH key authorization and project changes can break production deployments.
-
Make sure your public SSH key is added to your account on
gitlab.hyva.io. -
Set minimum-stability to
devin the Magentocomposer.json: -
Add the Store Credit and base Hyvä Commerce module repositories to the Magento
composer.json: -
(Optional) Add the Store Credit GraphQL repository to the Magento
composer.json: -
Require the
hyva-themes/commerce-module-store-creditpackage using thedev-mainbranch: -
(Optional) Require the
hyva-themes/commerce-module-store-credit-graph-qlpackage using thedev-mainbranch: -
Run a setup upgrade:
-
Clear your browser cache.
Installing the module creates two database tables (hyva_store_credit_ledger and hyva_store_credit_balance), a hyva_store_credit_balance_view SQL view, and the store credit columns on the quote, order, invoice, and credit memo tables.
Additional Setup
Installation alone does not make store credit visible. Three things still need attention.
Enable Store Credit per Website
Store credit ships disabled: hyva_store_credit/general/enabled defaults to No. Until you switch it on, no balances are spendable, the My Account page redirects away, and the cart and checkout panels do not render.
Go to Stores → Settings → Configuration → Hyvä Commerce → Store Credit, set Enable Store Credit to Yes, and save. The setting is scoped per website, so switch it on for each website that should offer store credit. See Configuring Store Credit for the rest of the settings.
Keep Zero Subtotal Checkout Enabled
When a customer's store credit covers an order in full, the order total drops to zero and Store Credit hides every payment method except Zero Subtotal Checkout. If that method is disabled, a fully covered order cannot be placed at all.
Check that Stores → Settings → Configuration → Sales → Payment Methods → Zero Subtotal Checkout is enabled for the same websites. See Zero Subtotal Checkout for how Hyvä Checkout handles zero-total orders.
Theme Requirements
Store Credit is only supported on storefronts that run both Hyvä Theme and Hyvä Checkout. The storefront templates and Tailwind config are built for Hyvä Theme, and the checkout panel is a Hyvä Checkout price summary component. There is no Luma integration, so the module is not supported with Luma or any other theme or checkout.
Neither the Hyvä theme package nor Hyvä Checkout is declared as a Composer requirement of the module, which means Composer will not warn you if either is missing. Make sure both are installed before you enable store credit.
Related Topics
- Configuring Store Credit - every setting and its default, including the balance change emails.
- Store Credit User Guides - crediting a customer, refunding to store credit, and seeding balances from CSV.
- Developer Documentation - the ledger architecture and the extension points.