Hi,
Thank you for contacting us and I'd be happy to assist.
I'm afraid, the document and the video that you refer to is no longer available, but you can achieve this using the following steps:
1. On the page where you'd like to select the items for the comparison, you can include a custom form:
<form action="URL of the comparison page" method="get" class="compare-form">
<input type="submit" value="Compare">
</form>
Note: You'll replace the "URL of the comparison page" with the actual link of your comparison page.
The role of this form would be to collect IDs of the posts which you'd like to use for the comparison and then pass them on to the comparison page using the URL parameter "compare".
2. Inside the loop of the products/posts which are shown on the selection page, you'll need a custom checkbox input with the current post's ID set as the value:
<input type="checkbox" name="compare[]" value="[wpv-post-id]" class="compare-check">
3. Next, you'll need a custom script on the selection page that will detect when any checkbox from these products/posts is clicked and will append the clicked checkbox input in the custom form. It will also remove it if the checkbox for a product/post is unchecked.
jQuery( document ).ready(function() {
jQuery( 'input.compare-check' ).bind({
click: function() {
if(!jQuery(this).is(':checked')) {
var clickedVal = jQuery(this).attr('value');
jQuery("form.compare-form input[value="+clickedVal+"]").remove();
}
else
{
jQuery(this).clone().appendTo(jQuery('form.compare-form'));
}
}
});
});
4. You can also include custom CSS code to hide the checkboxes which are added inside the custom compare form:
form.compare-form input[type=checkbox] {
display:none;
}
As a result, when the custom form's submit button will be clicked with some posts selected, it will take the visitor to the comparison page, with the IDs of the selected posts in the URL parameter.
On the comparison page, you can create a view with a post ID query filter that shows posts whose IDs are available in the URL parameter "compare" and design the output as needed.
I hope this helps and please let me know if any step is not clear.
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar