WooCommerce is built around themes, which often means that the Clerk.io plugin cannot insert our embedcodes, because the hooks are not placed where they are supposed to.
This guide explains how to manually insert codes if that is the case.
1. Find the right file
1. Start by locating your search-form. You can do this by checking your source-code, and finding a unique text for the field.
2. After identifying this, you need a good way of searching through your files to find this. We recommend using Sublime Text.
3. Open your webshops FTP files and locate public_html -> wp-content -> themes
4. Drag the themes to your desktop, to copy it to your computer. This will allow you to search in the files:
5. In Sublime go to Project -> Add Folder to Project
6. Choose the themes folder that you saved on your computer.
7. Now you can search in the files, by going to Find -> Find in Files. You can even choose to only search in .php files which is normally the file-type used for theme-files in WooCommerce:
2. Making the link to the search-page work
If you have already followed the guide for setting up search, and have created a page in WooCommerce for the Search Results, but your search-field is not linking correctly, this is what you need to do.
1. Start by looking at the webshop in your browser. We recommend using Chrome.
2. Locate any HTML that seems to be unique for the search-field. For example
3. Search for this in Sublime, to find a list of files that its in:
4. Find the matching file on FTP.
5. Now you can change the needed settings to have Clerk.io link to the correct page. The 3 things you need to change are:
- The URL that the customer is linked to, often found in the
<form>element, needs to be changed to match the name of the page you created in WooCommerce. This will often be "soegeresultater" or "search-results"
- The "name" attribute of the input-field, that needs to be
- The hidden input field with
name="post_type"needs to be commented out.
6. A search-form could look like this before changing it:
7. And should look like this after the change:
8. Now you should be linked to the search page when searching: www.mywebshop.com/soegeresultater?searchterm=test
3. Manually embedding recommendations