Commit 9a817afa authored by imac's avatar imac

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

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