Commit 6c46b2a2 authored by Nahla Shiri's avatar Nahla Shiri

ne pas afficher des critères vide

parent 6204d4ad
...@@ -100,13 +100,27 @@ jQuery(document).ready(function() { ...@@ -100,13 +100,27 @@ jQuery(document).ready(function() {
*/ */
}); });
if(jQuery.urlParam('pa_format')!='' || jQuery.urlParam('pa_couleur')!='' || jQuery.urlParam('pa_matiere')!=''){
/*jQuery('.list-animation section').each(function() { jQuery('.list-animation section').each(function() {
if (jQuery(this).find('article.selected').length == 0) { if (jQuery(this).find('article.selected').length == 0) {
jQuery(this).hide(); jQuery(this).hide();
} }
});*/ });
}
jQuery('.filter-bloc ').each(function() {
if (jQuery(this).find('.bloc-content').length == 0) {
jQuery(this).hide();
}
});
}); });
jQuery.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
\ No newline at end of file
<?php <?php
@ini_set('upload_max_size', '64M'); @ini_set('upload_max_size', '64M');
@ini_set('post_max_size', '64M'); @ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300'); @ini_set('max_execution_time', '300');
...@@ -24,10 +23,11 @@ function get_zones($post_ID = 157) { ...@@ -24,10 +23,11 @@ function get_zones($post_ID = 157) {
function nap_enqueue_scripts() { function nap_enqueue_scripts() {
// Enqueue jQuery UI and autocomplete // Enqueue jQuery UI and autocomplete
wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script('jquery-ui-core');
wp_enqueue_script( 'jquery-ui-autocomplete' ); wp_enqueue_script('jquery-ui-autocomplete');
} }
add_action( 'wp_enqueue_scripts', 'nap_enqueue_scripts' );
add_action('wp_enqueue_scripts', 'nap_enqueue_scripts');
//Dequeue CSS //Dequeue CSS
function nap_dequeue_unnecessary_css() { function nap_dequeue_unnecessary_css() {
...@@ -186,50 +186,45 @@ function nap_variation_settings_fields($loop, $variation_data, $variation) { ...@@ -186,50 +186,45 @@ function nap_variation_settings_fields($loop, $variation_data, $variation) {
$option = nap_post_type_listing('fiche_technique'); $option = nap_post_type_listing('fiche_technique');
woocommerce_wp_text_input( woocommerce_wp_text_input(
array( array(
'id' => 'fiche_var_auto_'. $variation->ID, 'id' => 'fiche_var_auto_' . $variation->ID,
'name'=>'fiche_var_auto_'. $variation->ID, 'name' => 'fiche_var_auto_' . $variation->ID,
'value' => get_post_meta($variation->ID, 'fiche_var_auto', true), 'value' => get_post_meta($variation->ID, 'fiche_var_auto', true),
'label' => __( 'Fiche technique', 'woocommerce' ), 'label' => __('Fiche technique', 'woocommerce'),
) )
);?> );
?>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function(){ jQuery(document).ready(function() {
var posts = <?php echo json_encode( $option ); ?>; var posts = <?php echo json_encode($option); ?>;
var data = []; var data = [];
jQuery.each(posts, function( index, value ) { jQuery.each(posts, function(index, value) {
data.push({'label':value, 'value':index}); data.push({'label': value, 'value': index});
}); });
jQuery('input[name="fiche_var_auto_<?php echo $variation->ID?>"]').click(function() { jQuery('input[name="fiche_var_auto_<?php echo $variation->ID ?>"]').click(function() {
jQuery(this).val(''); jQuery(this).val('');
}); });
jQuery( 'input[name="fiche_var_auto_<?php echo $variation->ID?>"]' ).autocomplete({ jQuery('input[name="fiche_var_auto_<?php echo $variation->ID ?>"]').autocomplete({
source: data, source: data,
minLength: 1, minLength: 1,
select: function(event, ui) { select: function(event, ui) {
event.preventDefault(); event.preventDefault();
jQuery(this).val(ui.item.label); jQuery(this).val(ui.item.label);
jQuery("#_var_fiche_<?php echo $variation->ID?>").val(ui.item.value); jQuery("#_var_fiche_<?php echo $variation->ID ?>").val(ui.item.value);
} }
}); });
}); });
</script> </script>
<?php <?php
woocommerce_wp_hidden_input( woocommerce_wp_hidden_input(
array( array(
'id' => '_var_fiche_'. $variation->ID, 'id' => '_var_fiche_' . $variation->ID,
'label' => __( 'Fiche technique', 'woocommerce' ), 'label' => __('Fiche technique', 'woocommerce'),
'value' => get_post_meta($variation->ID, '_var_fiche', true), 'value' => get_post_meta($variation->ID, '_var_fiche', true),
'name'=>'_var_fiche_'. $variation->ID, 'name' => '_var_fiche_' . $variation->ID,
) )
); );
} }
// Save Variation Settings // Save Variation Settings
...@@ -249,18 +244,16 @@ function nap_save_variation_settings_fields($variation_id) { ...@@ -249,18 +244,16 @@ function nap_save_variation_settings_fields($variation_id) {
} }
// Select fiches techniques // Select fiches techniques
$var_fiche = $_POST['_var_fiche_'. $variation_id]; $var_fiche = $_POST['_var_fiche_' . $variation_id];
if (!empty($var_fiche)) { if (!empty($var_fiche)) {
update_post_meta($variation_id, '_var_fiche', esc_attr($var_fiche)); update_post_meta($variation_id, '_var_fiche', esc_attr($var_fiche));
} }
$select_fiche = $_POST['fiche_var_auto_'.$variation_id]; $select_fiche = $_POST['fiche_var_auto_' . $variation_id];
if( ! empty( $select_fiche ) ) { if (!empty($select_fiche)) {
update_post_meta( $variation_id, 'fiche_var_auto', esc_attr( $select_fiche ) ); update_post_meta($variation_id, 'fiche_var_auto', esc_attr($select_fiche));
} }
} }
function nap_load_variation_settings_fields($variations_id) { function nap_load_variation_settings_fields($variations_id) {
...@@ -366,31 +359,28 @@ function nap_variation_color($variationID) { ...@@ -366,31 +359,28 @@ function nap_variation_color($variationID) {
return $color; return $color;
} }
function nap_color_attribute($name) {
function nap_color_attribute($name){ $term = get_term_by('slug', $name, 'pa_couleur');
$term = get_term_by('slug',$name, 'pa_couleur');
$termID = $term->term_id; $termID = $term->term_id;
$color = get_field('couleurs', 'pa_couleur_' . $termID); $color = get_field('couleurs', 'pa_couleur_' . $termID);
return $color; return $color;
} }
function nap_icon_format($name){ function nap_icon_format($name) {
$icons = array(); $icons = array();
$term = get_term_by('slug',$name, 'pa_format'); $term = get_term_by('slug', $name, 'pa_format');
$termID = $term->term_id; $termID = $term->term_id;
$active = get_field('format_icone_active', 'pa_format_' . $termID); $active = get_field('format_icone_active', 'pa_format_' . $termID);
$inactive = get_field('format_icone_inactive', 'pa_format_' . $termID); $inactive = get_field('format_icone_inactive', 'pa_format_' . $termID);
$iconHeight = get_field('hauteur_icone', 'pa_format_' . $termID); $iconHeight = get_field('hauteur_icone', 'pa_format_' . $termID);
$iconWidth = get_field('largeur_icone', 'pa_format_' . $termID); $iconWidth = get_field('largeur_icone', 'pa_format_' . $termID);
$icons['active']=$active; $icons['active'] = $active;
$icons['inactive']=$inactive; $icons['inactive'] = $inactive;
$icons['height']= $iconHeight; $icons['height'] = $iconHeight;
$icons['width']= $iconWidth; $icons['width'] = $iconWidth;
return $icons; return $icons;
} }
function nap_distinct_color_variations($variations) { function nap_distinct_color_variations($variations) {
...@@ -405,11 +395,9 @@ function nap_distinct_color_variations($variations) { ...@@ -405,11 +395,9 @@ function nap_distinct_color_variations($variations) {
return $var_colors; return $var_colors;
} }
function nap_variation_format($variationID) { function nap_variation_format($variationID) {
$variable_product = wc_get_product($variationID); $variable_product = wc_get_product($variationID);
return $variable_product->get_attribute('format'); return $variable_product->get_attribute('format');
} }
function nap_distinct_format_variations($variations) { function nap_distinct_format_variations($variations) {
...@@ -427,16 +415,31 @@ function nap_distinct_format_variations($variations) { ...@@ -427,16 +415,31 @@ function nap_distinct_format_variations($variations) {
return $var_format; return $var_format;
} }
function nap_filter_attribute($postID, $search, $attribute, $color = false) {
if (isset($search) && $search != '') {
$tab_attr = get_the_terms($postID, $attribute);
/*function nap_image_resize($image,$size){ $filter = "hidden";
$ext = substr($image, strrpos($image, ".")); if (is_array($tab_attr)) {
$url = substr($image, 0, strrpos($image, ".")); foreach ($tab_attr as $key => $value) {
return $newimage = $url . "-".$size."x".$size. $ext; if ($color) {
}*/ $code = nap_color_attribute($value->slug);
if ($code != '' && stristr($search, $code)) {
$filter = "selected";
}
} else {
if (stristr($search, $value->name)) {
$filter = "selected";
}
}
}
}
}
return $filter;
}
function nap_get_item($post_ID, $args = null, $current_page = '', $options = null,$search = null) { function nap_get_item($post_ID, $args = null, $current_page = '', $options = null, $search = null) {
$link = $image = $size = ''; $link = $image = $size = '';
if (isset($options)) { if (isset($options)) {
if ($options['dwnldLink']) { if ($options['dwnldLink']) {
...@@ -452,38 +455,57 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul ...@@ -452,38 +455,57 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
} }
} }
if(isset($search['pa_couleur']) && $search['pa_couleur']!='' ){ if (isset($search['pa_couleur']) && $search['pa_couleur'] != '') {
$colors_value = get_the_terms( $post_ID, 'pa_couleur'); $colors_value = get_the_terms($post_ID, 'pa_couleur');
$filter = "hidden"; $filter = "hidden";
if(is_array($colors_value)){ if (is_array($colors_value)) {
foreach($colors_value as $key => $value) { foreach ($colors_value as $key => $value) {
$code = nap_color_attribute($value->slug); $code = nap_color_attribute($value->slug);
if($code!='' && stristr($search['pa_couleur'],$code )) { if ($code != '' && stristr($search['pa_couleur'], $code)) {
$filter = "selected"; $filter = "selected";
} }
} }
} }
}
/*$attributes = array('Univers' => 'pa_univers', 'Matiére' => 'pa_matiere', 'Format' => 'pa_format', 'Couleurs' => 'pa_couleur');
foreach ($attributes as $key => $value) :
if($value = 'pa_couleur' )
$filter= nap_filter_attribute($post_ID,$search[$value],$value,true);
else
$filter= nap_filter_attribute($post_ID,$search[$value],$value);
endforeach;*/
if (isset($search['pa_format']) && $search['pa_format'] != '') {
$format_value = get_the_terms($post_ID, 'pa_format');
$filter = "hidden";
if (is_array($format_value)) {
foreach ($format_value as $key => $value) {
if (stristr($search['pa_format'], $value->name)) {
$filter = "selected";
}
}
}
} }
if(isset($search['pa_format']) && $search['pa_format']!='' ){ if (isset($search['pa_matiere']) && $search['pa_matiere'] != '') {
$format_value = get_the_terms( $post_ID, 'pa_format'); $format_value = get_the_terms($post_ID, 'pa_matiere');
$filter = "hidden"; $filter = "hidden";
if(is_array($format_value)){ if (is_array($format_value)) {
foreach($format_value as $key => $value) { foreach ($format_value as $key => $value) {
if(stristr($search['pa_format'],$value->name )) { if (stristr($search['pa_matiere'], $value->name)) {
$filter = "selected"; $filter = "selected";
} }
} }
} }
} }
if(isset($filter)) $class = $filter; if (isset($filter))
$nap_article = '<article class = " visible row '.$class.'"> $class = $filter;
$nap_article = '<article class = " visible row ' . $class . '">
<a href="#"></a> <a href="#"></a>
<figure data-bg = "" class = "' . $size . ' transition"> <figure data-bg = "" class = "' . $size . ' transition">
<div class="abs-full article-bg transition"></div>'; <div class="abs-full article-bg transition"></div>';
...@@ -493,20 +515,18 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul ...@@ -493,20 +515,18 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
$nap_article .= '<ul class = "clearfix">'; $nap_article .= '<ul class = "clearfix">';
$variations = get_posts($args); $variations = get_posts($args);
$temp_colors = array(); $temp_colors = array();
if(!empty($variations)){ if (!empty($variations)) {
foreach ($variations as $key => $value) { foreach ($variations as $key => $value) {
$color = nap_variation_color($value->ID); $color = nap_variation_color($value->ID);
$format = nap_variation_format($value->ID); $format = nap_variation_format($value->ID);
if (!in_array($color, $temp_colors)) { if (!in_array($color, $temp_colors)) {
$temp_colors[] = $color; $temp_colors[] = $color;
$nap_article.='<li data-link = "' . get_permalink($post_ID) . nap_variation_url($value->ID) . '" data-image = "' . get_the_post_thumbnail_url($value->ID,'thumbnail') . '" data-color = "' . $color . '" data-format = "' . $format . '"></li> '; $nap_article.='<li data-link = "' . get_permalink($post_ID) . nap_variation_url($value->ID) . '" data-image = "' . get_the_post_thumbnail_url($value->ID, 'thumbnail') . '" data-color = "' . $color . '" data-format = "' . $format . '"></li> ';
} }
} }
} } else {
else $nap_article.='<li data-link = "' . get_permalink($post_ID) . '" data-image = "' . get_the_post_thumbnail_url($value->ID, 'thumbnail') . '" data-color = "' . get_post_thumbnail_id($post_ID) . '" data-format = ""></li> ';
{
$nap_article.='<li data-link = "' . get_permalink($post_ID). '" data-image = "' . get_the_post_thumbnail_url($value->ID,'thumbnail') . '" data-color = "' . get_post_thumbnail_id( $post_ID ) . '" data-format = ""></li> ';
} }
$nap_article.='</ul>'; $nap_article.='</ul>';
endif; endif;
...@@ -519,37 +539,33 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul ...@@ -519,37 +539,33 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
function nap_upload_image($img) {
function nap_upload_image($img){
return trim(strtolower($img)); return trim(strtolower($img));
} }
function nap_variable_meta($varID, $meta){ function nap_variable_meta($varID, $meta) {
return get_post_meta( $varID, '_'.$meta, true ); return get_post_meta($varID, '_' . $meta, true);
} }
add_action( 'wp_login_failed', 'my_front_end_login_fail' ); // hook failed login
function my_front_end_login_fail( $username ) { add_action('wp_login_failed', 'my_front_end_login_fail'); // hook failed login
function my_front_end_login_fail($username) {
$referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from? $referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from?
// if there's a valid referrer, and it's not the default log-in screen // if there's a valid referrer, and it's not the default log-in screen
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { if (!empty($referrer) && !strstr($referrer, 'wp-login') && !strstr($referrer, 'wp-admin')) {
wp_redirect( $referrer . '?login=failed' ); // let's append some information (login=failed) to the URL for the theme to use wp_redirect($referrer . '?login=failed'); // let's append some information (login=failed) to the URL for the theme to use
exit; exit;
} }
} }
add_action('woocommerce_product_options_general_product_data', 'nap_general_product_data_custom_field');
add_action( 'woocommerce_product_options_general_product_data', 'nap_general_product_data_custom_field' );
function nap_general_product_data_custom_field($post_id) { function nap_general_product_data_custom_field($post_id) {
woocommerce_wp_text_input( woocommerce_wp_text_input(
array( array(
'id' => '_gencod_simple', 'id' => '_gencod_simple',
'label' => __( 'Gencod(EAN13)', 'woocommerce' ), 'label' => __('Gencod(EAN13)', 'woocommerce'),
) )
); );
...@@ -557,8 +573,7 @@ function nap_general_product_data_custom_field($post_id) { ...@@ -557,8 +573,7 @@ function nap_general_product_data_custom_field($post_id) {
woocommerce_wp_text_input( woocommerce_wp_text_input(
array( array(
'id' => '_itf14_simple', 'id' => '_itf14_simple',
'label' => __( 'ITF 14', 'woocommerce' ), 'label' => __('ITF 14', 'woocommerce'),
) )
); );
...@@ -566,25 +581,24 @@ function nap_general_product_data_custom_field($post_id) { ...@@ -566,25 +581,24 @@ function nap_general_product_data_custom_field($post_id) {
woocommerce_wp_text_input( woocommerce_wp_text_input(
array( array(
'id' => 'fiche_simple_auto', 'id' => 'fiche_simple_auto',
'name'=>'fiche_simple_auto', 'name' => 'fiche_simple_auto',
'label' => __( 'Fiche technique', 'woocommerce' ), 'label' => __('Fiche technique', 'woocommerce'),
) )
);?> );
?>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function(){ jQuery(document).ready(function() {
var posts = <?php echo json_encode( $option ); ?>; var posts = <?php echo json_encode($option); ?>;
var data = []; var data = [];
jQuery.each(posts, function( index, value ) { jQuery.each(posts, function(index, value) {
data.push({'label':value, 'value':index}); data.push({'label': value, 'value': index});
}); });
jQuery('input[name="fiche_simple_auto"]').click(function() { jQuery('input[name="fiche_simple_auto"]').click(function() {
jQuery(this).val(''); jQuery(this).val('');
}); });
jQuery( 'input[name="fiche_simple_auto"]' ).autocomplete({ jQuery('input[name="fiche_simple_auto"]').autocomplete({
source: data, source: data,
minLength: 1, minLength: 1,
select: function(event, ui) { select: function(event, ui) {
...@@ -596,66 +610,65 @@ function nap_general_product_data_custom_field($post_id) { ...@@ -596,66 +610,65 @@ function nap_general_product_data_custom_field($post_id) {
}); });
</script> </script>
<?php <?php
woocommerce_wp_hidden_input( woocommerce_wp_hidden_input(
array( array(
'id' => '_fiche_simple', 'id' => '_fiche_simple',
'label' => __( 'Fiche technique', 'woocommerce' ), 'label' => __('Fiche technique', 'woocommerce'),
'name'=>'_fiche_simple', 'name' => '_fiche_simple',
) )
); );
} }
add_action( 'woocommerce_process_product_meta', 'nap_save_general_proddata_custom_field' ); add_action('woocommerce_process_product_meta', 'nap_save_general_proddata_custom_field');
function nap_save_general_proddata_custom_field( $post_id ) {
function nap_save_general_proddata_custom_field($post_id) {
$select_fiche = $_POST['fiche_simple_auto']; $select_fiche = $_POST['fiche_simple_auto'];
if( ! empty( $select_fiche ) ) { if (!empty($select_fiche)) {
update_post_meta( $post_id, 'fiche_simple_auto', esc_attr( $select_fiche ) ); update_post_meta($post_id, 'fiche_simple_auto', esc_attr($select_fiche));
} }
$id_fiche = $_POST['_fiche_simple']; $id_fiche = $_POST['_fiche_simple'];
if( ! empty( $id_fiche ) ) { if (!empty($id_fiche)) {
update_post_meta( $post_id, '_fiche_simple', esc_attr( $id_fiche ) ); update_post_meta($post_id, '_fiche_simple', esc_attr($id_fiche));
} }
$text_gencod = $_POST['_gencod_simple']; $text_gencod = $_POST['_gencod_simple'];
if( ! empty( $text_gencod ) ) { if (!empty($text_gencod)) {
update_post_meta( $post_id, '_gencod_simple', esc_attr( $text_gencod ) ); update_post_meta($post_id, '_gencod_simple', esc_attr($text_gencod));
} }
$text_itf14 = $_POST['_itf14_simple']; $text_itf14 = $_POST['_itf14_simple'];
if( ! empty( $text_itf14 ) ) { if (!empty($text_itf14)) {
update_post_meta( $post_id, '_itf14_simple', esc_attr( $text_itf14 ) ); update_post_meta($post_id, '_itf14_simple', esc_attr($text_itf14));
} }
} }
//MS 2017-08-02 : Get referrer //MS 2017-08-02 : Get referrer
function externe_referrer(){ function externe_referrer() {
$url = $_SERVER['HTTP_REFERER']; $url = $_SERVER['HTTP_REFERER'];
$postid = url_to_postid( $url ); $postid = url_to_postid($url);
$ref = false; $ref = false;
$uri = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0'; $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';
if($pageWasRefreshed || empty( $url) ) { if ($pageWasRefreshed || empty($url)) {
$ref = true; $ref = true;
} }
return $ref ; return $ref;
} }
function get_logged_user(){
if ( is_user_logged_in() ) { function get_logged_user() {
if (is_user_logged_in()) {
global $current_user; global $current_user;
get_currentuserinfo(); get_currentuserinfo();
echo $current_user->user_lastname .' '. $current_user->user_firstname; echo $current_user->user_lastname . ' ' . $current_user->user_firstname;
echo '<span class = "logout"><a href="'.wp_logout_url(get_permalink()).'">déconnexion</a></span>'; echo '<span class = "logout"><a href="' . wp_logout_url(get_permalink()) . '">déconnexion</a></span>';
} else { } else {
echo '<a class="login" href="#">accès pro</a>'; echo '<a class="login" href="#">accès pro</a>';
} }
} }
function nap_attribute_by_category($categorie, $attr){
function nap_attribute_by_category($categorie, $attr) {
$args = array( $args = array(
'post_type' => array('product', 'product_variation'), 'post_type' => array('product', 'product_variation'),
...@@ -668,26 +681,40 @@ function nap_attribute_by_category($categorie, $attr){ ...@@ -668,26 +681,40 @@ function nap_attribute_by_category($categorie, $attr){
'operator' => 'IN', 'operator' => 'IN',
) )
) )
); );
$products = get_posts($args); $products = get_posts($args);
$attribute=array(); $attribute = array();
foreach ($products as $key => $value) { foreach ($products as $key => $value) {
$list_attr= woocommerce_get_product_terms($value->ID, $attr, 'names'); $list_attr = woocommerce_get_product_terms($value->ID, $attr, 'names');
foreach($list_attr as $key => $value){ foreach ($list_attr as $key => $value) {
$attribute[] = $value; $attribute[] = $value;
} }
} }
return array_unique($attribute); return array_unique($attribute);
} }
add_image_size( 'wordpress-thumbnail', 200, 200, FALSE ); add_image_size('wordpress-thumbnail', 200, 200, FALSE);
function nap_selected_filter($search,$attribute){ function nap_selected_filter($search, $attribute) {
if(isset($search) && stristr($search,$attribute)) : if (isset($search) && stristr($search, $attribute)) :
$filter_class = 'selected'; $filter_class = 'selected';
else: else:
$filter_class = ''; $filter_class = '';
endif; endif;
return $filter_class; return $filter_class;
} }
add_action('trash_fiche_technique', 'nap_trash_fiche_technique', 1, 1);
function nap_trash_fiche_technique($post_id) {
$post = get_post($post_id);
global $wpdb;
$table = $wpdb->prefix . 'postmeta';
$wpdb->delete($table, array('meta_key' => '_fiche_simple', 'meta_value' => $post_id));
$wpdb->delete($table, array('meta_key' => '_var_fiche', 'meta_value' => $post_id));
$wpdb->delete($table, array('meta_key' => 'fiche_simple_auto', 'meta_value' => $post->post_title));
$wpdb->delete($table, array('meta_key' => 'fiche_var_auto', 'meta_value' => $post->post_title));
}
...@@ -125,7 +125,12 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' ...@@ -125,7 +125,12 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</div> </div>
<div class="right-panel right"> <div class="right-panel right">
<div class="panel panel-content list-animation"> <div class="panel panel-content list-animation">
<?php if($_GET['pa_couleur']!='' || $_GET['pa_format']!='' || $_GET['pa_matiere']!=''):?>
<span style =" position: relative; display: block;top: 80px;font-size: 11px;" class="search_result">Résultat de votre recherche :</span>
<?php endif;?>
<?php foreach ($child_category as $key => $value) : ?> <?php foreach ($child_category as $key => $value) : ?>
<section id = "cat<?php echo $value->term_id ?>"> <section id = "cat<?php echo $value->term_id ?>">
<h2 class="crete small-title"><?php echo $value->name ?></h2> <h2 class="crete small-title"><?php echo $value->name ?></h2>
<div class="cover-mobile display--only-mobile animated fadeInUp" style = "background-image: url('<?php echo nap_category_image($value->term_id) ?>')"> <div class="cover-mobile display--only-mobile animated fadeInUp" style = "background-image: url('<?php echo nap_category_image($value->term_id) ?>')">
......
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