Get WordPress Product Price
{
"intent": "woocommerce.query.product.price",
"utterances": [
"%productname% price",
"how much is %productname%",
"how much is the %productname%",
"how much does %productname% cost",
"what is the price of %productname%",
"what is the price of the %productname%",
"price of %productname%",
"price for %productname%",
"cost of %productname%",
"how much for %productname%",
"tell me the price of %productname%",
"give me the price of %productname%",
"i want to buy %productname%",
"what does %productname% cost"
],
"slots": [
"productname"
],
"answer": [
{
"index": 0,
"action": "api",
"instruction": {
"url": "https://YOUR-STORE.com/wp-json/wc/v3/products",
"options": {
"method": "get",
"headers": "",
"configurations": "",
"body": {
"per_page": "1",
"consumer_key": "ck_YOUR_CONSUMER_KEY",
"consumer_secret": "cs_YOUR_CONSUMER_SECRET",
"search": "%productname%"
}
}
},
"variables": {
"productname": "EXAMPLE PRODUCT"
},
"selections": [
{
"path": "[0].id",
"value": 1001
},
{
"path": "[0].name",
"value": "EXAMPLE PRODUCT"
},
{
"path": "[0].price",
"value": "29.99"
},
{
"path": "[0].price_html",
"value": "<span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">$</span>29.99</bdi></span>"
},
{
"path": "[0].permalink",
"value": "https://YOUR-STORE.com/product/example-product/"
},
{
"path": "[0].images[0].src",
"value": "https://YOUR-STORE.com/wp-content/uploads/example-product.jpg"
}
]
},
{
"index": 1,
"action": "text",
"instruction": "<div style=\"max-width:400px;margin:0 auto;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;\"><div style=\"width:100%;max-height:250px;overflow:hidden;\"><img style=\"width:100%;height:100%;max-height:250px;object-fit:cover;\" src=\"[0.images[0].src]\" alt=\"[0.name]\"></div><div style=\"padding:5px;\"><h3 style=\"margin:0 0 8px 0;font-size:14px;font-weight:600;\">[0.name]</h3><div style=\"font-size:24px;font-weight:bold;margin-bottom:16px;\">[0.price_html]</div><a style=\"display:inline-block;background-color:#000;color:#fff;text-decoration:none;padding:12px 24px;border-radius:6px;font-weight:500;text-align:center;width:100%;box-sizing:border-box;\" href=\"[0.permalink]\" target=\"_blank\" rel=\"noopener\">View Product</a></div></div>"
},
{
"index": 2,
"action": "button",
"raw": [
{
"text": "View product",
"link": "[0.permalink]",
"class": [
"btn",
"btn-block",
"btn-primary"
]
},
{
"text": "Ask about another product",
"link": "",
"class": [
"btn",
"btn-block",
"btn-outline-primary"
]
}
],
"instruction": "<span class=\"button-group\"><button data-url=\"[0.permalink]\" data-text=\"View product\" class=\"btn btn-block btn-primary\">View product</button><button data-text=\"Ask about another product\" class=\"btn btn-block btn-outline-primary\">Ask about another product</button></span>"
}
]
}
Description
A training data to retrieve a product price from your wordpress store and return it in chat. Placeholders to swap after download/import YOUR-STORE.com; ck_YOUR_CONSUMER_KEY; cs_YOUR_CONSUMER_SECRET;