需求背景

相信做独立站的人都有遇到过这个问题:我们拥有编辑好的FAQ页面,对于一些常见的问题都有了解答,但是顾客往往不会去那个页面看。不同的顾客对售前,售中,售后的问题是反反复复的问,如果回答的不及时,可能会面临顾客流失的风险。现有的shopifyChat已经十分好用了,如果能在shopifyChat和FAQ结合到一起,是不是能够事半功倍呢!除此之外,用户会觉得这个网站做的更加专业,安全性可靠性在无形之中得到了提升。

Tips: shopifyChat 在应用商店的名字为 Shopify Inbox

1. 抛出问题

如何对现有的shopifyChat进行改造

shopifyChat是用ifream的方式进行加载的,点击ifream里面的chat with us按钮之后,然后才开始下一步的操作来进一步的展示我们的聊天界面。如果我们能够fake一个chat with us,然后展示用户关心的faq,如果以上的faq都不能解答用户的问题,那最终我们再显示shopifyChat。整个问询体验会好很多。是不是很棒呢!

2. 如何设置

需要知道两件事

Q: 如何fake一个chat with us按钮
A: 从视觉上和它完全保持一致
Q: 如何触发shopifyChat的加载和控制其显示
A: 使用ifream.contentWindow.documemt, 这个dom就是ifream里面的dom, 对其进行操作就好了

那如何去配置FAQ呢?

目前还没有去管配置这一块,但是它的确是可以配置的,每一项都可以。
包括,外观样式 + 内容自定义等

如有需要可以联系我

代码部分如何实现

  1. theme.liquid的head标签中引入 jquery, 需要先找到指定版本的jq下载到本地, 然后上传到Asset目录

