I just would like to understand the mechanism that Smart Recommendation track the click into the recommended products as I overrided the product template to fit with our expectation. And I would like to make sure that our overriding will not make the statistic wrong functioning.
Dear,
I just would like to understand the mechanism that Smart Recommendation track the click into the recommended products as I overrided the product template to fit with our expectation. And I would like to make sure that our overriding will not make the statistic wrong functioning.
Hi Truong,
Here is the required HTML structure when overriding templates:
#1. Wrapper container (rendered by PHP, not included in the template):
#2. In the template, the following classes/attributes are required:
<!-- ↓ REQUIRED: class + data-product-id --> <div class="wpcrc-product" data-product-id="<?php echo esc_attr($pid); ?>"> <!-- ↓ REQUIRED: class wpcrc-product-link --> <a href="..." class="wpcrc-product-link"> <!-- Image; name; etc. --> </a> <!-- ↓ REQUIRED: WC add-to-cart button (class add_to_cart_button) --> <div class="wpcrc-product-atc"> <?php woocommerce_template_loop_add_to_cart(); ?> </div> </div>Best regards,
Dustin