Activechat Essentials

E-commerce Chatbots

Advanced Chatbot Tools

Tracking code installation

Tracking page visits

Natural Language Chatbots

Intents and Entities

NLP contexts

Building Dialogflow agent and connecting to Activechat

Sending user input to NLP engine

Triggering bot skills by intents and events

Working with entities

Slot filling

Using contexts

NLP best practices 

ACTIVECHAT
E-commerce Chatbots

Multiple-page product galleries

Facebook Messenger has a limit of 10 cards in a single gallery. What happens if you have more than 10 products in a category? Obviously, you need some kind of pagination to display the whole list.

First of all, Let’s do some changes to the flow so we could implement this. We’ll be using $_shopify_total_pages system variable for this ($_woo_total_pages if you’re using WooCommerce) – each time dynamic gallery is rendered, this variable is updated to show actual number of pages (10 products per page) that gallery can display.

Here’s the logic behind the bot:

  1. Display list of categories with “Show products” button in each card.
  2. Before displaying product galleries, set $current_page to 1
  3. Display product gallery starting from page $current_page
  4. Check if $_shopify_total_pages is greater than 1
  5. if it is – check $current_page value
  6.  $current_page is 1, display only “Next 10” quick reply.
  7.  $current_page is greater than 1 and less than $_shopify_total_pages, display both “Prev 10” and “Next 10” quick replies for navigation.
  8. If $current_page is equal to $_shopify_total_pages, display only “Prev 10” quick reply.

When user clicks “Next 10” or “Prev 10” button (quick reply), the bot is adding (or subtracting) 1 to $current_page and goes back to dynamic products gallery.

The bot is only 18 blocks, and provides complete e-commerce shop navigation.

Here is how it looks in the Messenger: