Skip to content

Instantly share code, notes, and snippets.

@jhouedanou
Created September 12, 2020 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhouedanou/c236c2166d39087535e32348421d7bd0 to your computer and use it in GitHub Desktop.
Save jhouedanou/c236c2166d39087535e32348421d7bd0 to your computer and use it in GitHub Desktop.
<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