Download the PHP package thelia/creditaccount-module without Composer

On this page you can find all versions of the php package thelia/creditaccount-module. 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 creditaccount-module

English Instructions

Credit account

This module is a base for creating module like sponsorship or assets management.

Installation

You could also download the zip from github.

After that, you just have to activate the module in your back-office.

How to use it

In your back-office, on each customer edition page you can add a new credit account.

Integration

In back-office, the module places itself in the account.bottom hook, which is in the customer details page.

Two loops are available with this module. One for the credit account history and the other one for the current credit account.

A route exists allowing customer to consume his credit account, within the limits of order total, excluded shipping. You just have to call the and the controller will find the credit account of the current customer and put the available amount in the discount amount.

To cancel the use of credit account, use the route.

Invoking these routes will redirect the customer to the route.

The module creates a hook, order-invoice.before-discount, where the code which allows your customer to use their credit is inserted. You have to put the hook in the order-invoice.html template file, just before the "Discount" block for example.

Code to insert in the order-invoice.html file in your template:

Expiration

Since version 1.3.0 of this module you can enable expiration of credit.
Just go in the CreditAccount configuration end enable it (it's disabled by default) then you can choose the expiration delay (in months).
The date of expiration is computed with the last date of creditation + your expiration delay.
Expiration is checked each time the customer add an item in cart but if you want you can set this a command as cron to force expiration check php Thelia creditaccount:expiration:check.

Hooks

The module uses the front office account.bottom hook to display account history in the customer "My Account" page.

It also uses the `following back-office hooks

It creates a order-invoice.before-discount which has to be inserted in the order-invoice.html template file.

Loops

credit_account_history loop

List the credit account history for a specified credit account.

Input arguments

Output variables

Example

credit_account loop

retrieve the current credit account for a specified customer

Input argument

Output variables

Example usage

credit_account_usage loop

Returns the credit amount used on the current order for the current customer, or nothing if no credit amount is currently in use.

Input argument

None.

Output variables

Example usage

Listeners

This module is a base for creating module like sponsorship or assets management. So some listeners are preconfigured for using it in other modules.

creditAccount.addAccount

This listener is used for adding an amount to a customer's credit account. You have to dispatch a class

Example


Instructions en Français

Crédit client

Ce module permet d'ajouter un crédit à chacun de vos clients. Il est aussi nécessaire pour des modules du type Fidélisation ou Gestion des avoirs.

Installation

Vous pouvez aussi téléchargez le zip depuis Github.

Ensuite vous n'avez plus qu'à activer le module dans votre back-office.

Utilisation

Dans votre back-office, vous pouvez ajouter pour chaque client un crédit fidélité. Pour cela, rendez-vous sur la page d'édition du compte client.

Intégration

Trois boucles sont disponibles pour ce module: une pour l'historique du compte crédit, une pour obtenir le solde du compte, et une pour connaitre l'utilisation du compte sur la commande en cours.

Pour permettre au client d'utiliser son crédit, il suffit d'appeler la route . Le contrôleur trouvera lui-même le crédit du client en question, et l'ajoutera dans le montant de la réduction. Pour annuler l'utilisation du crédit, utiliser la route

Ce module crée un nouveau point d'accroche, order-invoice.before-discount, où le code qui permet à vos clients d'utiliser leur crédit fidélité sera inséré. Placez le code de ce point d'accorche dans le fichier order-invoice.html de votre template, juste avant le bloc Remise par exemple.

Code to insert in the order-invoice.html file in your template:

Code du point d'accorche à insérer dans le fichier order-invoice.html de votre template:

Boucles

Boucle credit_account_history

Liste l'historique des operations sur un compte donné

Paramètres

Résultats

Exemple d'utilisation

Credit account loop

Récupère le crédit en cours pour un client donné

Paramètres

Résultats

Exemple d'utilisation

Boucle credit_account_usage

Cette boucle retourne le crédit utilisé sur la commande courant par le client courant, ou rien si le compte n'est pas utilisé sur la commande.

Paramètres

Aucun.

Résultats

Exemple d'utilisation

Listeners

Ce module est une base pour créer des modules comme Fidélisation, ou Gestion des avoirs. Des "listeners" sont préconfigurés pour être utilisés dans d'autres modules.

creditAccount.addAccount

Ce listener est utilisé pour ajouter un montant dans un compte crédit. Vous devez diffuser un évènement instance de

Exemple d'utilisation


All versions of creditaccount-module with dependencies

PHP Build Version
Package Version
Requires thelia/installer Version ~1.1
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 thelia/creditaccount-module contains the following files

Loading the files please wait ....