What is the Tutorial About?
Creating dynamic sale notifications for WooCommerce using the JetEngine advanced SQL query and AI is the focus of this tutorial. This is a feature available with JetEngine 3.2 and above, and it allows you to build an analogue of dynamic sale notifications for WooCommerce. These aren’t real-time notifications, but rather short notices of the most recent website sale, including the product and the date or time of sale.
Tutorial Steps
- Ensure you have the necessary plugins:
Before starting, make sure you have the required plugins installed and activated. Also, ensure that you have several completed orders on your website. - Create the SQL query:
Go to your website dashboard, navigate to JetEngine > Query Builder, and create a new SQL/AI query. Name it something like “Dynamic Sale Notification”. Enable Advanced/AI mode and use the magic stick icon to generate the SQL query using AI. The prompt should be “WooCommerce select all product IDs from latest order add to the response product ID and Order date limit 1”. - Build the listing:
Go to JetEngine > Listings and create a new listing item. Choose the Query Builder source and pick the query you just created. Add a section and some heading that says “someone just purchased”. All the data will be pulled dynamically, so add the dynamic field widget to display the product title and purchase date. - Style the listing:
Style the listing as per your preference and hit update. - Create a pop-up:
Go back to the dashboard, navigate to Jet Pop-up, and create a new one. Delete the default widgets if there are any and add a listing grid widget. Select the listing you previously created and set columns and post number to one. Style the pop-up itself and set conditions for it. - Set display conditions:
Set the conditions for when and where the pop-up should be visible. You can set it to be shown on specific pages or the entire site.
Use Cases for this Tutorial
- E-commerce websites:
Displaying recent sales can create a sense of urgency and encourage visitors to make a purchase. - Bookstores:
Showcasing recently sold books can pique the interest of book lovers visiting your site. - Fashion retailers:
Highlighting recently purchased items can help promote trending fashion items.