Contributors: almapayments, olance
Tags: payments, payment gateway, woocommerce, ecommerce, e-commerce, sell, woo commerce, alma, monthly payments, split payments
Requires at least: 4.4
Tested up to: 5.8.2
Requires PHP: 5.6
Stable tag: 2.5.1
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
This plugin adds a new payment method to WooCommerce, which allows you to offer monthly payments to your customer using Alma.
🇫🇷 Pour le moment, Alma n'est disponible qu'aux marchands français avec lesquels nous pouvons interagir. Vous pouvez créer votre compte librement, mais devez nous contacter pour l'activer et commencer à accepter des paiements.
🇬🇧 For the moment, Alma is only available to french merchants with whom we can communicate. You can create your account freely, but you must contact us to have it activated and to start accepting payments.
Alma is a service to provide merchants with an easy and safe monthly payments solution.
Let your customers pay for their purchases at their own pace! You'll receive the funds instantly, and your customer will pay later over a few monthly instalments.
This plugin integrates Alma into WooCommerce by adding a new payment method that you can activate to offer monthly payments to your customers.
You first need to create your merchant account on dashboard.getalma.eu and activate your account.
After installing the plugin, go to WooCommerce settings and activate the new Alma payment method. You should be redirected to the payment method settings upon activation.
Fill in the API keys for your account, which you can find on your dashboard's security page.
After you save your API keys, you'll have access to different settings to control what the plugin should display on the Cart and Checkout pages. We advise you to stay in "Test" mode until you're happy with your configuration and are ready to accept payments from your customers.
Once everything is properly set up, go ahead and switch to "Live" mode!
If you'd like to have more control on the position of the Alma badge on your store, you can deactivate the option in your payment method settings and use shortcodes directly into your themes templates, with a WooCommerce hook or into the wp_post.short_description
for example.
It is also possible to use the shortcodes directly into your Posts, Pages or any other WordPress native displayed content.
There are two shortcodes available:
[alma-product-eligibility]
will display the Alma badge for a product's eligibility[alma-cart-eligibility]
will display the Alma badge for the cart eligibility
For the Cart Eligibility
For the Product Eligibility
- In a Product page, you should just add the shortcode without parameters (product will be found in the WordPress context) :
[alma-product-eligibility]
- In a Page, Post or any other WordPress native displayed content, you have to add the id (product_id) parameter into the shortcode :
[alma-product-eligibility id=10]
- It is also possible to inject the badge using hooks. Here for example, into the Product summary with a WooCommerce hook (add the following code into your Theme's
functions.php
):
<?php
// ...
add_action( 'woocommerce_before_single_product_summary', 'inject_alma_product_eligibility_into_product' );
function inject_alma_product_eligibility_into_product() {
echo do_shortcode( '[alma-product-eligibility]' );
}
// ...
- In a Page, Post or any other WordPress native displayed content, you just have to use the
[alma-cart-eligibility]
shortcode. - It is also possible to inject the badge using hooks - here for example, into the Cart page with a WooCommerce hook (add the following code into your Theme's
functions.php
):
// ...
add_action( 'woocommerce_after_cart_table', 'inject_alma_cart_eligibility_into_cart' );
function inject_alma_cart_eligibility_into_cart() {
echo do_shortcode( '[alma-cart-eligibility]' );
}
// ...
-
HTML class attribute
You can customize rendering of the widget by adding your own HTML class attribute, using the shortcode
class
attribute. e.g:[alma-cart-eligibility class=my-website-amazing-content-style-class]
-
Content
You can add a content between opening & closing shortcode tags. This content will be displayed into a
div.alma_wc_content
HTML element before the injected Widget. e.g:[alma-product-eligibility id=10]My Amazing Content about My Wonderfull Product[/alma-product-eligibility ]
You can also add another shortcode into Widget shortcode (here the WooCommerce
product
shortcode):[alma-product-eligibility id=10][product id=10][/alma-product-eligibility ]
-
Debug
Each shortcode can be debugged with a
debug=on
attribute. This will display a visual container with a message that will explain why the badge is not displayed. Use this option if you don't see the widget on a page you added the shortcode in. e.g:[alma-product-eligibility id=10 debug=on]
Only one Alma badge can be displayed in a webpage.
If the badge is injected twice or more in a Post, Page, Product, Cart or anywhere: the second and following will not be displayed.
You need to have docker
and docker-compose
installed on your computer.
- Clone the repository
- Run
docker-compose up
to start WordPress - Run
docker-compose exec wordpress bash
to open a shell in the docker container - Run
cd wp-content/plugins/alma-woocommerce-gateway
to go into the plugin directory - Run
composer install
to install dependencies - Go to http://localhost:8000 and follow WordPress installation steps
- Go to http://localhost:8000/wp-admin/plugin-install.php and install & enable WooCommerce
- Create a product with a price
- Go to http://localhost:8000/wp-admin/plugins.php and enable alma
- Create an account on http://dashboard.sandbox.getalma.eu/ to get an API key
- Go to http://localhost:8000/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=alma and fill your API key
- Visit the shop and add a product to the cart to see Alma in action 🚀
To configure or disable xdebug, edit the docker/customphp-config.ini
file and restart the docker container.
To edit the translations, use Poedit
- Open the
.pot
file and click onUpdate from code
, then save - Open the
.po
file and click onUpdate from code
, add/update the translations, then save
To build extension for production run ./bin/build.sh