Commit adc6a1ce authored by Nahla Shiri's avatar Nahla Shiri

format fiche décorée

parent 7706af58
......@@ -1703,7 +1703,7 @@ label.chevron.bottom::first-letter {
position: relative;
}
.phototheque-content .nav-phototeque{
padding: 40px;
padding: 40px 10px 40px 40px;
max-width: 465px;
width: 34%;
border-right: 1px solid rgba(26,26,26,0.2);
......@@ -1711,7 +1711,7 @@ label.chevron.bottom::first-letter {
height: 100%;
}
.phototheque-content .header h2{
padding-top: 26px;
padding-top: 25px;
margin-bottom: 22px;
}
.phototheque-content .header h2:after{
......
......@@ -27,13 +27,26 @@ function loadProductContent() {
$.fn.responsive();
$('.variations_form').on('reset_data', function()
{
$firstInput = $('.variations_form .format-list input:not(:disabled)').first();
$firstInput.prop('checked',true);
$firstInput.change();
console.log("reset data");
$attributes = $('.variations .list');
$attributes.each(function(i)
{
var $attr = $(this);
if (!$attr.hasClass('pa_couleur'))
{
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();
}
}
});
});
function onFoundVariation(a,b,c)
function onFoundVariation()
{
console.log(a,b,c,this);
console.log('found variation');
//$('.variations_form .format_list input').prop('checked',false);
$('.variations_form .color-list input:disabled').prop('disabled',false);
console.log('found', $('.variations_form .format-list input:checked + * + .format-desc'));
......@@ -302,6 +315,7 @@ $(function(){
$('.load-page').parent().addClass('active');
$('.load-page').load(toLink,{'ajax' : 1}, function(){
history.pushState(null, null, toLink);
jQuery('.variations_form').wc_variation_form();
loadProductContent();
$('html').css('overflow','hidden');
});
......
......@@ -39,14 +39,14 @@ if($variation_id !='undefined'){
//fiche simple
else {
$product = wc_get_product($product_id);
$fiche_id = get_post_meta($product_id, '_fiche_simple', true);
$sku = get_post_meta($product_id, '_sku',true);
$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.="<br/>" . get_the_title($product_id);
$file_title.="<br/>" .$product->get_attribute( 'pa_format' ).' '.get_the_title($product_id);
}
......
......@@ -25,6 +25,7 @@ function nap_enqueue_scripts() {
// Enqueue jQuery UI and autocomplete
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-autocomplete');
wp_enqueue_script( 'wc-add-to-cart-variation' );
}
add_action('wp_enqueue_scripts', 'nap_enqueue_scripts');
......
......@@ -168,7 +168,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
$options['size'] = (get_field('produit_affichage', $id)) ? get_field('produit_affichage', $id) : 'small';
$args = array(
'post_type' => array('product', 'product_variation'),
'post_status' => array('private', 'publish'),
'post_status' => array('publish'),
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'asc',
......@@ -178,18 +178,38 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
$attribute_value['pa_format'] = get_the_terms($id, 'pa_format');
$attribute_value['pa_matiere'] = get_the_terms($id, 'pa_matiere');
$attribute_value['pa_univers'] = get_the_terms($id, 'pa_univers');
//var_dump($attribute_value['pa_format']);
if (is_array($attribute_value['pa_format'])) {
$list_formats ='';
foreach ($attribute_value['pa_format'] as $key => $value) {
$list_formats .= $value->name.',';
}
$list_att['pa_format'] = explode(',',$list_formats);
}
/* print '*********************';
var_dump($list_att['pa_format']);*/
if ($_GET) {
if (is_array($attribute_value['pa_couleur'])) {
foreach ($attribute_value['pa_couleur'] as $key => $value) {
$list_att['pa_couleur'] = nap_color_attribute($value->slug);
}
}
if (is_array($attribute_value['pa_format'])) {
$list_formats ='';
foreach ($attribute_value['pa_format'] as $key => $value) {
$list_att['pa_format'] = $value->name;
$list_formats .= $value->name.',';
}
$list_att['pa_format'] = explode(',',$list_formats);
}
if (is_array($attribute_value['pa_matiere'])) {
foreach ($attribute_value['pa_matiere'] as $key => $value) {
$list_att['pa_matiere'] = $value->name;
......
......@@ -121,19 +121,19 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
</div>
</div>
<?php $formats = explode(',', nap_variation_format($id)); ?>
<div class="product-details full-height row right transition">
<div class="product-info row center right border-l">
<div class="inner-product-info">
<div class="info-content">
<?php $formats = explode(',', nap_variation_format($id)); ?>
<?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 $formats[0]; ?></span> <span class="info-color"><?php echo$_GET['pa_couleur'] ?></span></h3>
<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>
<div class="details font-small">
<p class="info-format-txt">
<?php echo $formats[0]; ?>
<?php echo $format; ?>
</p>
<p class="pq"><?php echo do_shortcode(get_the_excerpt()); ?></p>
</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