http://code.jquery.com/jquery-2.1.1.min.js

  1. <script src="{{ 'jquery-2.1.1.min.js' | asset_url }}"></script>
  1. 在Section目录中新建livechat_faq.liquid, 核心部分,构造我们需要的页面及内容 ```html

    Online help
    • My Orders
      1.How do I place an order?
      To place your order:
      1. Add the desired item and quantity to your cart
      2. Click the shopping cart icon.
      3. Review your order and click ‘Checkout’ button.
      4. Sign in or Register.
      5. Confirm your shipping details and payment method, click ‘Place Order’ button.
      2. I ordered a standard-size dress, not a custom-made one. Why is it taking so long?
      All of our dresses are made-to-order, whether you ordered a standard or custom size, both require tailoring time. Tailoring Time is displayed on each dress’s product page. If you add this time to the shipping time, you’ll have an idea of when to expect your item.
      3. How can I track my order status?
      We will send you an email once your order has been shipped. Please Sign into ‘My Account’ and click ‘My Orders’ in the upper right corner.
      Click on ‘View Details’ to check your order status. You can choose to email us to get information on your order.
      4. When will I receive my order?
      You can calculate a delivery estimate by taking the processing time and adding the shipping time. Currently it takes 10-16 days to make Formal dresses. You can check the tailoring period on the product page. The shipping time depends on the shipping method. The fastest shipping - expedited shipping, takes 2-4 days. Standard shipping takes 3-6 days, and Super saver shipping (only for items under $50) takes 15-30 days.
    • Product
      1. What is the best way to choose my size?
      Our size chart is independent. To choose the best size for you, please check the size chart on the product page, and refer to the measurements below each size. You can also refer to our measuring guide to see how to measure yourself.To ensure the dress fits you well, we also suggest you choose custom size, which means that we make the dress based on your exact measurements.
      2. Will my item be exactly the same color as what is shown on your website?
      Our color charts online have been adjusted to display color as close as possible to the color of the actual fabrics. However, camera resolution and computer monitors can mean the color may vary slightly between the photos and the actual fabric. Colors are subject to the actual dresses you get.
      3. How can I make sure all of my dresses are the same color?
      To ensure that your dresses will be made from the same roll of fabric, please inform us of your requirement about color via email or leave us a message in the Special Instructions column at the bottom of the check-out page when placing the order.
      4. Can I change the design of a dress?
      Due to agreements with the dress designers, we make the dresses strictly according to the pictures shown on our website. However, for certain dresses, we can add spaghetti straps or remove the train.
      For adding spaghetti straps or removing a dress train, please confirm with our professional representatives first before you place your order. You can choose to email us.
    • Payment
      1. What methods of payment do you accept?
      Please click this link .
      2. Is my payment secure?
      Definitely yes! We use the highest industry standards to secure our website and the payment process. xxxxx.com is fully PCI compliant and certified to process payments. Every bit of the information you provide to us is processed encrypted through the Secure Socket Layer (SSL).
      3. How can I change payment methods?
      If you have an unpaid order and want to use a different payment method, it’s easy:
      1. Sign into ‘My Account’ and click ‘My Orders’ in the upper right corner.
      2. Click on the unpaid order you want to complete payment on.
      3. Click ‘Edit Order’ and select your desired payment method, and then proceed to pay.
    • Delivery
      1. Where do you ship to?
      We ship worldwide. There may be particular locations that we might require additional information to ship to. If so, we will get in touch with you ASAP.
      2. What shipping methods do you offer?
      We have three shipping methods including expedited shipping, standard shipping and super saver shipping. Super saver shipping is only for items priced less than US$50. Currently, we cooperate with DHL, UPS, TOLL and Post Office to ship our orders.
      3. Can I change my shipping address?
      You can only change the shipping address while your order is still in production. Please email us. Or you can send your correct shipping address to service@xxxx.com. Our representatives will correct your shipping address and send you a confirmation email as soon as possible.
      Once your order has been shipped, we cannot change the delivery address nor delivery options.
      4. How much does shipping cost?
      The shipping fee will depend on the weight of the order. It is possible to check the estimated shipping cost at the Checkout page.
    • Returns
      1. What is your return policy?
      Customers need to contact OUR BRAND Customer Service to initiate the return process within 7 days upon receiving your items. If your product arrives in a defective manner, mis-shipped or has a color error, you are qualified to get a full refund. If there are any other issues with the item, you can still Contact Us and we will do our best to help you. To receive a full refund, if eligible, the item must be returned in its original condition within 7 days of its arrival to you. The item must be unworn, unwashed, unaltered, and undamaged with the original tags attached. We cannot process the return of any faulty item.
      2. What is your return/exchange process?
      1. Submit a return request at Contact Us to Customer Service within 7 days upon receiving your order.Please include an explanation and photographs stating the reason for your return.We reserve the right not to accept the returns without prior approval from our Customer Service.
      2. Once our Customer Service has approved your request, we will provide you with a return address as well as a Product Return Form that must be filled in and included with your return. Please send the item(s) through your local post office within 3-5 business days upon receiving the return form. Please DO NOT use expedited courier like UPS, DHL or FedEx; the normal economic Post Office service would be just fine. Please keep the tracking number safe.
      3. All the return item(s) will go through inspections. We will process the refund when we confirm that the product has the problems you mentioned.Once the refund has been processed by us, it usually takes 10-15 business days for the funds to be credited to your account, depending on your bank or payment service. Your bank or payment service may levy a small transaction charge.
      All PayPal payment can only be refunded via PayPal, all Credit Card payment will only be refunded to the original Credit Card.
      Please Note: we reserve the right not to process the refund if they are returned in unacceptable condition.
      3. Can I return a standard-size dress?
      Customers need to contact OUR BRAND Customer Service to initiate the return process within 7 days upon receiving your items. If your product arrives in a defective manner, mis-shipped or has a color error, you are qualified to get a full refund. If there are any other issues with the item, you can still Contact Us and we will do our best to help you. To receive a full refund, if eligible, the item must be returned in its original condition within 7 days of its arrival to you. The item must be unworn, unwashed, unaltered, and undamaged with the original tags attached. We cannot process the return of any faulty item.
    • My Account
      1. How I can change my email address?
      Please send your request and correct email address to service@xxxxx.com, or you can choose to email us. Our representatives will reply within 24 hours.
      2. What should I do if I forget my password?
      1. Forget password
      Please click this link to reset your password.
      If it doesn’t work, please Contact Us, with your permission, we will help reset the password for you.
      2. Change password
      If you would like to change your password, please refer to the below steps:
      1) Simply click ‘Sign in’ on our website and then click ‘My Account’ at the top of the website.
      2) Click "Account Settings" on the left column and then you can change the password and save the new one.
    • About OUR BRAND
      1. Do you have a store?
      We are so sorry but we do not have real stores in your place and we just do online business. We make high quality dresses in accordance with the pictures. While shopping online, you can also enjoy more competitive prices.?Please feel free to contact us and we are willing to give you some professional suggestions.
      2. Why choose OUR BRAND?
      We are industry-leaders who care about our customers, always striving for 100% satisfaction. OUR BRAND boasts both unique aesthetic taste and professional manufacture and there is no need to worry about your purchase. What if you’re not happy with your dress? No worries! Our return policy is one of the best in the industry. Online dresses shopping just got easier. We promise to offer you the best quality from the purchase until the delivery.

    {% schema %} { “name”: “Section name”, “settings”: [] } {% endschema %}

    {% stylesheet %}

    dummy-chat-button-iframe, #ShopifyChat {

    display: none; }

    fake_livechat {

    height: 68px; width: 150px; position: fixed; bottom: 24px; border: none; z-index: 2147483647; overflow: hidden; right: 24px; }

    fake_livechat button {

    background-color: #202A36; border-radius: 30px; cursor: pointer; margin-top: 4px; border: none; box-shadow: 0px 0px 5px rgb(0 0 0 / 15%); font-size: 16px; font-weight: 500; height: 50px; padding: 14px 20px; width: auto; max-width: 144px; color: #fff; display: flex; align-items: center; font-family: -apple-system, BlinkMacSystemFont, ‘Segoe UI’, Roboto, Helvetica, Arial, sans-serif, ‘Apple Color Emoji’, ‘Segoe UI Emoji’, ‘Segoe UI Symbol’, sans-serif; letter-spacing: 0; text-transform: none; font-stretch: normal; font-style: normal; line-height: normal; -webkit-font-smoothing: antialiased; }

    .livechat-help .livechat-menu { z-index: 9999999999; position: fixed; bottom: 0; right: 0; width: 254px; height: 40px; border: 0; overflow: hidden; background: #fff; display: none; box-shadow: 0 0 7px 0 rgb(0 0 0 / 15%); } ul.faq-list { margin: 0; padding: 0; } .faq-item { list-style: none; } .livechat-help .livechat-menu .livechat__header { height: 40px; margin-bottom: 10px; background: #202a36; }

    .livechat-help .livechat-menu .livechatheader .livechatheader-title { padding: 0 25px; line-height: 40px; font-size: 14px; color: #fff }

    .livechat-help .livechat-menu .livechatheader .livechatheader-title:after { content: ‘——‘; float: right; width: 12px; overflow: hidden }

    .livechat-help .livechat-menu .livechat__body { padding: 0 25px; height: 290px; overflow-y: scroll }

    .livechat-help .livechat-menu .livechat__body .faq-item { font-weight: 400 }

    .livechat-help .livechat-menu .livechat__body .checked { font-weight: 700 }

    .livechat-help .livechat-menu .livechat__body h5 { height: 40px; line-height: 40px; font-size: 16px; color: #4c5253; font-weight: 400; cursor: pointer; margin: 0; }

    .livechat-help .livechat-menu .livechat__body h5:after { content: ‘+’; float: right; width: 12px; font-size: 20px; line-height: 40px; overflow: hidden }

    .livechat-help .livechat-menu .livechat__body h5.checked:after { content: ‘——‘ }

    .livechat-help .livechat-menu .livechat__body dl { margin-left: 20px; display: none }

    .livechat-help .livechat-menu .livechat__body dt { cursor: pointer; line-height: 16px; padding: 10px 0; color: #4c5253 }

    .livechat-help .livechat-menu .livechat__body dd { margin: 10px 0; line-height: 16px; font-size: 12px; color: #797979; display: none }

    .livechat-help .livechat-menu .livechat__body a { color: #202a36; }

    .livechat-help .livechat-menu .livechat__footer .notice { margin: 10px 30px 0; font-size: 12px; color: #202a36; padding: 8px 0; border-top: 1px solid #aeaeae }

    .livechat-help .livechat-menu .livechat__footer .livechat-btn { margin: 0 50px; height: 40px; line-height: 40px; font-size: 18px; color: #fff; text-align: center; font-weight: 700; background-color: #202a36; cursor: pointer; border-radius: 25px; } .custom-scrollbar { overflow: auto; }

    .custom-scrollbar::-webkit-scrollbar { width: 6px; background: #fff; }

    .custom-scrollbar::-webkit-scrollbar-track { width: 6px; background: #fff; }

    .custom-scrollbar::-webkit-scrollbar-thumb { border-radius: 3px; background: #202a36; }

    .custom-scrollbar::-webkit-scrollbar-button { height: 0; background-color: #202a36; } {% endstylesheet %}

    {% javascript %} $(document).ready(function() { $(“#fake_livechat”).click(function() {

    1. const windowWidth = $(window).width()
    2. const width = windowWidth > 750 ? '368px' : windowWidth + 'px'
    3. $("#fake_livechat").hide()
    4. $(".livechat-menu").show().animate({
    5. width: width,
    6. height: "460px"
    7. }, "fast")

    }) $(“.livechat-menu .livechat__header”).click(function() {

    1. $(this).closest(".livechat-menu").animate({
    2. width: "254px",
    3. height: "40px"
    4. }, "fast", function() {
    5. $(this).hide()
    6. $("#fake_livechat").show()
    7. })

    }) $(“.livechat-menu .livechat__body dt”).click(function() {

    1. $(this).toggleClass("checked"),
    2. $(this).next("dd").slideToggle()

    }) $(“.livechat-menu .livechat__body h5”).click(function() {

    1. $(this).toggleClass("checked"),
    2. $(this).next("dl").slideToggle()

    }) $(“.livechat-menu .livechat-btn”).click(function() {

    1. $(this).closest(".livechat-menu").hide();
    2. if ($('#dummy-chat-button-iframe').length) {
    3. $('#dummy-chat-button-iframe')[0].contentWindow.document.querySelector('button').click();
    4. const lock = setInterval(function() {
    5. var node = $('#ShopifyChat')
    6. console.log(1)
    7. if (!node.length) {
    8. return
    9. }
    10. clearInterval(lock)
    11. node.show()
    12. }, 100)
    13. }
    14. if ($('#ShopifyChat').length) {
    15. $('#ShopifyChat').show();
    16. }

    }) }) {% endjavascript %}

  1. 3. theme.liquid末尾中引入,faqsection, 不同的主题位置不一样,但是这个不重要,在 body/>之前就可以了。
  2. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/401150/1648377526433-bc1a1cf4-f0e8-4b07-aad7-7e76d59cb683.png#clientId=u3cd09803-8c73-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=396&id=MvPyZ&margin=%5Bobject%20Object%5D&name=image.png&originHeight=396&originWidth=914&originalType=binary&ratio=1&rotation=0&showTitle=false&size=37874&status=done&style=none&taskId=u67e1b6b9-7e5f-4253-a3e1-35fe638350f&title=&width=914)
  3. ```html
  4. {% section 'livechat_faq' %}

3. 效果展示

店铺地址: https://asen-practice.myshopify.com/ 密码:test 密码:test

点击查看【bilibili】

1. fake效果

image.png

2. 点击fake效果

image.png

3. 查看细节

image.png

4. 点击chat with us now

image.png

Tips: 如有引用请标注源文章地址

关注我的【小红书】,第一时间掌握更新动态


你的鼓励就是我创作的动力!
zanshang.png