PHPackages                             rpd/rapid-magento-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rpd/rapid-magento-extension

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rpd/rapid-magento-extension
===========================

RapidCampaign Magento extension

v1.1(10y ago)112PHP

Since Oct 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rapidCampaign/rapid-magento-extension)[ Packagist](https://packagist.org/packages/rpd/rapid-magento-extension)[ RSS](/packages/rpd-rapid-magento-extension/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)DependenciesVersions (3)Used By (0)

RapidCampaign Magento Extension Technical Documentation
=======================================================

[](#rapidcampaign-magento-extension-technical-documentation)

The aim of this Magento extension is to integration with RapidCampaign to show promotions to customers.

Requirements
------------

[](#requirements)

The user stories that this extension should achieve and maintain are as follows.

### Configuration

[](#configuration)

- As an administrator I must be able to configure the extension with my API key from the Magento admin area.
- As an administrator I must be able to globally enable or disable the display of the promotional blocks from the Magento admin area.
- As an administrator I must be able to enable or disable the encryption of the iframe URL parameters from the Magento admin area
- As an administrator I must be able to configure the level of analytics to send to RapidCampaign from the Magento admin area
- As an administrator I must be able to define the cookie lifetime length from the Magento admin area
- As an administrator I must be able to enable or disable test mode for the extension from the Magento admin area
- As an administrator I must be able to enable or disable extension specific logs from the Magento admin area

### Widget

[](#widget)

- As an administrator I must be able to create a RapidCampaign widget
- As an administrator I must be able to specify to which RapidCampaign promotion this widget applies when creating the widget
- As an administrator I must be able to specify targeting conditions for the widget using the Magento sales rule interface when creating the widget
- As an administrator I must be able to specify addition targeting conditions for the widget by selecting customer groups that are available
- As a customer I should not be able to see a widget if the widget's sales rules are not matched
- As a customer I should not be able to see a widget if the extension is globally disabled
- As an administrator when I edit a widget I should see the sales rules interface populated with what was previously selected

### Automatic Coupon Application

[](#automatic-coupon-application)

- As a customer with items in my basket, when I click a coupon code link in the RapidCampaign promotion then coupon code should be applied to my cart
- As a customer with no items in my basket and I have clicked a coupon code link, when I go to the basket, I should still receive the discount.

Development Setup
-----------------

[](#development-setup)

This extension provides a modman file for further development. [Modman](https://github.com/colinmollenhour/modman) is an easy way to install magento extensions via symlink.

```
modman init
modman clone git@bitbucket.org:nearme/rapid-magento-extension.git

```

Components
----------

[](#components)

### API Requests

[](#api-requests)

Api requests are handled by `Model/Api/` with two classes. The first is a utility class for sending requests, the other is for the promotions endpoint, this is where much of the work is performed. The request is attempted a maximum of 3 times if it fails.

There is a `Model/Storage.php` class which handles fetched promotions from the API and storing them for later use in a database table.

There is a cron task defined in `config.xml` to re-fetch the promotions daily. Similarly, there is a custom button that has been added to the system configuration area which triggers a promotion cache expiry through the `controllers/Adminhtml/PromotionController.php`.

### Widget

[](#widget-1)

The crux of the functionality comes from the widget that has been defined in `etc/widget.xml` and functionality created in `Block/Widget/Promotion.php` which allows a store owner to choose a promotion and targeting rules.

The targeting rules re-uses components from sales conditions and then stores it on the widget by base\_64 encoding. There is an observer that is used to support the condition combining and serializing on the post.

To select a promotion a separate window is needed and provided by `controllers/Adminhtml/ChooserController.php` and `Block/Widget/Grid/Chooser.php`.

Ultimately, this outputs the RapidCampaign div element and script embed tag for rendering the promotion. There is some customer information included as parameters that are optionally encrypted using `Helper/Encrypter.php`.

### Coupons

[](#coupons)

There is a new controller `controllers/CouponsConroller.php` which allows RapidCampaign to redirect customers with coupon code information (`$STORE_BASE_URL + '/rapidcampaign/coupons/apply/coupon/$COUPON_CODE'`)

If there are items in the basket then the coupon code is immediately applied and the sucess message is shown to the customer. It's important that the same success/error message is used to maintain compatibility with the store's translations.

If there aren't items in the basket, we still send a message to a customer but we also add the coupon code to a `coupon_code` cookie.

There is then an observer that listens to when a product is added to the basket and fetches the coupon from the cookie and automatically applies it to the basket.

### Analytics

[](#analytics)

There are three new Blocks that have been created, one for each piece of JS; one for all pages, one for just the basket and one for the order success page. There are no templates for this functionality at this time as the HTML is output in the block.

There is some logic around whether checkout success analytics is used for all customers or just those that interacted with a RapidCampaign Promotion. This is managed through a cookie that is set when a coupon is applied.

### Enterprise

[](#enterprise)

Compatibility with Magento Enterprise edition and Full Page Cache is provided through hole punching. This is needed for the promotion itself as well as the analytics.

Functionality that provides this can be found in `Model/FPC` folder and `etc/cache.xml`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 70.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~65 days

Total

2

Last Release

3851d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d1af5d71fc8cec130782b1b485109f21468fe4ce86f47e05528d66021b2271e?d=identicon)[tero](/maintainers/tero)

---

Top Contributors

[![bobbyshaw](https://avatars.githubusercontent.com/u/553566?v=4)](https://github.com/bobbyshaw "bobbyshaw (74 commits)")[![tomrobertshaw](https://avatars.githubusercontent.com/u/279512?v=4)](https://github.com/tomrobertshaw "tomrobertshaw (24 commits)")[![tero](https://avatars.githubusercontent.com/u/181596?v=4)](https://github.com/tero "tero (7 commits)")

### Embed Badge

![Health badge](/badges/rpd-rapid-magento-extension/health.svg)

```
[![Health](https://phpackages.com/badges/rpd-rapid-magento-extension/health.svg)](https://phpackages.com/packages/rpd-rapid-magento-extension)
```

###  Alternatives

[rareloop/wp-router

Router

171.8k](/packages/rareloop-wp-router)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
