Insert Recommendations using Shortcode editor

How to insert Clerk.io recommendations using Woocommerce Shortcode editor

1. Shortcode integration

If you are using a Shortcode editor like Elementor, then our regular recommendation code snippet may not be rendering due to the product ID is syntaxed differently in Elementor than a normal HTML block.

If you are using Hooks, then you can go to Appearance -> Custom Layouts -> Insert the shortcode on the Hook that belongs to Clerk (in case, a developer can create these it he wants Clerk to be a Hook).

To insert the code, replace:

<span class="clerk" data-template="@product-page-alternatives" data-products="[<?php echo $product->get_id(); ?>]">
</span>

With:

<span class"clerk" data-template="@product-page-alternatives data-products="[ [clerk_product_id] ]"></span>

Try first with only simple brackets, and then, if that doesn’t work, with double brackets.

<span class="clerk" data-template="@category-page-popular" data-category="[ [clerk_category_id] ]"></span>

If this one does not work you can try these:

<span class="clerk" data-template="@product-page-alternatives" data-products="[<?php the_ID(); ?>]"></span>
<span class="clerk" data-template="@product-page-others-also-bought" data-products="[<?php the_ID(); ?>]"></span>

2. Manual Code Insertion

If you cannot insert the shortcode or you don’t don’t use any kind of Editor, go to Appearence→ Personalization→ Then click on the product page and then follow these steps:

Widget → Shopsidebar 1 → add widget → Clerk Content

3. WP Baker Builder

Theme File Integration

Adding product page slider to all pages:

Appearance - Theme File Editor - WooCommerce - Content-single-product.php

(or similar file to where your product page page is found)

Insert span code into the file where you would like it to be shown. Similar to FTP access.

<span class="clerk" data-template="@product-page-alternatives" data-products="[<?php the_ID(); ?>]"></span>
<span class="clerk" data-template="@product-page-others-also-bought" data-products="[<?php the_ID(); ?>]"></span>