Switch between Template view of proucts based on user selection woocommerce

I use woocommmerce and i have two template view for products (content-product.php) and (contentcarousel-product.php) . in (archive-product.php) per defaut display first template like this

<?php wc_get_template_part( ‘content’, ‘product’ ); ?>

i created two button like this with onclick event with javascrip

<button onclick=”Viewone()”> view 1</button>
<button onclick=”Viewtwo()”> view 2</button>

i want when click button 1 display first template per defaut and when click button 2 display second template.

How i can do this with javascript and php

Read more here:: Switch between Template view of proucts based on user selection woocommerce

Leave a Reply

Your email address will not be published. Required fields are marked *