Skip to main content

User points

More
2 weeks 6 days ago #100000216 by dailybread
User points was created by dailybread
-- HikaShop version -- : 6.6.0
-- Joomla version -- : 3.10
-- Browser(s) name and version -- : Chrome 154.0

In our shop we have a rewards card that for £40 min spend you get one stamp on your rewards card.
Each needs to be a separate transaction.

After the card is stamped 6 times the next purchase you can get 10% off that purchase.

We keep the card and the process starts again.

I want to do the same online put I find the form(s) confusing on what to put in the various fields.
The spend would exclude shipping costs.

Thanks for any help.

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #100000217 by nicolas
Replied by nicolas on topic User points
Hi,

This can be done with HikaShop's mass actions: each confirmed order of £40 or more (shipping excluded) adds a stamp to the customer, and when the customer reaches 6 stamps HikaShop creates a 10% coupon for them alone, emails it to them and takes the 6 stamps off their card. The order where the coupon is used does not earn a stamp, as in your shop.

It needs HikaShop 6.7.0 or newer: the "Create a coupon" and "Run MySQL query" actions used below do not exist in 6.6.0.

The mass actions with a MySQL query can only be saved by a Super User.

1. The stamp counter: in Components > HikaShop > Display > Custom fields, click New and create a field with Table: user, Label: Stamps, Column name: stamps, Type: Text, Default value: 0, displayed in the backend only (not on the frontend). You will see and can correct the stamps of each customer when editing them in Customers.

2. The coupon to copy: in Components > HikaShop > Orders > Discounts, create a coupon with the code REWARD10, type Coupon, 10 in the percentage field, and Published set to No. It is only a model: each customer gets their own copy of it with their own code, so nobody can use REWARD10 itself. Any other restriction you set on it (minimum order, products) is copied too.

3. The first mass action, which must be created before the second one: in System > Mass actions, click New, choose the table Order, name it "Rewards card: stamp", and set:

- Trigger: After an order is confirmed (i.e. paid)

- no filter

- Action: Run MySQL query, with the query of the attached file stamp-query.txt pasted as it is.

The query adds one stamp when the order, VAT included, is £40 or more once shipping and payment fees are taken off, and not when the order used a reward coupon. Change the 40 in it if your minimum changes.

4. The second mass action: New again, table Order, name "Rewards card: reward":

- Trigger: After an order is confirmed (i.e. paid)

- Filter: User columns, stamps, >=, 6

- Action 1: Create a coupon, with "Copy the settings of the coupon": REWARD10, Code: REWARD-{random:8}, Valid for (days): 365 (or what you prefer), and "Only for the customer of the element, for one use" checked.

- Action 2: Send an email, with Email to send: Custom, To: element.email, a subject such as "Your 10% reward", and as Message the content of the attached file reward-email.txt (adapt the text as you like, keeping {coupon.discount_code} where the code should appear).

- Action 3: Run MySQL query, with the query of the attached file reward-query.txt, which takes the 6 stamps off the card.

Publish both mass actions. The codes start with REWARD- because the first query recognises the reward orders by that start: keep it if you change the code pattern.

Two things to know: an order is counted when it gets the confirmed or shipped status, so an order paid by bank transfer is counted when you confirm it; and if you cancel or refund an order that already gave a stamp, the stamp is not taken back by itself: edit the customer in Customers and lower the Stamps field by one.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum