Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
NAP-wordpress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marwa Sfari
NAP-wordpress
Commits
344636f1
Commit
344636f1
authored
Aug 25, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
acces pro correction
parent
fdd8199b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
265 additions
and
202 deletions
+265
-202
nap.js
wp-content/themes/nap/assets/js/nap.js
+61
-46
download.php
wp-content/themes/nap/download.php
+1
-0
functions.php
wp-content/themes/nap/functions.php
+75
-67
archive-product.php
wp-content/themes/nap/woocommerce/archive-product.php
+128
-89
No files found.
wp-content/themes/nap/assets/js/nap.js
View file @
344636f1
jQuery
(
document
).
ready
(
function
()
{
jQuery
(
document
).
on
(
'click'
,
".format-list"
,
function
()
{
var
format
=
jQuery
(
this
).
find
(
'.format-desc'
).
text
();
jQuery
(
'.info-format'
).
text
(
format
);
jQuery
(
'.info-format-txt'
).
text
(
format
);
});
jQuery
(
document
).
on
(
'click'
,
".download_file"
,
function
()
{
var
id
;
var
download_link
=
jQuery
(
'.download_file_link'
).
attr
(
'href'
);
...
...
@@ -50,18 +58,18 @@ jQuery(document).ready(function() {
//filtre couleur
var
tabcolor
=
[];
var
tabcolor
=
[];
i
=
0
;
jQuery
(
"#pa_couleur .selected"
).
each
(
function
()
{
tabcolor
[
i
++
]
=
jQuery
(
this
).
attr
(
'data-color'
);
});
var
tabformat
=
[];
i
=
0
;
jQuery
(
"#pa_format .selected"
).
each
(
function
()
{
tabformat
[
i
++
]
=
jQuery
(
this
).
text
();
});
var
tabmatiere
=
[];
i
=
0
;
jQuery
(
"#pa_matiere .selected"
).
each
(
function
()
{
...
...
@@ -70,57 +78,64 @@ jQuery(document).ready(function() {
var
selected_colors
=
tabcolor
.
join
(
','
);
var
selected_formats
=
tabformat
.
join
(
','
);
var
selected_matiere
=
tabmatiere
.
join
(
','
);
var
params
=
{
pa_couleur
:
selected_colors
,
pa_format
:
selected_formats
,
pa_matiere
:
selected_matiere
};
window
.
location
.
href
=
"?"
+
jQuery
.
param
(
params
);
var
params
=
{
pa_couleur
:
selected_colors
,
pa_format
:
selected_formats
,
pa_matiere
:
selected_matiere
};
window
.
location
.
href
=
"?"
+
jQuery
.
param
(
params
);
/*history.pushState({}, null, "?" + jQuery.param(params));
jQuery.ajax({
type: 'GET',
url: '',
data: {"pa_couleur": selected_colors,"pa_format":selected_formats},
success: function(data) {
},
error: function() {
}
jQuery.ajax({
type: 'GET',
url: '',
data: {"pa_couleur": selected_colors,"pa_format":selected_formats},
success: function(data) {
},
error: function() {
}
});
jQuery(".product-list article li").each(function() {
var product_color = jQuery(this).attr('data-color');
var product_format = jQuery(this).attr('data-format');
if (jQuery.inArray(product_color, tabcolor) >= 0 || jQuery.inArray(product_format, tabformat) >= 0) {
jQuery(this).closest('article').addClass('in_search');
}
});
*/
});
jQuery(".product-list article li").each(function() {
var product_color = jQuery(this).attr('data-color');
var product_format = jQuery(this).attr('data-format');
if (jQuery.inArray(product_color, tabcolor) >= 0 || jQuery.inArray(product_format, tabformat) >= 0) {
jQuery(this).closest('article').addClass('in_search');
}
jQuery
(
'.filter-bloc '
).
each
(
function
()
{
});
if
(
jQuery
(
this
).
find
(
'.bloc-content'
).
length
==
0
)
{
*/
jQuery
(
this
).
hide
();
}
});
if
(
jQuery
.
urlParam
(
'pa_format'
)
!=
''
||
jQuery
.
urlParam
(
'pa_couleur'
)
!=
''
||
jQuery
.
urlParam
(
'pa_matiere'
)
!=
''
){
jQuery
(
'.list-animation section'
).
each
(
function
()
{
if
(
jQuery
(
this
).
find
(
'article.selected'
).
length
==
0
)
{
jQuery
(
this
).
hide
();
}
});
}
jQuery
(
'.filter-bloc '
).
each
(
function
()
{
if
(
jQuery
(
this
).
find
(
'.bloc-content'
).
length
==
0
)
{
jQuery
(
this
).
hide
();
}
});
jQuery
(
'.list-animation section'
).
each
(
function
()
{
if
(
jQuery
(
this
).
find
(
"article"
).
length
)
{
console
.
log
(
'article found'
);
}
else
{
jQuery
(
this
).
hide
();
}
})
});
jQuery
.
urlParam
=
function
(
name
){
var
results
=
new
RegExp
(
'[
\
?&]'
+
name
+
'=([^&#]*)'
).
exec
(
window
.
location
.
href
);
return
results
[
1
]
||
0
;
jQuery
.
urlParam
=
function
(
name
)
{
var
results
=
new
RegExp
(
'[
\
?&]'
+
name
+
'=([^&#]*)'
).
exec
(
window
.
location
.
href
);
return
results
[
1
]
||
0
;
}
\ No newline at end of file
wp-content/themes/nap/download.php
View file @
344636f1
...
...
@@ -35,6 +35,7 @@ $post_ID = 260;
while
(
has_sub_field
(
'tl_images'
,
$post_ID
))
:
$options
=
array
();
$options
[
'image'
]
=
get_sub_field
(
'tl_image'
);
$options
[
'title'
]
=
get_sub_field
(
'tl_titre_image'
);
$options
[
'dwnldLink'
]
=
get_sub_field
(
'tl_link'
);
echo
nap_get_item
(
$post_ID
,
null
,
''
,
$options
);
?>
...
...
wp-content/themes/nap/functions.php
View file @
344636f1
...
...
@@ -415,31 +415,32 @@ function nap_distinct_format_variations($variations) {
return
$var_format
;
}
function
nap_filter_attribute
(
$postID
,
$search
,
$attribute
,
$color
=
false
)
{
if
(
isset
(
$search
)
&&
$search
!=
''
)
{
$tab_attr
=
get_the_terms
(
$postID
,
$attribute
);
$filter
=
"hidden"
;
if
(
is_array
(
$tab_attr
))
{
foreach
(
$tab_attr
as
$key
=>
$value
)
{
if
(
$color
)
{
$code
=
nap_color_attribute
(
$value
->
slug
);
if
(
$code
!=
''
&&
stristr
(
$search
,
$code
))
{
$filter
=
"selected"
;
}
}
else
{
if
(
stristr
(
$search
,
$value
->
name
))
{
$filter
=
"selected"
;
}
}
}
}
function
nap_filter_attribute
(
$id
,
$args
,
$options
,
$list_attr
,
$search
)
{
if
(
isset
(
$search
[
'pa_format'
])
&&
$search
[
'pa_format'
]
!=
''
){
$list_format
=
explode
(
","
,
$search
[
'pa_format'
]);
}
if
(
isset
(
$search
[
'pa_couleur'
])
&&
$search
[
'pa_couleur'
]
!=
''
){
$list_couleur
=
explode
(
","
,
$search
[
'pa_couleur'
]);
}
if
(
isset
(
$search
[
'pa_matiere'
])
&&
$search
[
'pa_matiere'
]
!=
''
){
$list_matiere
=
explode
(
","
,
$search
[
'pa_matiere'
]);
}
if
(
isset
(
$search
[
'pa_univers'
])
&&
$search
[
'pa_univers'
]
!=
''
){
$list_univers
=
explode
(
","
,
$search
[
'pa_univers'
]);
}
return
$filter
;
if
(
(
(
$list_couleur
&&
in_array
(
$list_attr
[
'pa_couleur'
],
$list_couleur
))
||
empty
(
$list_couleur
)
)
&&
(
(
$list_format
&&
in_array
(
$list_attr
[
'pa_format'
],
$list_format
))
||
empty
(
$list_format
)
)
&&
(
(
$list_univers
&&
in_array
(
$list_attr
[
'pa_univers'
],
$list_univers
))
||
empty
(
$list_univers
)
)
&&
(
(
$list_matiere
&&
in_array
(
$list_attr
[
'pa_matiere'
],
$list_matiere
))
||
empty
(
$list_matiere
)
)
)
{
echo
nap_get_item
(
$id
,
$args
,
'catalogue'
,
$options
);
}
}
function
nap_get_item
(
$post_ID
,
$args
=
null
,
$current_page
=
''
,
$options
=
null
,
$search
=
null
)
{
$link
=
$image
=
$size
=
''
;
if
(
isset
(
$options
))
{
if
(
$options
[
'dwnldLink'
])
{
...
...
@@ -453,55 +454,61 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
if
(
$options
[
'size'
])
{
$size
=
$options
[
'size'
];
}
}
if
(
isset
(
$search
[
'pa_couleur'
])
&&
$search
[
'pa_couleur'
]
!=
''
)
{
$colors_value
=
get_the_terms
(
$post_ID
,
'pa_couleur'
);
$filter
=
"hidden"
;
if
(
is_array
(
$colors_value
))
{
foreach
(
$colors_value
as
$key
=>
$value
)
{
$code
=
nap_color_attribute
(
$value
->
slug
);
if
(
$code
!=
''
&&
stristr
(
$search
[
'pa_couleur'
],
$code
))
{
$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
(
$options
[
'title'
])
{
$title_item
=
$options
[
'title'
];
}
else
{
$title_item
=
get_the_title
(
$post_ID
);
}
}
if
(
isset
(
$search
[
'pa_matiere'
])
&&
$search
[
'pa_matiere'
]
!=
''
)
{
$format_value
=
get_the_terms
(
$post_ID
,
'pa_matiere'
);
$filter
=
"hidden"
;
if
(
is_array
(
$format_value
))
{
foreach
(
$format_value
as
$key
=>
$value
)
{
if
(
stristr
(
$search
[
'pa_matiere'
],
$value
->
name
))
{
$filter
=
"selected"
;
}
}
}
}
/* if (isset($search['pa_couleur']) && $search['pa_couleur'] != '') {
$colors_value = get_the_terms($post_ID, 'pa_couleur');
$filter = "hidden";
if (is_array($colors_value)) {
foreach ($colors_value as $key => $value) {
$code = nap_color_attribute($value->slug);
if ($code != '' && stristr($search['pa_couleur'], $code)) {
$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_matiere']) && $search['pa_matiere'] != '') {
$format_value = get_the_terms($post_ID, 'pa_matiere');
$filter = "hidden";
if (is_array($format_value)) {
foreach ($format_value as $key => $value) {
if (stristr($search['pa_matiere'], $value->name)) {
$filter = "selected";
}
}
}
} */
if
(
isset
(
$filter
))
$class
=
$filter
;
...
...
@@ -531,7 +538,8 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
$nap_article
.=
'</ul>'
;
endif
;
$nap_article
.=
'</figure>
<h3 class = "font-small" >'
.
get_the_title
(
$post_ID
)
.
'</h3>
<h3 class = "font-small" >'
.
$title_item
.
'</h3>
</article>'
;
return
$nap_article
;
...
...
wp-content/themes/nap/woocommerce/archive-product.php
View file @
344636f1
...
...
@@ -39,78 +39,88 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</div>
<div
class=
"right-container"
>
<div
class=
"left-panel fixed-full position--after-menu "
>
<?php
if
(
$cateID
!=
20
)
:
?>
<
div
class
="
filter
-
wrapper
">
<div class="
filter
-
btn
fixed
position
--
after
-
menu
">
<div class="
btn
-
container
"><span class="
abs
-
center
font
-
small
">Filtres</span></div>
</div>
<div class="
filter
-
content
">
<div class="
filter
-
list
fixed
position
--
after
-
menu
">
<div class="
top
-
header
">
<span>Filtres</span>
<span class="
close
-
btn
"></span>
</div>
<?php
if
(
$cateID
!=
20
)
:
?>
<div
class=
"filter-wrapper"
>
<div
class=
"filter-btn fixed position--after-menu"
>
<div
class=
"btn-container"
><span
class=
"abs-center font-small"
>
Filtres
</span></div>
</div>
<div
class=
"filter-content"
>
<div
class=
"filter-list fixed position--after-menu"
>
<div
class=
"top-header"
>
<span>
Filtres
</span>
<span
class=
"close-btn"
></span>
</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
<?
php
if
(
$_GET
[
$value
]
!=
''
)
echo
'active selected-filter'
;
?>
">
<div
class=
"header"
>
<p><span>
<?php
echo
$key
?>
</span></p>
</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
<?php
if
(
$_GET
[
$value
]
!=
''
)
echo
'active selected-filter'
;
?>
"
>
<div
class=
"header"
>
<p><span>
<?php
echo
$key
?>
</span></p>
</div>
<?php
if
(
$value
==
'pa_couleur'
)
$terms
=
get_terms
(
$value
);
else
$terms
=
nap_attribute_by_category
(
$cateID
,
$value
);
if
(
!
empty
(
$terms
)
&&
!
is_wp_error
(
$terms
))
:
?>
<div
class=
"bloc-content"
>
<ul
<?php
if
(
$value
==
'pa_couleur'
)
echo
'class = "list-color-filter clearfix"'
;
?>
id=
"
<?php
echo
$value
;
?>
"
>
<?php
foreach
(
$terms
as
$term
)
:
if
(
$value
==
'pa_couleur'
)
:
$color
=
get_field
(
'couleurs'
,
'pa_couleur_'
.
$term
->
term_id
);
if
(
isset
(
$color
)
&&
strlen
(
$color
)
>
0
)
:
$filter_class
=
nap_selected_filter
(
$_GET
[
'pa_couleur'
],
$color
);
?>
<li
data-color =
"
<?php
echo
$color
;
?>
"
class=
"
<?php
echo
$term
->
name
.
' '
.
$filter_class
;
?>
"
></li>
<?php
if
(
$value
==
'pa_couleur'
)
{
$terms
=
get_terms
(
$value
);
}
else
$terms
=
nap_attribute_by_category
(
$cateID
,
$value
);
if
(
!
empty
(
$terms
)
&&
!
is_wp_error
(
$terms
))
:
?>
<div
class=
"bloc-content"
>
<ul
<?php
if
(
$value
==
'pa_couleur'
)
echo
'class = "list-color-filter clearfix"'
;
?>
id=
"
<?php
echo
$value
;
?>
"
>
<?php
$colors
=
array
();
foreach
(
$terms
as
$term
)
:
if
(
$value
==
'pa_couleur'
)
:
$colors
[
$term
->
name
]
=
get_field
(
'couleurs'
,
'pa_couleur_'
.
$term
->
term_id
);
/* if (isset($color) && strlen($color) > 0):
$filter_class = nap_selected_filter($_GET['pa_couleur'],$color);
?>
<li data-color = "<?php echo $color; ?>" class="<?php echo $term->name.' '.$filter_class; ?>"></li>
<?php
endif; */
else
:
$filter_format
=
nap_selected_filter
(
$_GET
[
'pa_format'
],
$term
);
$filter_matiere
=
nap_selected_filter
(
$_GET
[
'pa_matiere'
],
$term
);
?>
<li
class=
"
<?php
echo
$filter_format
.
' '
.
$filter_matiere
;
?>
"
>
<?php
echo
$term
;
?>
</li>
<?php
endif
;
endforeach
;
foreach
(
array_unique
(
$colors
)
as
$name
=>
$code
)
{
if
(
isset
(
$code
)
&&
strlen
(
$code
)
>
0
)
:
$filter_class
=
nap_selected_filter
(
$_GET
[
'pa_couleur'
],
$code
);
?>
<li
data-color =
"
<?php
echo
$code
;
?>
"
class=
"
<?php
echo
$name
.
' '
.
$filter_class
;
?>
"
></li>
<?php
endif
;
else
:
$filter_format
=
nap_selected_filter
(
$_GET
[
'pa_format'
],
$term
);
$filter_matiere
=
nap_selected_filter
(
$_GET
[
'pa_matiere'
],
$term
);
}
if
(
$value
==
'pa_couleur'
)
:
?>
<li
class=
"
<?php
echo
$filter_format
.
' '
.
$filter_matiere
;
?>
"
>
<?php
echo
$term
;
?>
</li>
<?php
endif
;
endforeach
;
if
(
$value
==
'pa_couleur'
)
:
?>
<li
class=
"reinit"
>
Tout déselectionner
</li>
<?php
endif
;
?>
</ul>
</div>
<?php
endif
;
?>
</div>
<?php
endforeach
;
?>
<li
class=
"reinit"
>
Tout déselectionner
</li>
<?php
endif
;
?>
</ul>
</div>
<?php
endif
;
?>
</div>
<?php
endforeach
;
?>
<div
class=
"center filter-btn-list"
>
<div
class=
"btn pink-btn rounded"
id=
"search-btn"
>
Rechercher
</div>
<span
class =
"reinit-all"
>
Effacer les filtres
</span>
<div
class=
"center filter-btn-list"
>
<div
class=
"btn pink-btn rounded"
id=
"search-btn"
>
Rechercher
</div>
<span
class =
"reinit-all"
>
Effacer les filtres
</span>
</div>
</div>
</div>
</div>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
foreach
(
$child_category
as
$key
=>
$value
)
:
?>
...
...
@@ -119,18 +129,18 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
<p>
<?php
echo
$value
->
description
;
?>
</p>
</div>
</div>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
</div>
<div
class=
"right-panel right"
>
<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
if
(
$_GET
[
'pa_couleur'
]
!=
''
||
$_GET
[
'pa_format'
]
!=
''
||
$_GET
[
'pa_matiere'
]
!=
''
)
:
?>
<span
class=
"search_result"
>
Résultat de votre recherche :
</span>
<?php
endif
;
?>
<?php
foreach
(
$child_category
as
$key
=>
$value
)
:
?>
<section
id =
"cat
<?php
echo
$value
->
term_id
?>
"
>
<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
)
?>
')"
>
...
...
@@ -139,37 +149,66 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</div>
</div>
<div
class=
"product-list"
>
<?php
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$value
->
name
,
'orderby'
=>
'title'
,
'order'
=>
'ASC'
);
$naps_posts
=
new
WP_Query
(
$args
);
$options
=
array
();
while
(
$naps_posts
->
have_posts
())
:
$naps_posts
->
the_post
();
$id
=
get_the_ID
();
$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'
),
'numberposts'
=>
-
1
,
'orderby'
=>
'menu_order'
,
'order'
=>
'asc'
,
'post_parent'
=>
$id
);
?>
<?php
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$value
->
name
,
'orderby'
=>
'title'
,
'order'
=>
'ASC'
);
$naps_posts
=
new
WP_Query
(
$args
);
$options
=
array
();
<?php
echo
nap_get_item
(
$id
,
$args
,
$current_page
,
$options
,
$_GET
);
?>
while
(
$naps_posts
->
have_posts
())
:
$naps_posts
->
the_post
();
$id
=
get_the_ID
();
$list_att
=
array
();
$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'
),
'numberposts'
=>
-
1
,
'orderby'
=>
'menu_order'
,
'order'
=>
'asc'
,
'post_parent'
=>
$id
);
?>
<?php
/* * ************* */
$attribute_value
[
'pa_couleur'
]
=
get_the_terms
(
$id
,
'pa_couleur'
);
$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'
);
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'
]))
{
foreach
(
$attribute_value
[
'pa_format'
]
as
$key
=>
$value
)
{
$list_att
[
'pa_format'
]
=
$value
->
name
;
}
}
if
(
is_array
(
$attribute_value
[
'pa_matiere'
]))
{
foreach
(
$attribute_value
[
'pa_matiere'
]
as
$key
=>
$value
)
{
$list_att
[
'pa_matiere'
]
=
$value
->
name
;
}
}
if
(
is_array
(
$attribute_value
[
'pa_univers'
]))
{
foreach
(
$attribute_value
[
'pa_univers'
]
as
$key
=>
$value
)
{
$list_att
[
'pa_univers'
]
=
$value
->
name
;
}
}
nap_filter_attribute
(
$id
,
$args
,
$options
,
$list_att
,
$_GET
);
}
else
{
echo
nap_get_item
(
$id
,
$args
,
$current_page
,
$options
);
}
endwhile
;
wp_reset_query
();
?>
</div>
</section>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
</div>
</div>
</div>
</div>
<?php
get_footer
();
?>
\ No newline at end of file
<?php
get_footer
();
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment