Skip to content

Instantly share code, notes, and snippets.

@jhouedanou
Created Sep 12, 2020
Embed
What would you like to do?
<script type="text/javascript">
require(['jquery', 'cookie'], function($) {
$(document).ready(function() {
if ($("body").hasClass("page-products")) {
//si l'user click sur la photo, creer un cookie
$('.product-item-info').each(function() {
$(this).click(function() {
var moupe = $(this).find('.swatch-option.color.selected');
var tangoyi = moupe.attr("id");
//console.log(tangoyi);
var choixdelutilisateur = $.cookie('choixdelutilisateur', tangoyi);
//console.log(choixdelutilisateur);
});
});
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment