Commit 9a817afa authored by imac's avatar imac

[Bugfix]Redmine #682 : Product page -> Bug selector

parent 1fed62e2
......@@ -1345,13 +1345,13 @@ aside.news-wrapper {
display: block;
position: relative;
cursor: pointer;
padding-right: 17px;
}
.list li input{
cursor: pointer;
}
.pa_couleur li{
margin-bottom: 21px;
margin-right: 17px;
}
.pa_couleur li.selected >span:first-child,
.pa_couleur li.selected >span:first-child{
......@@ -1443,8 +1443,9 @@ label.chevron.bottom::first-letter {
.pa_format li .format-desc{
font-size: 9px;
line-height: 12px;
margin-top: 4px;
padding: 0 2px;
margin: 4px auto 8px;
width: 75%;
}
.product-info{
width: 56.5%;
......@@ -1453,6 +1454,7 @@ label.chevron.bottom::first-letter {
height: 100%;
opacity: 0;
overflow: auto;
overflow-x: hidden;
}
.product-info .info-content{
text-align: center;
......
......@@ -104,10 +104,18 @@ $(function(){
})
}
$.fn.checkIfFormatDisabled = function(){
var format = getUrlParameter('attribute_format');
var activeImg = $('.format-label #'+format).data('img-active');
$('.format-label #'+format).attr('src',activeImg);
$('.format-list').each(function() {
var icons = [];
//var format = getUrlParameter('pa_format');
//var taille = getUrlParameter('pa_taille');
// iconEnable = format ? format : taille ;
icons.push(getUrlParameter('pa_format')) ;
icons.push(getUrlParameter('pa_taille')) ;
icons.push(getUrlParameter('pa_matiere')) ;
jQuery.map(icons, function(value,key){
console.log('key' + key + 'value = ' + value);
var activeImg = $('.format-label #'+value).data('img-active');
$('.format-label #'+value).attr('src',activeImg);
$('.format-list').each(function() {
if ($(this).find("input").is(':disabled')) {
$(this).addClass("disabled");
}
......@@ -115,6 +123,9 @@ $(function(){
$(this).removeClass("disabled");
}
});
})
/**/
}
$.fn.getDownloadCurrentSlideLink = function(){
var img_link = $(document).find('.slick-current a').attr('href');
......
......@@ -349,7 +349,17 @@ function nap_menu() {
}
function nap_variation_url($variationID) {
/****** MS ******/
$product = wc_get_product( $variationID);
$url = '?';
$product_attributes = ($product->get_attributes());
foreach ($product_attributes as $key => $p_attr) {
$url .= $key . '=' .$p_attr.'&';
}
$url .='variation_id=' . $variationID;
return preg_replace('/\s+/', '', $url);
/****** END MS ******/
/* OLD NS
$variable_product = wc_get_product($variationID);
$couleur = $variable_product->get_attribute('couleur');
......@@ -359,6 +369,7 @@ function nap_variation_url($variationID) {
$format_url = get_term_by('slug', $format, 'pa_format');
$url = '?attribute_couleur=' . $color_url->slug . '&attribute_format=' . $format_url->slug . '&variation_id=' . $variationID;
return preg_replace('/\s+/', '', $url);
END OLD NS */
}
function nap_variation_color($variationID) {
......@@ -790,3 +801,9 @@ function nap_show_associated_products() {
return $associated_products;
}
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 100;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );
......@@ -130,7 +130,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div class="info-content">
<?php $formats = explode(',', nap_variation_format($id)); ?>
<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['attribute_couleur'] ?></span></h3>
<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>
<div class="details font-small">
<p class="info-format-txt">
<?php echo $formats[0]; ?>
......
......@@ -36,7 +36,7 @@ if (!function_exists('print_attribute_radio')) {
function print_attribute_radio($checked_value, $value, $label, $name, $index=0) {
$current_color = $_GET['attribute_couleur'];
$current_color = $_GET['pa_couleur'];
$selected = $default_checked = "";
if ($value == strtolower($current_color)){
$default_checked = "checked";
......@@ -279,7 +279,7 @@ do_action('woocommerce_before_add_to_cart_form');
$format_info = get_term_by('slug', $format, 'pa_format');
$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['attribute_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 $format; ?></p>
<p class="pq"><?php echo nap_variable_meta($current_variationID, 'variation_description'); ?></p>
......
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