Jump to content
DataKick

[Free Module] Conseqs - execute action when something happens

Recommended Posts

Posted (edited)

CONSEQS

Actions have consequences. Automate your shop 

 

execute custom action when something happens

 

 

This free module will allow you to easily automate our shop. Its something like IFFT or Zapier that runs inside your PrestaShop. 

You can use it to execute action when something interesting happens.

 


 

TAKE A TEST DRIVE

You can try this module on my demo account

Front Office  /  Back Office

 


 

USE CASES

What you can use this for?

 

  • send email to my email address when new order is created
  • send email to administrator when product stock quantity dropped below 3
  • when user navigates to url that contains string '/invalid-keyword' then redirect to '/sorry-not-available' url
  • when employee logs in to back office, then log this information into access.txt file 
  • when user ends up on 404 page, then log the current url address to text file
  • send copy of all outgoing emails to your email address
  • create voucher for customers who submit a review
  • ..and much more

 


 

DOWNLOAD

You can download latest version of this free module here

version for prestashop 1.7

version for prestashop 1.6

 

 

Edited by DataKick
  • Like 1

Share this post


Link to post
Share on other sites

This looks interesting. Can I use this module to put customers to B2B group if valid VAT number is entered when customer sign up?

Share this post


Link to post
Share on other sites
1 hour ago, Lina008 said:

This looks interesting. Can I use this module to put customers to B2B group if valid VAT number is entered when customer sign up?

Yes, it's very easy. You can create new rule that will run when new Address is created AND its VAT number is not empty. If these condition are met, then run action Assign customer to group. Customer ID will be taken from Address: Customer ID, and enter constant value for Group.

Similarly, you can do this when address is updated. Just create another rule, and use trigger After record has been updated instead of After record has been created

I hope this helps. Here are some screenshots that might make it more clear:

Trigger definition:

01.png.d8be014b9ae2b60c6e5fbef9b8fbc159.png

Conditions

02.png.c1e639e846ece6450b5341fed93ce470.png

Action

03.png.71f7b29854091013b87ff4a9256950c4.png

Share this post


Link to post
Share on other sites

Worked like a charm, thank you. Really nice module 👍

Share this post


Link to post
Share on other sites
On 6/12/2019 at 3:20 PM, DataKick said:
  • send email to administrator when product stock quantity dropped below 3

Nice module. I don't understand how can do this, can you halp?

 

Share this post


Link to post
Share on other sites
21 hours ago, fourarrow said:

Nice module. I don't understand how can do this, can you help?

send email to administrator when product stock quantity dropped below 3

You need to select Stock quantity changed trigger. That will execute every time stock quantity is adjusted. Because you want to react only on situation when quantity is < 3 you will need to create appropriate condition. And last thing - action. Select Send email. You will need to choose email template. If none of existing email templates work for you, simply create new one (copy existing email template under new name and modify it). In action settings, you will have to provide values to all email {placeholders}. You can provide constants, or bind the value to data provided by trigger (like current quantity)

image.png.0499e8e449aee8010a7331f5cd3788c1.png

Share this post


Link to post
Share on other sites
13 hours ago, lukash4 said:

how I can grant loyalty points for submitting review?

It really depends on what review module and loyalty module are you using.

At the moment, conseqs support revws module out of the box, and also standard prestashop's loyalty module. If you have these two modules installed, you can simply bind them together:

  1. choose Revws: Review approved trigger
  2. in conditions, add Review: ID Customer > 0 to ignore reviews created by guests
  3. choose Award loyalty points action
    • bind Customer ID to Review: ID Customer - to give loyalty points to correct customer
    • set Awarded points to some constant value according your reward strategy

Save and you are done. If you use different review module, or different loyalty module, you can still do this. But you will have to use generic triggers (based on measure) and actions (execute sql script). Or, even better, send me copy of these modules and I'll add support for them.

PS: you can also download this file and import it to you conseqs module. It contains this rule prepared for you: award_loyalty_points_when_revws__review_approved.json

image.png.b579b4abcb1b0f69ac509b42c82f643a.png

 

Share this post


Link to post
Share on other sites
6 hours ago, DataKick said:

It really depends on what review module and loyalty module are you using.

At the moment, conseqs support revws module out of the box, and also standard prestashop's loyalty module. If you have these two modules installed, you can simply bind them together:

  1. choose Revws: Review approved trigger
  2. in conditions, add Review: ID Customer > 0 to ignore reviews created by guests
  3. choose Award loyalty points action
    • bind Customer ID to Review: ID Customer - to give loyalty points to correct customer
    • set Awarded points to some constant value according your reward strategy

Save and you are done. If you use different review module, or different loyalty module, you can still do this. But you will have to use generic triggers (based on measure) and actions (execute sql script). Or, even better, send me copy of these modules and I'll add support for them.

PS: you can also download this file and import it to you conseqs module. It contains this rule prepared for you: award_loyalty_points_when_revws__review_approved.json

 

 

Thanks, but I have error:

Failed to import file award_loyalty_points_when_revws__review_approved.json: Action awardLoyaltyPoints does not exists

 

Share this post


Link to post
Share on other sites
11 minutes ago, lukash4 said:

Thanks, but I have error:


Failed to import file award_loyalty_points_when_revws__review_approved.json: Action awardLoyaltyPoints does not exists

 

You either don't have latest version of conseqs module (0.3.1), or you don't have loyalty module installed, or enabled.

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, DataKick said:

You either don't have latest version of conseqs module (0.3.1), or you don't have loyalty module installed, or enabled.

 👍 you're right, I've had loyalty points off on the development version 😀

Share this post


Link to post
Share on other sites

After completing cron tasks I have an error - points are accrued on the client's account. What could be the cause of the error? loyalty.png.d17b3bfa0f0ffaaeb37c3e74a1098d2f.png

Share this post


Link to post
Share on other sites
12 minutes ago, lukash4 said:

After completing cron tasks I have an error - points are accrued on the client's account. What could be the cause of the error? 

Hmm, this is a bug in loyalty module. I have tested the integration against a slightly different version of this module (thirtybees fork), in which this bug is fixed.

Good news is that this is not an actual error. The problem is that LoyaltyModule::save method should return boolean value (true or false), to indicate result of save operation. PrestaShop's version doesn't do that -- method doesn't return anything, and my code interprets this as a failure. But in fact, save operation was successful.

The correct way to fix this is to fix loyalty module. But that will not happen, because prestashop doesn't accept pull requests for this module anymore. So, I'll update my own code, and remove this check. This will be in the next version.

Meanwhile, you can do this: Modify file /modules/loyalty/LoyaltyModule.php (line 57-60) and change

	public function save($nullValues = false, $autodate = true)
	{
		parent::save($nullValues, $autodate);
		$this->historize();
	}

to

	public function save($nullValues = false, $autodate = true)
	{
		parent::save($nullValues, $autodate);
		$this->historize();
		return true;
	}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More