Answer
Oct 26, 2021 - 11:14 AM
If you're testing your site and trying to submit a question...but you're getting a validation message that you need to associate a product or a category....then it means that the widget probably isn't recognizing the product information that you're passing in as parameters.
Most Common Problem
The most common problem when you get this validation message is that you may be testing the widget on a test site....which is placed on a development environment domain....something like "https://dev.yoursite.com". The issue is arising because Answerbase wants to know that the widget request is coming from a valid source/domain...and therefore is checking the domain that the widget request is coming from and the domain that is identified in your settings.
You can see in your administration site under "System Settings > Ecommerce Module" that there is a "website" value there as seen here:
If you're testing on a page (for example) with the URL "https://dev.yoursite.com/product-page" then you should put "dev.yoursite.com" within that value. Make that change, save the settings, clear your cache...and then retest the widget. Most of the time the issue will go away.
IMPORTANT: Make sure that when you go live...to change this setting to reflect the domain of your live environment.
Other Potential Problems
If you review the above and everything seems to be setup fine, you want to check to see if the parameters are effectively getting passed into the widget so we're able to determine the product that the question is supposed to be associated with automatically.
To test if you've installed your widget correctly, all you need to do is load your product page and view the source code of that page (Ctrl +U) to see if the parameters are getting passed in appropriately. Here is an example of what the widget code will look like when you have properly installed.
Ensure that all of your product parameters are being populated appropriately and retest.
Most Common Problem
The most common problem when you get this validation message is that you may be testing the widget on a test site....which is placed on a development environment domain....something like "https://dev.yoursite.com". The issue is arising because Answerbase wants to know that the widget request is coming from a valid source/domain...and therefore is checking the domain that the widget request is coming from and the domain that is identified in your settings.
You can see in your administration site under "System Settings > Ecommerce Module" that there is a "website" value there as seen here:
If you're testing on a page (for example) with the URL "https://dev.yoursite.com/product-page" then you should put "dev.yoursite.com" within that value. Make that change, save the settings, clear your cache...and then retest the widget. Most of the time the issue will go away.
IMPORTANT: Make sure that when you go live...to change this setting to reflect the domain of your live environment.
Other Potential Problems
If you review the above and everything seems to be setup fine, you want to check to see if the parameters are effectively getting passed into the widget so we're able to determine the product that the question is supposed to be associated with automatically.
To test if you've installed your widget correctly, all you need to do is load your product page and view the source code of that page (Ctrl +U) to see if the parameters are getting passed in appropriately. Here is an example of what the widget code will look like when you have properly installed.
<script src="https://yoursite.services.answerbase.com/javascript/widget/full-featured-w
idget.js" type="text/javascript"
data-insert-after=".productView-description"
data-show-answers="false"
data-product-external-id="98655589"
data-product-sku="A50021"
data-product-title="Collette, florentine dress"
data-product-price="99.99"
data-product-url="https://yoursite.com/collette-florentine-dress/"
data-product-description="This dress is made of cotton in Texas."
data-product-category="Dresses"
data-product-image-url="https://yoursite.com/products/images/florentine-dress.j
pg">
</script>
Ensure that all of your product parameters are being populated appropriately and retest.