Commit 1bbdde10 authored by Nahla Shiri's avatar Nahla Shiri

correction js + css + fiche technique

parent 43366f80
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -63,6 +63,14 @@ ...@@ -63,6 +63,14 @@
padding: 0px; padding: 0px;
color: #182566; color: #182566;
} }
::-webkit-scrollbar {
width: 0px; /* remove scrollbar space */
background: transparent; /* optional: just make scrollbar invisible */
}
.product-details .list {overflow: -moz-scrollbars-none;}
@keyframes fadein { @keyframes fadein {
from { from {
opacity:0; opacity:0;
...@@ -700,10 +708,10 @@ nav ul ul{ ...@@ -700,10 +708,10 @@ nav ul ul{
display: none; display: none;
width: 190px; width: 190px;
} }
nav ul ul li:before{ /*nav ul ul li:before{
content: "•"; content: "•";
padding-right: 5px; padding-right: 5px;
} }*/
nav ul ul li { nav ul ul li {
font-size: 14px; font-size: 14px;
font-weight: 300; font-weight: 300;
...@@ -791,6 +799,10 @@ VII/ Pages...............ALL pages ...@@ -791,6 +799,10 @@ VII/ Pages...............ALL pages
========================================================================== */ ========================================================================== */
/* --------------*/ /* ---------->>> HOME <<<-----------*/ /* --------------*/ /* --------------*/ /* ---------->>> HOME <<<-----------*/ /* --------------*/
#home {
background: rgba(7,17,48,0.5);
}
.img-wrapper{ .img-wrapper{
height: 100vh; height: 100vh;
background-size: cover; background-size: cover;
...@@ -865,20 +877,36 @@ aside.news-wrapper { ...@@ -865,20 +877,36 @@ aside.news-wrapper {
height: 100%; height: 100%;
} }
.product-images{ .product-images{
width: 59%; width: 59% !important;
padding: 39px; padding: 39px;
opacity: 0; opacity: 0;
text-align: center;
position: relative;
} }
.product-slides{
width: 80%; .product-images .close-panel{
position: absolute;
left: 5%;
}
.woocommerce-product-details__short-description {
display: none;
}
.product-slides .product-header {
text-align: left;
margin-left: 35px;
}
.product-slides {
width: 580px;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
padding-left: 60px; padding-left: 25px;
} }
.product-header{ .product-header{
color: #182566; color: #182566;
padding-bottom: 33px; padding: 22px 30px 33px;
padding-top: 22px;
} }
.product-header h3{ .product-header h3{
font-size: 25px; font-size: 25px;
...@@ -889,8 +917,8 @@ aside.news-wrapper { ...@@ -889,8 +917,8 @@ aside.news-wrapper {
position: relative; position: relative;
} }
#slides{ #slides{
/* width: 80%;*/ width: 415px;
width: 500px; /*width: 500px;*/
height: 100%; height: 100%;
margin: 0 auto; margin: 0 auto;
} }
...@@ -900,7 +928,7 @@ aside.news-wrapper { ...@@ -900,7 +928,7 @@ aside.news-wrapper {
margin: 0 auto; margin: 0 auto;
} }
.element-slider{ .element-slider{
height: 500px; height: 415px;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
...@@ -970,7 +998,7 @@ aside.news-wrapper { ...@@ -970,7 +998,7 @@ aside.news-wrapper {
margin-bottom: 12px; margin-bottom: 12px;
border-radius: 20px; border-radius: 20px;
position: relative; position: relative;
padding: 3px 0px; //padding: 3px 0px;
/*padding: 3px 10px 4px 3px; */ /*padding: 3px 10px 4px 3px; */
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
...@@ -979,6 +1007,7 @@ aside.news-wrapper { ...@@ -979,6 +1007,7 @@ aside.news-wrapper {
width: 25px; width: 25px;
display: block; display: block;
height: 25px; height: 25px;
line-height: 25px;
} }
.nav-slider ul li.active{ .nav-slider ul li.active{
background: #FF6A5F; background: #FF6A5F;
...@@ -989,8 +1018,8 @@ aside.news-wrapper { ...@@ -989,8 +1018,8 @@ aside.news-wrapper {
} }
.nav-slider ul li:hover{ .nav-slider ul li:hover{
background: #FF6A5F; background: #FF6A5F;
width: 100%; width: 150%;
padding-right: 13px; padding-right: 10px;
-webkit-transition: all .2s ease-in-out; -webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out; -moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out;
...@@ -1059,14 +1088,21 @@ aside.news-wrapper { ...@@ -1059,14 +1088,21 @@ aside.news-wrapper {
} }
.product-details .list{ .product-details .list{
width: 50%; width: 50%;
padding: 40px 30px; padding: 40px 0px;
position: relative; position: relative;
height: 100%; height: 100%;
background: #fff; background: #fff;
overflow-y: auto; overflow-y: hidden;
opacity: 0; opacity: 0;
border-left: 1px solid rgba(26,26,26,0.1); border-left: 1px solid rgba(26,26,26,0.1);
} }
.product-details .list ul {
overflow-y: scroll;
max-height: 560px;
margin-right: -17px;
}
.border-l:before{ .border-l:before{
content: ''; content: '';
display: block; display: block;
...@@ -1101,10 +1137,31 @@ aside.news-wrapper { ...@@ -1101,10 +1137,31 @@ aside.news-wrapper {
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
} }
.pa_format ul li{ .pa_format ul li {
text-align: center; text-align: center;
margin-bottom: 25px;
color: #313D7A; color: #313D7A;
max-width: 85%;
}
.pa_format ul li label {
overflow: hidden;
display: block;
vertical-align: text-top;
}
label.chevron.bottom {
display: block;
width: 120%;
}
.pa_format ul li img {
vertical-align: top;
margin-top: -50px;
}
.pa_format ul li:last-of-type{
margin-bottom: 20px;
} }
.pa_format li.disabled{ .pa_format li.disabled{
color: rgba(26,26,26,0.2); color: rgba(26,26,26,0.2);
...@@ -1165,7 +1222,7 @@ aside.news-wrapper { ...@@ -1165,7 +1222,7 @@ aside.news-wrapper {
.product-info .info-content h2{ .product-info .info-content h2{
font-size: 20px; font-size: 20px;
line-height: 24px; line-height: 24px;
letter-spacing: 2px; letter-spacing: 1px;
text-transform: uppercase; text-transform: uppercase;
} }
.product-info .info-content h3{ .product-info .info-content h3{
...@@ -1184,6 +1241,11 @@ aside.news-wrapper { ...@@ -1184,6 +1241,11 @@ aside.news-wrapper {
.product-info .details p{ .product-info .details p{
padding-bottom: 6px; padding-bottom: 6px;
} }
.entry-summary .price {
font-size: 0;
}
.product-info .price{ .product-info .price{
font-size: 20px; font-size: 20px;
line-height: 24px; line-height: 24px;
...@@ -1340,6 +1402,7 @@ aside.news-wrapper { ...@@ -1340,6 +1402,7 @@ aside.news-wrapper {
-moz-appearance:none; -moz-appearance:none;
appearance:none; appearance:none;
position: relative; position: relative;
margin-left: -15px;
} }
.reset_variations, .quantity{ .reset_variations, .quantity{
display: none !important; display: none !important;
...@@ -1592,6 +1655,44 @@ aside.news-wrapper { ...@@ -1592,6 +1655,44 @@ aside.news-wrapper {
display: none; display: none;
} }
.filter-bloc .bloc-content ul {
overflow-y: auto;
max-height: 300px;
overflow-x: hidden;
}
.filter-bloc .list-color-filter li {
display: inline-block;
height: 15px;
width: 15px;
border-radius: 50%;
cursor: pointer;
text-align: center;
margin-bottom: 4px;
margin-right: 3px;
}
.filter-bloc .list-color-filter li.selected:before {
content: '\2713';
color: #fff;
margin: 0 auto;
font-size: 9px;
margin-bottom: 0px;
}
.filter-bloc .list-color-filter li:before {
content: '';
}
.filter-bloc .list-color-filter li:last-child {
width: 100%;
margin-top: 8px;
text-align: center;
font-size: 9px;
letter-spacing: 0.2px;
}
.filter-bloc ul li { .filter-bloc ul li {
display: block; display: block;
padding-bottom: 2px; padding-bottom: 2px;
...@@ -1629,6 +1730,10 @@ aside.news-wrapper { ...@@ -1629,6 +1730,10 @@ aside.news-wrapper {
cursor: pointer; cursor: pointer;
letter-spacing: 0.2px; letter-spacing: 0.2px;
} }
/******NS***********/
/*******************/
.cover-wrapper{ .cover-wrapper{
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -1689,7 +1794,7 @@ aside.news-wrapper { ...@@ -1689,7 +1794,7 @@ aside.news-wrapper {
.right-container .right-panel{ .right-container .right-panel{
position: absolute; position: absolute;
right: 0; right: 0;
padding: 0px 17px; padding: 0px 15px;
padding-bottom: 100px; padding-bottom: 100px;
} }
.panel section > h2{ .panel section > h2{
......
...@@ -157,9 +157,11 @@ $(function(){ ...@@ -157,9 +157,11 @@ $(function(){
$this.addClass('active'); $this.addClass('active');
$('.filter-bloc .bloc-content').slideUp('slow'); $('.filter-bloc .bloc-content').slideUp('slow');
$this.find('.bloc-content').slideDown('slow'); $this.find('.bloc-content').slideDown('slow');
$('.commercial').slideUp('slow');
}else{ }else{
$this.removeClass('active'); $this.removeClass('active');
$this.find('.bloc-content').slideUp('slow'); $this.find('.bloc-content').slideUp('slow');
//$('.commercial').slideDown('slow');
} }
}).on('click','.filter-bloc li:not(.disabled,.reinit)',function(e){ }).on('click','.filter-bloc li:not(.disabled,.reinit)',function(e){
......
jQuery( document ).ready( function() { jQuery(document).ready(function() {
jQuery( document ).on('click',".download_file", function() { jQuery(document).on('click', ".download_file", function() {
var id ; var id;
var download_link = jQuery( '.download_file_link' ).attr('href'); var download_link = jQuery('.download_file_link').attr('href');
var current_var = jQuery( '.download_file_link' ).attr('id'); var current_var = jQuery('.download_file_link').attr('id');
var variation_id = jQuery( 'input[name="variation_id"]' ).val(); var variation_id = jQuery('input[name="variation_id"]').val();
if(variation_id == 0) if (variation_id == 0)
id = current_var; id = current_var;
else else
id = variation_id; id = variation_id;
var link = download_link+'?variation_id='+id; var link = download_link + 'variation_id=' + id;
window.open(link, '_blank'); window.open(link, '_blank');
return false; return false;
...@@ -19,26 +19,66 @@ jQuery( document ).ready( function() { ...@@ -19,26 +19,66 @@ jQuery( document ).ready( function() {
jQuery(document ).on('change','.color-list input,.format-list input ', function() { jQuery(document).on('change', '.color-list input,.format-list input ', function() {
var varID = jQuery( 'input[name="variation_id"]' ).val(); var varID = jQuery('input[name="variation_id"]').val();
if(varID != 0 ){ if (varID != 0) {
var price = jQuery('.woocommerce-variation-price .woocommerce-Price-amount').text(); var price = jQuery('.woocommerce-variation-price .woocommerce-Price-amount').text();
var pq = jQuery('.woocommerce-variation-description').text(); var pq = jQuery('.woocommerce-variation-description').text();
jQuery('.price .crete').text(price); jQuery('.price .crete').text(price);
jQuery('.pq').text(pq); jQuery('.pq').text(pq);
} }
var name= jQuery(this).attr('name'); var name = jQuery(this).attr('name');
if (jQuery(this).is(':checked') && name =='attribute_pa_couleur'){ if (jQuery(this).is(':checked') && name == 'attribute_pa_couleur') {
jQuery('.info-color').text(jQuery(this).attr('value')); jQuery('.info-color').text(jQuery(this).attr('value'));
} }
if (jQuery(this).is(':checked') && name =='attribute_pa_format'){ if (jQuery(this).is(':checked') && name == 'attribute_pa_format') {
jQuery('.info-format').text(jQuery(this).attr('value')); jQuery('.info-format').text(jQuery(this).attr('value'));
jQuery('.info-format-txt').text(jQuery(this).attr('value')); jQuery('.info-format-txt').text(jQuery(this).attr('value'));
} }
}); });
jQuery("#search-btn").on('click', function() {
jQuery('article').show();
jQuery('.list-animation section').show();
jQuery('article').removeClass('in_search');
//filtre couleur
var tabcolor = [];
i = 0;
jQuery(".list-color-filter .selected").each(function() {
tabcolor[i++] = jQuery(this).attr('data-color');
});
//console.log(tabcolor);
jQuery(".product-list article li").each(function() {
var product_color = jQuery(this).attr('data-color');
if (jQuery.inArray(product_color, tabcolor) >= 0) {
jQuery(this).closest('article').addClass('in_search');
}
});
if (tabcolor.length > 0)
{
jQuery('article:not(.in_search)').hide();
jQuery('.list-animation section').each(function() {
if (jQuery(this).find('article.in_search').length == 0) {
jQuery(this).hide();
}
});
}
});
}); });
\ No newline at end of file
...@@ -47,12 +47,16 @@ $(function(){ ...@@ -47,12 +47,16 @@ $(function(){
} }
}) })
} }
$.fn.selectFormat = function(){ $.fn.selectFormat = function(){
$(this).on('click',function(){ $(this).on('click',function(){
var actifImage = $(this).find('img').data('img-active'), var actifImage = $(this).find('img').data('img-active'),
initialImage = $(this).find('img').data('img'); initialImage = $(this).find('img').data('img');
$(this).parent().parent().find('li').each(function(){ $(this).parent().parent().find('li').each(function(){
img = $(this).find('img'); img = $(this).find('img');
img.attr('src',img.data('img')); img.attr('src',img.data('img'));
}) })
$(this).parent().parent().find('li').removeClass('selected'); $(this).parent().parent().find('li').removeClass('selected');
...@@ -88,11 +92,13 @@ $(function(){ ...@@ -88,11 +92,13 @@ $(function(){
tl = new TimelineMax() tl = new TimelineMax()
tl.staggerFromTo('.slides-wrapper .gallery article',0.3,{opacity:0,y:100},{opacity:1,y:0},0.1,0); tl.staggerFromTo('.slides-wrapper .gallery article',0.3,{opacity:0,y:100},{opacity:1,y:0},0.1,0);
tl.fromTo('.gallery',0.5,{opacity:0,visibility:"hidden"},{opacity:1,visibility:"visible"},0); tl.fromTo('.gallery',0.5,{opacity:0,visibility:"hidden"},{opacity:1,visibility:"visible"},0);
tl.fromTo('.nav-slider',0.1,{opacity:1},{opacity:0},0);
tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0); tl.fromTo('#slides',0.5,{opacity:1},{opacity:0},0);
tl.fromTo('.nav-slider',0.5,{opacity:1},{opacity:0},0);
}); });
$('.gallery').on('click','.close-btn,article',function(){ $('.gallery').on('click','.close-btn,article',function(){
tl.reverse(); $('.gallery').fadeTo( "slow", 0).css('visibility','hidden');
$('#slides,.nav-slider').fadeTo( "slow", 1);
}) })
} }
$.fn.showRightPanelAnimation = function(removeClass,addClass){ $.fn.showRightPanelAnimation = function(removeClass,addClass){
...@@ -119,16 +125,23 @@ $(function(){ ...@@ -119,16 +125,23 @@ $(function(){
}) })
} }
$.fn.productAnimation = function(){ $.fn.productAnimation = function(){
//first format Actif
var activeImg = $('.format-label #format_0').data('img-active');
$('.format-label #format_0').attr('src',activeImg);
tlProduct = new TimelineMax(); tlProduct = new TimelineMax();
tlProduct.fromTo('.product-images',1,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},0); tlProduct.fromTo('.product-images',0.2,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},0);
tlProduct.staggerFromTo('.product-details .list',0.7,{opacity:0, marginLeft:"-10%"},{opacity:1, marginLeft:"0"},0.4,0.5); tlProduct.staggerFromTo('.product-details .list',0.2,{opacity:0, marginLeft:"-10%"},{opacity:1, marginLeft:"0"},0.4,0.5);
tlProduct.fromTo('.product-info',1,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},1.2); tlProduct.fromTo('.product-info',0.2,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},1.2);
} }
$('.product-list article img, .product-list article ul li').on('click', function() { $('.product-list article img, .product-list article ul li').on('click', function() {
$('head').append($('.header-shop')); $('head').append($('.header-shop'));
var toLink = $(this).data('link'); var toLink = $(this).data('link');
$('.load-page').parent().addClass('active'); $('.load-page').parent().addClass('active');
$('.load-page').load(toLink,function(){ $('.load-page').load(toLink,function(){
//alert('here');
sizeProductDetails = $('.product-details .list').length; sizeProductDetails = $('.product-details .list').length;
if (sizeProductDetails < 2) { if (sizeProductDetails < 2) {
$('.product-info').outerWidth('78.3%'); $('.product-info').outerWidth('78.3%');
...@@ -151,7 +164,7 @@ $(function(){ ...@@ -151,7 +164,7 @@ $(function(){
$('.pa_couleur li').selectColor(); $('.pa_couleur li').selectColor();
$('.pa_format li').selectFormat(); $('.pa_format li').selectFormat();
$('.color-list.selected').selectSlide($('#slides')); $('.color-list.selected').selectSlide($('#slides'));
},500) },100)
$('.download-btn:not(.download_file)').click(function(e){ $('.download-btn:not(.download_file)').click(function(e){
e.stopPropagation(); e.stopPropagation();
}); });
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Template Name: Fiche technique * Template Name: Fiche technique
* *
*/ */
$nfiles = glob("devis/[!\\.]*"); $nfiles = glob("fiches-techniques/[!\\.]*");
if ($nfiles !== FALSE) { if ($nfiles !== FALSE) {
...@@ -15,26 +15,41 @@ if ($nfiles !== FALSE) { ...@@ -15,26 +15,41 @@ if ($nfiles !== FALSE) {
} }
$fiche_num = str_pad($nb_fiche, 6, "0", STR_PAD_LEFT); $fiche_num = str_pad($nb_fiche, 6, "0", STR_PAD_LEFT);
$product_id = $_GET['product_id'];
$variation_id = $_GET['variation_id']; $variation_id = $_GET['variation_id'];
$code_variation = nap_load_variation_settings_fields($variation_id); $file_title = "";
$fiche_id = $code_variation['var_fiche']; $product_cats = wp_get_post_terms($product_id, 'product_cat');
$file_title.=$product_cats[1]->name;
//fiche variable
if($variation_id !='undefined'){
$code_variation = nap_load_variation_settings_fields($variation_id);
$fiche_id = $code_variation['var_fiche'];
$sku = nap_variable_meta($variation_id, 'sku');
$gencod = $code_variation['var_gencod'];
$itf14 = $code_variation['var_itf14'] ;
$variable_product = wc_get_product($variation_id);
$thumb_image = get_the_post_thumbnail($variation_id, 'medium');
$file_title.="<br/>" . $variable_product->get_attribute('format') . " " . get_the_title($product_id);
$color="<span class='variation_color'><strong><em>Couleur </em>: " . $variable_product->get_attribute('couleur') . "</strong></span>";
}
$variable_product = wc_get_product($variation_id); //fiche simple
$product_title = $variable_product->get_title(); else {
$product_infos = get_page_by_title($product_title, OBJECT, 'product');
// titre = Catégorie + sous catégorie + format + tag $fiche_id = get_post_meta($product_id, '_fiche_simple', true);
$file_title = ""; $sku = get_post_meta($product_id, '_sku',true);
$product_cats = array_reverse(wp_get_post_terms($product_infos->ID, 'product_cat')); $gencod = get_post_meta($product_id, '_gencod_simple', true);
$itf14 = get_post_meta($product_id,'_itf14_simple', true);
$thumb_image = get_the_post_thumbnail($product_id, 'medium');
$file_title.=$product_cats[1]->name; $file_title.="<br/>" . get_the_title($product_id);
}
$product = wc_get_product($product_infos->ID);
$tags = $product->get_tag_ids();
$file_title.="<br/>" . $variable_product->get_attribute('format') . " " . get_tag($tags[0])->name;
$icones = ""; $icones = "";
if (get_field('fiche_icones', $fiche_id)): if (get_field('fiche_icones', $fiche_id)):
...@@ -45,7 +60,7 @@ if (get_field('fiche_icones', $fiche_id)): ...@@ -45,7 +60,7 @@ if (get_field('fiche_icones', $fiche_id)):
endwhile; endwhile;
endif; endif;
echo $file_content = "<html> $file_content = "<html>
<head><title>" . $file_title . "</title> <head><title>" . $file_title . "</title>
<style> <style>
.html,body { .html,body {
...@@ -106,10 +121,9 @@ echo $file_content = "<html> ...@@ -106,10 +121,9 @@ echo $file_content = "<html>
.thumb_var img { .thumb_var img {
max-width: 400px !important;
max-height: 400px !important;
padding-right: 100px; padding-right: 100px;
float: right;
} }
.gallery-item { .gallery-item {
...@@ -157,21 +171,21 @@ echo $file_content = "<html> ...@@ -157,21 +171,21 @@ echo $file_content = "<html>
</head> </head>
<body><div class='file_content'> <body><div class='file_content'>
<div class='file_header'> <div class='file_header'>
<div class='half_width thumb_var'> <div class='half_width thumb_var' style='text-align:center'>
" . $thumb_image = get_the_post_thumbnail($variation_id, 'shop_catalog') . " " . $thumb_image. "
</div> </div>
<div class='half_width'> <div class='half_width' style='margin-left:20px;'>
<h1>" . $file_title . "</h1> <h1>" . $file_title . "</h1>
<span class='variation_color'><strong><em>Couleur </em>: " . $variable_product->get_attribute('couleur') . "</strong></span> ".$color."
" . nap_get_content($fiche_id) . " " . nap_get_content($fiche_id) . "
<div>" . $icones . "</div> <div>" . $icones . "</div>
</div> </div>
</div> </div>
<div class='bleu_zone'> <div class='bleu_zone'>
<div class='half_width' style='position:relative; padding-left:30px'> <div class='half_width' style='position:relative; padding-left:30px'>
<p>Code article : " . $code_variation['var_code'] . "</p> <p>Code article : " . $sku . "</p>
<p>Gencod : " . $code_variation['var_gencod'] . "</p> <p>Gencod : " . $gencod. "</p>
<p>ITF 14 : " . $code_variation['var_itf14'] . "</p> <p>ITF 14 : " . $itf14 . "</p>
</div> </div>
...@@ -193,8 +207,10 @@ echo $file_content = "<html> ...@@ -193,8 +207,10 @@ echo $file_content = "<html>
<th>L (cm)</th> <th>L (cm)</th>
<th>l (cm)</th> <th>l (cm)</th>
<th>H (cm)</th> <th>H (cm)</th>
<th>Ø (cm)</th>
<th>Épaisseur (cm)</th> <th>Épaisseur (cm)</th>
<th>Capacité (cm)</th> <th>Capacité (cm)</th>
<th>Taille</th>
<th>Poids (g)</th> <th>Poids (g)</th>
</tr> </tr>
</thead> </thead>
...@@ -203,8 +219,10 @@ echo $file_content = "<html> ...@@ -203,8 +219,10 @@ echo $file_content = "<html>
<td>" . get_field('ft_unite_L1', $fiche_id) . "</td> <td>" . get_field('ft_unite_L1', $fiche_id) . "</td>
<td>" . get_field('ft_unite_l2', $fiche_id) . "</td> <td>" . get_field('ft_unite_l2', $fiche_id) . "</td>
<td>" . get_field('ft_unite_H', $fiche_id) . "</td> <td>" . get_field('ft_unite_H', $fiche_id) . "</td>
<td>" . get_field('ft_unite_diametre', $fiche_id) . "</td>
<td>" . get_field('ft_unite_epaisseur', $fiche_id) . "</td> <td>" . get_field('ft_unite_epaisseur', $fiche_id) . "</td>
<td>" . get_field('ft_unite_capacite', $fiche_id) . "</td> <td>" . get_field('ft_unite_capacite', $fiche_id) . "</td>
<td>" . get_field('ft_unite_taille', $fiche_id) . "</td>
<td>" . get_field('ft_unite_poids', $fiche_id) . "</td> <td>" . get_field('ft_unite_poids', $fiche_id) . "</td>
</tr> </tr>
</tbody> </tbody>
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<nav class="row"> <nav class="row">
<div class="main-nav nav-wrapper animated slideInLeft"> <div class="main-nav nav-wrapper animated slideInLeft">
<div class="nav-header"> <div class="nav-header">
<a href="<?php echo get_home_url(); ?>" title="nap by CGMP"><h1 class="logo" style="background: url('<?php echo home_url('wp-content/themes/nap/assets/css/img/naplogo.svg')?>')">nap by CGMP</h1></a> <a href="<?php echo get_home_url(); ?>" title="nap by CGMP"><h1 class="logo" >nap by CGMP</h1></a>
</div> </div>
<?php get_template_part( 'nav-list' );?> <?php get_template_part( 'nav-list' );?>
</div> </div>
......
...@@ -20,11 +20,12 @@ if (!defined('ABSPATH')) { ...@@ -20,11 +20,12 @@ if (!defined('ABSPATH')) {
} }
$current_page = 'catalogue'; $current_page = 'catalogue';
get_header(); get_header();
$product;
$cate = get_queried_object(); $cate = get_queried_object();
$cateID = $cate->term_id; $cateID = $cate->term_id;
//SubCats //SubCats
$child_category = get_terms('product_cat', array('parent'=>$cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'id', 'order' => 'ASC')); $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'id', 'order' => 'ASC'));
?> ?>
<div class="container clearfix" id="catalogue" data-page = "<?php echo $cateID; ?>"> <div class="container clearfix" id="catalogue" data-page = "<?php echo $cateID; ?>">
...@@ -42,71 +43,55 @@ $child_category = get_terms('product_cat', array('parent'=>$cateID, 'child_of' = ...@@ -42,71 +43,55 @@ $child_category = get_terms('product_cat', array('parent'=>$cateID, 'child_of' =
<span>Filtres</span> <span>Filtres</span>
<span class="close-btn"></span> <span class="close-btn"></span>
</div> </div>
<?php
$attributes = array('Univers' => 'pa_univers', 'Matiére' => 'pa_matiere', 'Format' => 'pa_format', 'Couleurs' => 'pa_couleur');
foreach ($attributes as $key => $value) :
?>
<div class="filter-bloc"> <div class="filter-bloc">
<div class="header"> <div class="header">
<p><span>Univers</span></p> <p><span><?php echo $key ?></span></p>
</div> </div>
<div class="bloc-content"> <?php
<ul> $terms = get_terms($value);
<li>Nouveautés</li>
<li>Noël</li>
<li class = "disabled">Printemps</li>
</ul>
</div>
</div> if (!empty($terms) && !is_wp_error($terms)):
<div class="filter-bloc"> ?>
<div class="header">
<p><span>Matiére</span></p>
</div>
<div class="bloc-content">
<ul>
<li>Nouveautés</li>
<li>Noël</li>
<li class = "disabled">Printemps</li>
</ul>
</div>
</div>
<div class="filter-bloc">
<div class="header">
<p><span>Format</span></p>
</div>
<div class="bloc-content">
<ul>
<li>Nouveautés</li>
<li>Noël</li>
<li class = "disabled">Printemps</li>
</ul>
</div>
</div>
<div class="filter-bloc">
<div class="header">
<p><span>Couleurs</span></p>
</div>
<div class="bloc-content"> <div class="bloc-content">
<ul class = "list-color-filter clearfix"> <ul <?php if ($value == 'pa_couleur') echo 'class = "list-color-filter clearfix"'; ?>>
<li data-color = "#7A3853"></li> <?php
<li data-color = "#fff"></li> foreach ($terms as $term) :
<li data-color = "#7A3853"></li> if ($value == 'pa_couleur'):
<li data-color = "#E8A380"></li> $color = get_field('couleurs', 'pa_couleur_' . $term->term_id);
<li data-color = "#fff"></li>
<li data-color = "#7A3853"></li> if (isset($color) && strlen($color) > 0):
<li data-color = "#E8A380"></li> ?>
<li data-color = "#fff"></li> <li data-color = "<?php echo $color; ?>" class="<?php echo $term->name; ?>"></li>
<li data-color = "#7A3853"></li> <?php
<li data-color = "#7A3853"></li> endif;
<li data-color = "#fff"></li> else :
<li data-color = "#7A3853"></li> ?>
<li data-color = "#E8A380"></li> <li><?php echo $term->name; ?></li>
<li data-color = "#fff"></li> <?php
<li data-color = "#7A3853"></li> endif;
endforeach;
if ($value == 'pa_couleur'):
?>
<li class="reinit">Tout déselectionner</li> <li class="reinit">Tout déselectionner</li>
<?php endif; ?>
</ul> </ul>
</div> </div>
<?php endif; ?>
</div> </div>
<?php endforeach; ?>
<div class="center filter-btn-list"> <div class="center filter-btn-list">
<div class="btn pink-btn rounded">Rechercher</div> <div class="btn pink-btn rounded" id="search-btn">Rechercher</div>
<span class = "reinit-all">Effacer les filtres</span> <span class = "reinit-all">Effacer les filtres</span>
</div> </div>
</div> </div>
...@@ -136,9 +121,9 @@ $child_category = get_terms('product_cat', array('parent'=>$cateID, 'child_of' = ...@@ -136,9 +121,9 @@ $child_category = get_terms('product_cat', array('parent'=>$cateID, 'child_of' =
while ($naps_posts->have_posts()) : $naps_posts->the_post(); while ($naps_posts->have_posts()) : $naps_posts->the_post();
$id = get_the_ID(); $id = get_the_ID();
$options['size'] = (get_field('produit_affichage',$id ))? get_field('produit_affichage',$id ):'small'; $options['size'] = (get_field('produit_affichage', $id)) ? get_field('produit_affichage', $id) : 'small';
$args = array( $args = array(
'post_type' => 'product_variation', 'post_type' => array('product', 'product_variation'),
'post_status' => array('private', 'publish'), 'post_status' => array('private', 'publish'),
'numberposts' => -1, 'numberposts' => -1,
'orderby' => 'menu_order', 'orderby' => 'menu_order',
......
...@@ -24,13 +24,15 @@ global $product; ...@@ -24,13 +24,15 @@ global $product;
$attribute_keys = array_keys($attributes); $attribute_keys = array_keys($attributes);
$product_cats = array_reverse(wp_get_post_terms($product->get_id(), 'product_cat')); $product_cats = wp_get_post_terms($product->get_id(), 'product_cat');
$subcat_iD = $product_cats[1]->term_id; $subcat_iD = $product_cats[1]->term_id;
$current_variationID = $_GET['variation_id']; $current_variationID = $_GET['variation_id'];
if (!function_exists('print_attribute_radio')) { if (!function_exists('print_attribute_radio')) {
function print_attribute_radio($checked_value, $value, $label, $name) { function print_attribute_radio($checked_value, $value, $label, $name, $index=0) {
$current_color = $_GET['attribute_couleur']; $current_color = $_GET['attribute_couleur'];
$selected = $default_checked = ""; $selected = $default_checked = "";
if ($value == strtolower($current_color)){ if ($value == strtolower($current_color)){
...@@ -53,10 +55,14 @@ if (!function_exists('print_attribute_radio')) { ...@@ -53,10 +55,14 @@ if (!function_exists('print_attribute_radio')) {
<input data-color="' . $hexa . '" type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s ' . $default_checked . '></li>', $input_name, $esc_value, $id, $checked, $filtered_label); <input data-color="' . $hexa . '" type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s ' . $default_checked . '></li>', $input_name, $esc_value, $id, $checked, $filtered_label);
} else { } else {
$icons = nap_icon_format($value); $icons = nap_icon_format($value);
$format_img='<img src="'.$icons['inactive'].'" data-img = "'.$icons['inactive'].'" data-img-active = "'.$icons['active'].'" id="format_'.$index.'">';
$filtered_label = apply_filters('woocommerce_variation_option_name', $label); $filtered_label = apply_filters('woocommerce_variation_option_name', $label);
printf('<li class="format-list"><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s> printf('<li class="format-list selected"><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s>
<label class="format-label" for="%3$s"><img src="'.$icons['inactive'].'" data-img = "'.$icons['inactive'].'" data-img-active = "'.$icons['active'].'"></label> <label class="format-label" for="%3$s">'.$format_img.'</label>
<div class="format-desc">'.$value.'</span> <div class="format-desc">'.$value.'</span>
</li>', $input_name, $esc_value, $id, $checked, $filtered_label); //<label class="format-label" style="background:url(' . $icons['inactive'] . ')" for="%3$s"></label> </li>', $input_name, $esc_value, $id, $checked, $filtered_label); //<label class="format-label" style="background:url(' . $icons['inactive'] . ')" for="%3$s"></label>
} }
...@@ -75,7 +81,7 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -75,7 +81,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div class="product-slides row"> <div class="product-slides row">
<div class="product-header"> <div class="product-header">
<h2 class="crete -italic font-small"><?php echo $product_cats[1]->name ?></h2> <h2 class="crete -italic font-small"><?php echo $product_cats[1]->name ?></h2>
<h3 class="crete"><?php the_title(); ?></h3> <h3 class="crete"><?php the_title();?></h3>
</div> </div>
<div class="slides-wrapper center"> <div class="slides-wrapper center">
<div class="row"> <div class="row">
...@@ -137,7 +143,7 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -137,7 +143,7 @@ do_action('woocommerce_before_add_to_cart_form');
</article> </article>
<?php <?php
endforeach; endforeach;
if(!empty($ambiance)):
foreach ($ambiance as $key => $value) : foreach ($ambiance as $key => $value) :
$attachment = wp_get_attachment_image_src($value, 'medium'); $attachment = wp_get_attachment_image_src($value, 'medium');
$hd = wp_get_attachment_image_src($value, 'full'); $hd = wp_get_attachment_image_src($value, 'full');
...@@ -149,7 +155,10 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -149,7 +155,10 @@ do_action('woocommerce_before_add_to_cart_form');
<img src="<?php echo $attachment[0]; ?>" alt="" title=""> <img src="<?php echo $attachment[0]; ?>" alt="" title="">
</figure> </figure>
</article> </article>
<?php endforeach; ?> <?php
endforeach;
endif;
?>
</div> </div>
...@@ -175,7 +184,7 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -175,7 +184,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div class="list row <?php echo $name;?> left border-l center"> <div class="list row <?php echo $name;?> left border-l center">
<div class="product-header center font-small label"> <div class="product-header center font-small label">
<label for="<?php echo sanitize_title($name); ?>" class = "chevron bottom">Choix <?php if($i==0) echo 'de la '; else echo 'du '; ?><?php echo wc_attribute_label($name); ?></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>
</div> </div>
<?php <?php
$sanitized_name = sanitize_title($name); $sanitized_name = sanitize_title($name);
...@@ -194,15 +203,17 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -194,15 +203,17 @@ do_action('woocommerce_before_add_to_cart_form');
// Get terms if this is a taxonomy - ordered. We need the names too. // Get terms if this is a taxonomy - ordered. We need the names too.
$terms = wc_get_product_terms($product->get_id(), $name, array('fields' => 'all')); $terms = wc_get_product_terms($product->get_id(), $name, array('fields' => 'all'));
foreach ($terms as $term) { foreach ($terms as $key=>$term) {
if (!in_array($term->slug, $options)) { if (!in_array($term->slug, $options)) {
continue; continue;
} }
print_attribute_radio($checked_value, $term->slug, $term->name, $sanitized_name); print_attribute_radio($checked_value, $term->slug, $term->name, $sanitized_name,$key);
} }
} else { } else {
foreach ($options as $option) { foreach ($options as $option) {
print_attribute_radio($checked_value, $option, $option, $sanitized_name); print_attribute_radio($checked_value, $option, $option, $sanitized_name);
} }
} }
} }
...@@ -230,49 +241,12 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -230,49 +241,12 @@ do_action('woocommerce_before_add_to_cart_form');
<?php do_action('woocommerce_after_variations_form'); ?> <?php do_action('woocommerce_after_variations_form'); ?>
<!--<div class="list row list-color left border-l">
<div class="product-header center font-small">
<span class = "chevron bottom">Choix de la couleur</span>
</div>
<ul>
<?php
foreach ($var_colors as $key => $value) :
$variable_product = wc_get_product($key);
?>
<li class = "" data-name='<?php echo $variable_product->get_attribute('couleur'); ?>'><span data-color="<?php echo $value; ?>"></span></li>
<?php endforeach; ?>
</ul>
</div>
<div class="list row pa_format left border-l">
<div class="product-header center font-small">
<span class = "chevron bottom">Choix du format</span>
</div>
<ul>
<?php
$formats_tab = nap_distinct_format_variations($variations);
foreach ($formats_tab as $key => $value) :
$icons = nap_icon_format($key);
$term = get_term_by('name', $value, 'pa_format');
// print_r($term);
?>
<li class ="" data-format='<?php echo $term->slug; ?>'>
<img src="<?php echo $icons['inactive'] ?>" data-img = "<?php echo $icons['inactive'] ?>" data-img-active = '<?php echo $icons['active'] ?>'>
<div class="format-desc"><?php echo $value ?></div>
</li>
<?php endforeach; ?>
</ul>
</div>-->
</form> </form>
<div class="product-info row center left border-l"> <div class="product-info row center left border-l">
<div class="info-content"> <div class="info-content">
<h2 class = "crete -italic font-small" ><?php echo $product_cats[1]->name ?></h2> <h2 class = "crete font-small" ><?php echo $product_cats[1]->name ?></h2>
<h3 class = "crete -italic font-small info-attr" ><span class="info-format"><?php echo $_GET['attribute_format']?></span> <span class="info-color"><?php echo$_GET['attribute_couleur'] ?></span></h3> <h3 class = "crete font-small info-attr" ><span class="info-format"><?php echo $_GET['attribute_format']?></span> <span class="info-color"><?php echo$_GET['attribute_couleur'] ?></span></h3>
<div class="details font-small"> <div class="details font-small">
<p class="info-format-txt"><?php echo $_GET['attribute_format']?></p> <p class="info-format-txt"><?php echo $_GET['attribute_format']?></p>
<p class="pq"><?php echo nap_variable_meta($current_variationID, 'variation_description'); ?></p> <p class="pq"><?php echo nap_variable_meta($current_variationID, 'variation_description'); ?></p>
...@@ -302,7 +276,7 @@ do_action('woocommerce_before_add_to_cart_form'); ...@@ -302,7 +276,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div class = "btn-list"> <div class = "btn-list">
<a href="<?php echo get_permalink(157); ?>" class="btn pink-btn rounded">Nous contacter</a> <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">Télécharger la fiche technique </a>
<a href="<?php echo get_permalink(43); ?>" class="hidden download_file_link" id="<?php echo $current_variationID ?>"></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> </div>
<div class="font-small circle-btn add-icon show-product"><span class= "abs-center">Produits associées</span></div> <div class="font-small circle-btn add-icon show-product"><span class= "abs-center">Produits associées</span></div>
</div> </div>
......
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