Commit a174e96c authored by Nahla Shiri's avatar Nahla Shiri

correction bugs Redmine

parent d5d33962
......@@ -1149,6 +1149,8 @@ aside.news-wrapper {
background-size: contain;
background-repeat: no-repeat;
background-position: center;
cursor:pointer;
}
#slides .element-slider:last-child .image{
margin-bottom: 0px;
......@@ -1487,14 +1489,14 @@ label.chevron.bottom::first-letter {
padding-top: 156px;
padding-bottom: 30px;
}
.product-info .info-content h3,
.product-info .info-content h1,
.product-info .info-content h2{
font-size: 20px;
line-height: 24px;
letter-spacing: 1px;
text-transform: uppercase;
}
.product-info .info-content h3{
.product-info .info-content h1{
padding-bottom: 5px;
}
.product-info .btn-list{
......@@ -1628,9 +1630,9 @@ label.chevron.bottom::first-letter {
.easyzoom.is-error img {
cursor: not-allowed;
}
.easyzoom-notice {
/*.easyzoom-notice {
display: none;
}
}*/
.easyzoom-flyout {
position:absolute;
......
......@@ -603,7 +603,13 @@ function onScroll(event){
var currLink = $(this);
var refElement = $(currLink.attr("href"));
//console.log(currLink);
if (refElement.length && refElement.position().top - ( $(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight() ) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
var windowWidth = $(window).width();
var margin_top = 0;
if(windowWidth > 1920)
margin_top = 150;
else
margin_top = 50;
if (refElement.length && refElement.position().top - ( $(".main").outerHeight() / 2 - titleHeight - $(".footer").outerHeight()- margin_top ) <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
$('.subcat a').removeClass("active");
currLink.addClass("active");
......
......@@ -12,7 +12,6 @@ jQuery(document).ready(function() {
var download_link = jQuery('.download_file_link').attr('href');
var current_var = jQuery('.download_file_link').attr('id');
var variation_id = jQuery('input[name="variation_id"]').val();
// alert(variation_id);
if (variation_id == 0)
id = current_var;
else
......@@ -55,12 +54,14 @@ jQuery(document).ready(function() {
jQuery("#pa_univers .selected").each(function() {
tabunivers[i++] = jQuery(this).text();
});
var sku = jQuery("#sku-search").val();
var selected_colors = tabcolor.join(',');
var selected_formats = tabformat.join(',');
var selected_matiere = tabmatiere.join(',');
var selected_univers = tabunivers.join(',');
var params = {pa_couleur: selected_colors, pa_format: selected_formats, pa_matiere: selected_matiere, pa_univers: selected_univers};
var params = {pa_couleur: selected_colors, pa_format: selected_formats, pa_matiere: selected_matiere, pa_univers: selected_univers,sku:sku};
window.location.href = "?" + jQuery.param(params);
jQuery('.list-animation section').each(function() {
......@@ -99,8 +100,11 @@ jQuery(document).ready(function() {
}
});
if(result_found == false)
jQuery('.search_notfound').text(' Aucun produit ne correspond à votre recherche');
{jQuery('.search_notfound').text(' Aucun produit ne correspond à votre recherche');
console.log(result_found);
}
});
......
......@@ -10,6 +10,9 @@ function loadProductContent() {
$('.product-details .list').width('100%');
$('.product-details form').width('21.7%');
}
$('.pa_couleur li').getListColors();
$('.pa_couleur li').selectColor();
$('.pa_format li').selectFormat();
......@@ -18,50 +21,49 @@ function loadProductContent() {
$('.pa_paquets li').selectFormat();
$('.pa_designation li').selectFormat();
$('.list-wrapper .color-list').setColorToWhite('input');
$('#zoom').zoom();
$('#zoom, .element-slider').zoom();
$('article[data-color], .pa_couleur li').click(function(e) {
$(this).selectSlide($('#slides'));
});
$('#mozaique').open_gallery();
initFunction();
$.fn.responsive();
$('.variations_form').on('reset_data', function()
{
{
console.log("reset data");
$attributes = $('.variations .list');
var num_attr = $('.variations .list').length;
// alert(num_attr);
$attributes.each(function(i)
{
var $attr = $(this);
if (!$attr.hasClass('pa_couleur') && !$attr.hasClass('pa_taille'))
{
//alert($attr.hasClass('first_attr'));
if (!$attr.hasClass("first_attr") || num_attr == 1)
{
console.log(i, $attr, $attr.find('input:not(:disabled):checked').length);
if (!$attr.find('input:not(:disabled):checked').length)
{
{
$firstInput = $attr.find('input:not(:disabled)').first();
$firstInput.prop('checked',true);
$firstInput.change();
}
}
/*if ($attr.hasClass('pa_taille'))
{
console.log('--------' + i, $attr, $attr.find('input:not(:disabled):checked').length);
if (!$attr.find('input:not(:disabled):checked').length)
{ console.log('heeeere');
$firstInput = $attr.find('input:not(:disabled)').first();
$firstInput.prop('checked',true);
$firstInput.change();
}
}*/
else
{
$('.list').first().find('input:disabled').prop('disabled',false);
// jQuery(jQuery('.list').first()).find('input').first().prop('checked',true);
//jQuery(jQuery('.list').first()).find('input').first().change();
}
});
});
function onFoundVariation()
{
console.log('found variation');
$('.list').first().find('input:disabled').prop('disabled',false);
//$('.variations_form .format_list input').prop('checked',false);
$('.variations_form .color-list input:disabled').prop('disabled',false);
$('.variations_form .attribute_pa_taille input:disabled').prop('disabled',false);
console.log('found', $('.variations_form .format-list input:checked + * + .format-desc'));
//var format = $('.variations_form .format-list input:checked + * + .format-desc').text();
var format='';
......@@ -74,6 +76,23 @@ function loadProductContent() {
$('.info-color').text($('.color-list input:checked').attr('value'));
var varID = jQuery('input[name="variation_id"]').val();
/**********NS***********/
var variations_has_file = $('.download_file').data('fiche');
var tab_var_file = variations_has_file.split(',').slice(0, -1);
//console.log(tab_var_file);
if ($.inArray(varID, tab_var_file) > -1)
{
$('.download_file').show();
}
else
{
$('.download_file').hide();
}
/**********************/
if (varID != 0) {
var price = jQuery('.woocommerce-variation-price .woocommerce-Price-amount').text();
......@@ -111,13 +130,14 @@ function loadProductContent() {
$(function(){
var initFunction=function(){
$('a[href^="#"], .easyzoom img').click(function(e){
e.preventDefault();
//e.preventDefault();
});
};//END init Function
$.fn.zoom = function(){ //Zoom on Image
$(this).on('click', function() {
//$('.loading-hd').show();
var zoom = $(this);
$( ".easyzoom" ).each(function( i ) {
//$( ".easyzoom" ).each(function( i ) {
var $easyzoom = $(this).easyZoom();
var api = $easyzoom.filter('.easyzoom--with-toggle').data('easyZoom');
api.teardown();
......@@ -127,11 +147,17 @@ $(function(){
zoom.removeClass("active");
api.teardown();
} else {
$this.data("active", true);
zoom.addClass("active");
zoom.removeClass('is-loading');
zoom.addClass("is-ready");
api._init();
$(this).trigger( "mouseenter" );
//api.teardown();
}
});
//});
});
} //END Zoom On Image
$.fn.getListColors = function(){
......@@ -149,6 +175,9 @@ $(function(){
formatWrapper.css({'height' : formatH , 'width' : formatW });
})
}
$.fn.selectColor= function(){
$(this).on('click',function(){
var $input = $(this).find('input');
......@@ -328,6 +357,9 @@ $(function(){
//localStorage['from-site'] = true;
$('head').append($('.header-shop'));
var toLink = $(this).data('link');
$(document).attr("title", $(this).data('title'));
// $(document).attr("description", $(this).data('description'));
// $.post(toLink, { fromSite: true});
//$.cookie("formSite", 1);
$('.load-page').parent().addClass('active');
......
......@@ -135,14 +135,14 @@
* @param {Event} e
*/
EasyZoom.prototype._onEnter = function(e) {
var touches = e.originalEvent.touches;
// var touches = e.originalEvent.touches;
this.isMouseOver = true;
if (!touches || touches.length == 1) {
// if (!touches || touches.length == 1) {
e.preventDefault();
this.show(e, true);
}
// }
};
/**
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
<span>Filtres</span>
<span class="close-btn"></span>
</div>
<input type="text" name ="sku-search" placeholder="Référence" id="sku-search"/>
<?php
$attributes = array('Univers' => 'pa_univers', 'Matiére' => 'pa_matiere', 'Format' => 'pa_format', 'Couleurs' => 'pa_couleur');
foreach ($attributes as $key => $value) :
......@@ -148,7 +148,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</div>
<div class="right-panel right">
<div class="panel panel-content list-animation">
<?php if ($_GET['pa_couleur'] != '' || $_GET['pa_format'] != '' || $_GET['pa_matiere'] != ''): ?>
<?php if ($_GET['pa_couleur'] != '' || $_GET['pa_format'] != '' || $_GET['pa_matiere'] != '' || $_GET['pa_univers'] != '' || $_GET['sku'] != ''): ?>
<span class="search_result">Résultat de votre recherche :<span class="search_notfound" style="color:#ff6a5f"></span></span>
<?php endif; ?>
......
......@@ -85,14 +85,13 @@ do_action('woocommerce_before_add_to_cart_form');
<div class="gallery clearfix">
<div class="gallery-content clearfix">
<span class="close-btn"></span>
<article class = "row" data-color = "<?php echo get_post_thumbnail_id($ID) ?>">
<?php if ( is_user_logged_in() ) { ?>
<a class = "download-btn" href="<?php echo get_the_post_thumbnail_url($ID, 'full') ?>" download></a>
<?php } ?>
<figure>
<img src="<?php echo get_the_post_thumbnail_url($ID, 'medium') ?>" alt="" title="">
<img src="<?php echo get_the_post_thumbnail_url($ID, 'medium') ?>" alt="<?php echo get_the_title($ID)?>" title="">
</figure>
</article>
<?php
......@@ -107,7 +106,7 @@ do_action('woocommerce_before_add_to_cart_form');
<a class = "download-btn" href="<?php echo $hd[0]; ?>" download></a>
<?php } ?>
<figure>
<img src="<?php echo $attachment[0]; ?>" alt="" title="">
<img src="<?php echo $attachment[0]; ?>" alt="<?php echo get_the_title($ID)?>" title="">
</figure>
</article>
<?php
......@@ -130,7 +129,7 @@ do_action('woocommerce_before_add_to_cart_form');
<?php
$format = $product->get_attribute( 'pa_format' );?>
<h2 class = "crete font-small" ><?php echo $sub_cat[0]->name ?></h2>
<h3 class = "crete font-small info-attr" ><span class="info-format"><?php echo $format; ?></span> <span class="info-color"><?php echo$_GET['pa_couleur'] ?></span></h3>
<h1 class = "crete font-small info-attr" ><span class="info-format"><?php echo $format; ?></span> <span class="info-color"><?php echo$_GET['pa_couleur'] ?></span></h1>
<div class="details font-small">
<p class="info-format-txt">
<?php echo $format; ?>
......
......@@ -37,11 +37,18 @@ if (!function_exists('print_attribute_radio')) {
function print_attribute_radio($checked_value, $value, $label, $name, $index=0) {
$current_color = $_GET['pa_couleur'];
$current_taille = $_GET['pa_taille'];
$selected = $default_checked = "";
if ($value == strtolower($current_color)){
$default_checked = "checked";
$selected = "selected";
}
if ($value == strtolower($current_taille)){
$default_checked = "checked";
$selected = "selected";
}
$checked = sanitize_title($checked_value) === $checked_value ? checked($checked_value, sanitize_title($value), false) : checked($checked_value, $value, false);
......@@ -78,7 +85,7 @@ if (!function_exists('print_attribute_radio')) {
'<img src="'.$default_active.'" class="active" id="'.$value.'-active" style ="height:35px;width:35px" alt="">';
}
$filtered_label = apply_filters('woocommerce_variation_option_name', $label);
printf('<li class="format-list '.$input_name.'"><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s>
printf('<li class="format-list '.$input_name.' '.$selected.'"><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s '. $default_checked .'>
<label class="format-label" for="xx%3$s">'.$format_img.'</label>
<div class="format-desc">'.$label.'</div>
......@@ -124,9 +131,10 @@ do_action('woocommerce_before_add_to_cart_form');
foreach ($var_colors as $key => $value) :
?>
<div style="background-image:url('<?php echo get_the_post_thumbnail_url($key, 'medium') ?>')" class="image element-slider easyzoom easyzoom--overlay easyzoom--with-toggle" data-color = "<?php echo $value ?>" data-slick-index = "1">
<a href="<?php echo get_the_post_thumbnail_url($key, 'full') ?>">
<a href="<?php echo get_the_post_thumbnail_url($key, 'large') ?>" data-standard="<?php echo get_the_post_thumbnail_url($key, 'medium') ?>">
<!--<img src="<?php echo get_the_post_thumbnail_url($key, 'medium') ?>" alt="" />-->
</a>
<div class="loading-hd"></div>
</div>
<?php
......@@ -166,7 +174,7 @@ do_action('woocommerce_before_add_to_cart_form');
<a class = "download-btn" href="<?php echo get_the_post_thumbnail_url($key, 'full') ?>" download></a>
<?php } ?>
<figure>
<img src="<?php echo get_the_post_thumbnail_url($key, 'medium') ?>" alt="" title="">
<img src="<?php echo get_the_post_thumbnail_url($key, 'medium') ?>" alt="<?php echo get_the_title($ID)?>" title="">
</figure>
</article>
<?php
......@@ -182,7 +190,7 @@ do_action('woocommerce_before_add_to_cart_form');
<a class = "download-btn" href="<?php echo $hd[0]; ?>" download></a>
<?php } ?>
<figure>
<img src="<?php echo $attachment[0]; ?>" alt="" title="">
<img src="<?php echo $attachment[0]; ?>" alt="<?php echo get_the_title($ID)?>" title="">
</figure>
</article>
<?php
......@@ -196,22 +204,24 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
</div>
</div>
<div class="product-details full-height row right clearfix transition">
<form class="variations_form cart left row" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint($product->get_id()); ?>" data-product_variations="<?php echo htmlspecialchars(wp_json_encode($available_variations)) ?>">
<?php do_action('woocommerce_before_variations_form'); ?>
<?php if (empty($available_variations) && false !== $available_variations) : ?>
<p class="stock out-of-stock"><?php _e('This product is currently out of stock and unavailable.', 'woocommerce'); ?></p>
<?php else : ?>
<div class="variations" cellspacing="0">
<?php
$i=0;
foreach ($attributes as $name => $options) : ?>
<div class="list row <?php echo $name;?> left border-l center">
<div class="list row <?php echo $name;?> left border-l center <?php if($i==0) echo "first_attr" ;?>">
<div class="product-header center font-small label">
<label for="<?php echo sanitize_title($name); ?>" class = "chevron bottom"> <?php if($i==0) /*echo 'choix de la '*/; else /*echo 'choix du '*/; ?><?php echo strtolower(wc_attribute_label($name)); ?></label>
......@@ -225,6 +235,8 @@ do_action('woocommerce_before_add_to_cart_form');
} else {
$checked_value = '';
}
?>
<div class="list-wrapper">
<ul class="value">
......@@ -285,7 +297,7 @@ do_action('woocommerce_before_add_to_cart_form');
$format = $format_info->name;?>
<h2 class = "crete font-small" ><?php echo $sub_cat[0]->name; ?></h2>
<h3 class = "crete font-small info-attr" ><span class="info-format"><?php echo $format ; ?></span> <span class="info-color"><?php echo$_GET['pa_couleur'] ?></span></h3>
<h1 class = "crete font-small info-attr" ><span class="info-format"><?php echo $format ; ?></span> <span class="info-color"><?php echo$_GET['pa_couleur'] ?></span></h1>
<div class="details font-small">
<p class="info-format-txt"><?php echo $format; ?></p>
<p class="pq"><?php echo nap_variable_meta($current_variationID, 'variation_description'); ?></p>
......@@ -314,7 +326,7 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
<div class = "btn-list">
<a href="<?php echo get_permalink(157); ?>" class="btn pink-btn rounded">Nous contacter</a>
<a class="btn pink-btn rounded download-btn download_file">Télécharger la fiche technique </a>
<a class="btn pink-btn rounded download-btn download_file" data-fiche="<?php nap_var_fiche($available_variations);?>">Télécharger la fiche technique </a>
<a href="<?php echo get_permalink(43); ?>?product_id=<?php echo $product->get_id()?>&" class="hidden download_file_link" id="<?php echo $current_variationID ?>"></a>
</div>
<?php if(count($product->get_upsell_ids())):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment