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
e05d98ec
Commit
e05d98ec
authored
Sep 04, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modifs JC
parent
93b5c766
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
231 additions
and
69 deletions
+231
-69
main.css
wp-content/themes/nap/assets/css/main.css
+37
-6
responsive.css
wp-content/themes/nap/assets/css/responsive.css
+3
-1
map.js
wp-content/themes/nap/assets/js/map.js
+8
-8
nap.js
wp-content/themes/nap/assets/js/nap.js
+14
-1
product.js
wp-content/themes/nap/assets/js/product.js
+62
-2
footer-shop.php
wp-content/themes/nap/footer-shop.php
+1
-1
footer.php
wp-content/themes/nap/footer.php
+19
-17
functions.php
wp-content/themes/nap/functions.php
+5
-1
header-shop.php
wp-content/themes/nap/header-shop.php
+1
-1
header.php
wp-content/themes/nap/header.php
+11
-14
phototheque.php
wp-content/themes/nap/phototheque.php
+47
-6
archive-product.php
wp-content/themes/nap/woocommerce/archive-product.php
+9
-3
variable.php
...s/nap/woocommerce/single-product/add-to-cart/variable.php
+14
-8
No files found.
wp-content/themes/nap/assets/css/main.css
View file @
e05d98ec
...
...
@@ -1326,7 +1326,7 @@ aside.news-wrapper {
.product-details
.list
ul
{
overflow-y
:
scroll
;
max-height
:
560px
;
margin-right
:
-17px
;
/* margin-right: -17px; */
padding-bottom
:
15px
;
}
...
...
@@ -1345,7 +1345,7 @@ aside.news-wrapper {
display
:
block
;
position
:
relative
;
cursor
:
pointer
;
padding-right
:
17px
;
/* padding-right: 17px; */
}
.list
li
input
{
cursor
:
pointer
;
...
...
@@ -1353,10 +1353,12 @@ aside.news-wrapper {
.pa_couleur
li
{
margin-bottom
:
21px
;
}
/*
.pa_couleur li.selected >span:first-child,
.pa_couleur li.selected >span:first-child{
border : 1px solid;
}
*/
.pa_couleur
li
span
{
/*height: 36px;
width: 36px;
...
...
@@ -1373,7 +1375,7 @@ aside.news-wrapper {
.pa_format
ul
li
{
text-align
:
center
;
color
:
#313D7A
;
max-width
:
85%
;
/* max-width: 85%; */
}
.pa_format
ul
li
:last-of-type
{
margin-bottom
:
20px
;
...
...
@@ -1386,7 +1388,9 @@ aside.news-wrapper {
label
.chevron.bottom
{
display
:
block
;
width
:
120%
;
/*
width: 120%;
*/
}
label
.chevron.bottom
::first-letter
{
...
...
@@ -1399,6 +1403,7 @@ label.chevron.bottom::first-letter {
.pa_format
ul
li
:last-of-type
{
margin-bottom
:
20px
;
}
/*
.pa_format li.disabled {
color: rgba(26,26,26,0.2);
pointer-events:none;
...
...
@@ -1408,10 +1413,30 @@ label.chevron.bottom::first-letter {
filter: grayscale(100%);
opacity: 0.4;
}
*/
/* JC 20170901 */
.color-list
input
:checked
+
span
::after
{
border
:
1px
solid
;
}
.format-list
input
:disabled
+
*,
.variations
.list
input
:disabled
+
*
+
*
{
display
:
none
;
}
.format-list
input
:checked
+
label
.inactive
,
.format-list
input
:not
(
:checked
)
+
label
.active
{
display
:
none
;
}
/* JC END */
/*
.pa_couleur li.selected input[type='radio']+span:before,
*/
/*.pa_couleur li.selected >input:first-child::before,*/
/*
.list li.selected >span:first-child::after{
*/
.list
input
:checked
+
span
::before
{
content
:
''
;
height
:
14px
;
width
:
21px
;
...
...
@@ -1622,6 +1647,10 @@ label.chevron.bottom::first-letter {
height
:
100%
;
}
/** WORDPRESS VARIATION PLUGUIN RADIO **/
.variations
input
{
display
:
none
;
}
.color-list
input
[
type
=
'radio'
]+
span
:after
/*.color-list input[type='radio']::after */
{
position
:
relative
;
...
...
@@ -1642,6 +1671,7 @@ label.chevron.bottom::first-letter {
.color-list
input
[
type
=
'radio'
]
:checked
+
span
:after
{
border
:
1px
solid
#071D3D
;
}
/*
.format-list input,
.color-list input{
-webkit-appearance:none;
...
...
@@ -1664,6 +1694,7 @@ label.chevron.bottom::first-letter {
left: 50%;
opacity: 0;
}
*/
.reset_variations
,
.quantity
{
display
:
none
!important
;
}
...
...
@@ -1694,7 +1725,7 @@ label.chevron.bottom::first-letter {
}
.phototheque-content
nav
{
padding-left
:
24px
;
width
:
100%
;
/*width: 100%;*/
overflow-wrap
:
break-word
;
}
.phototheque-content
nav
li
{
...
...
@@ -2687,4 +2718,4 @@ div.wpcf7-mail-sent-ok{
0
{
transform
:
rotate
(
0deg
);}
50
%
{
transform
:
rotate
(
180deg
);}
100
%
{
transform
:
rotate
(
360deg
);}
}
\ No newline at end of file
}
wp-content/themes/nap/assets/css/responsive.css
View file @
e05d98ec
...
...
@@ -28,7 +28,9 @@
width
:
100%
;
}
.pa_format
ul
li
{
/*
max-width: 92%;
*/
}
.product-info
.info-content
{
padding-top
:
20px
;
...
...
@@ -1118,4 +1120,4 @@
.contact-form
.footer
{
position
:
relative
!important
;
}
}
\ No newline at end of file
}
wp-content/themes/nap/assets/js/map.js
View file @
e05d98ec
...
...
@@ -11,7 +11,7 @@ function initMap(){
if
(
jQuery
(
document
).
find
(
'#map'
).
length
){
svg
=
jQuery
(
"#map"
).
getSVG
();
jQuery
.
map
(
zones
,
function
(
zoneDeps
,
zone
){
$
.
map
(
zoneDeps
,
function
(
dep
,
i
){
jQuery
.
map
(
zoneDeps
,
function
(
dep
,
i
){
var
initialClassDep
=
'st3'
;
var
initialClassNum
=
'st5'
;
var
proceed
=
false
;
...
...
@@ -68,15 +68,15 @@ function selectZone(zone, initialClassDep, initialClassNum) {
}
function
showMap
(){
jQuery
(
document
).
find
(
'.filter-wrapper .header-filter-contact .open-filter'
).
on
(
'click'
,
function
(){
var
toggleButton
=
$
(
this
).
parent
();
var
toggleButton
=
jQuery
(
this
).
parent
();
toggleButton
.
toggleClass
(
'on'
);
$
(
'.filter'
).
appendMap
();
jQuery
(
'.filter'
).
appendMap
();
if
(
toggleButton
.
hasClass
(
'on'
)){
$
(
'.filter, .details, .active-com'
).
stop
().
slideDown
();
setTimeout
(
function
(){
$
(
'.map'
).
fadeIn
()
},
1000
);
jQuery
(
'.filter, .details, .active-com'
).
stop
().
slideDown
();
setTimeout
(
function
(){
jQuery
(
'.map'
).
fadeIn
()
},
1000
);
}
else
{
$
(
'.filter, .details, .active-com'
).
stop
().
slideUp
();
setTimeout
(
function
(){
$
(
'.map'
).
fadeOut
()
},
1000
);
jQuery
(
'.filter, .details, .active-com'
).
stop
().
slideUp
();
setTimeout
(
function
(){
jQuery
(
'.map'
).
fadeOut
()
},
1000
);
}
checkFilterContactWrapper
();
})
...
...
@@ -122,4 +122,4 @@ jQuery(document).find("#selectCountry").on('change',function(e) {
jQuery
(
document
).
ready
(
function
(){
initMap
();
});
//end document ready
\ No newline at end of file
});
//end document ready
wp-content/themes/nap/assets/js/nap.js
View file @
e05d98ec
jQuery
(
document
).
ready
(
function
()
{
/*
jQuery(document).on('click', ".format-list", function() {
var format = jQuery(this).find('.format-desc').text();
...
...
@@ -7,6 +8,7 @@ jQuery(document).ready(function() {
jQuery('.info-format-txt').text(format);
});
*/
jQuery
(
document
).
on
(
'click'
,
".download_file"
,
function
()
{
var
id
;
...
...
@@ -25,10 +27,15 @@ jQuery(document).ready(function() {
});
/*
jQuery(document).bind('change', 'input[name="variation_id"]', function() {
var
varID
=
jQuery
(
'input[name="variation_id"]'
).
val
();
setTimeout(function(){
var varID = jQuery('input[name="variation_id"]').val();
if (varID != 0) {
var price = jQuery('.woocommerce-variation-price .woocommerce-Price-amount').text();
if(price == "")
{
price = jQuery('.summary .woocommerce-Price-amount').text();
...
...
@@ -37,6 +44,11 @@ jQuery(document).ready(function() {
jQuery('.price .crete').text(price + " ht");
jQuery('.pq').text(pq);
}
}, 800);
});
jQuery('li.format-list:first-child input').attr('checked', true);
...
...
@@ -56,6 +68,7 @@ jQuery(document).ready(function() {
jQuery('.info-format-txt').text(format);
}
});
*/
jQuery
(
"#search-btn"
).
on
(
'click'
,
function
()
{
jQuery
(
'article'
).
show
();
...
...
wp-content/themes/nap/assets/js/product.js
View file @
e05d98ec
(
function
(
$
){
function
loadProductContent
()
{
sizeProductDetails
=
$
(
'.product-details .list'
).
length
;
if
(
sizeProductDetails
==
0
)
{
...
...
@@ -12,6 +13,10 @@ function loadProductContent() {
$
(
'.pa_couleur li'
).
getListColors
();
$
(
'.pa_couleur li'
).
selectColor
();
$
(
'.pa_format li'
).
selectFormat
();
$
(
'.pa_taille li'
).
selectFormat
();
$
(
'.pa_matiere li'
).
selectFormat
();
$
(
'.pa_paquets li'
).
selectFormat
();
$
(
'.pa_designation li'
).
selectFormat
();
$
(
'.list-wrapper .color-list'
).
setColorToWhite
(
'input'
);
$
(
'#zoom'
).
zoom
();
$
(
'article[data-color], .pa_couleur li'
).
click
(
function
(
e
)
{
...
...
@@ -20,15 +25,52 @@ function loadProductContent() {
$
(
'#mozaique'
).
open_gallery
();
initFunction
();
$
.
fn
.
responsive
();
$
(
'.variations_form'
).
on
(
'reset_data'
,
function
()
{
$firstInput
=
$
(
'.variations_form .format-list input:not(:disabled)'
).
first
();
$firstInput
.
prop
(
'checked'
,
true
);
$firstInput
.
change
();
});
function
onFoundVariation
(
a
,
b
,
c
)
{
console
.
log
(
a
,
b
,
c
,
this
);
//$('.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'
));
var
format
=
$
(
'.variations_form .format-list input:checked + * + .format-desc'
).
text
();
$
(
'.info-format'
).
text
(
format
);
$
(
'.info-format-txt'
).
text
(
format
);
$
(
'.info-color'
).
text
(
$
(
'.color-list input:checked'
).
attr
(
'value'
));
var
varID
=
jQuery
(
'input[name="variation_id"]'
).
val
();
if
(
varID
!=
0
)
{
var
price
=
jQuery
(
'.woocommerce-variation-price .woocommerce-Price-amount'
).
text
();
if
(
price
==
""
)
price
=
jQuery
(
'.summary .woocommerce-Price-amount'
).
text
();
var
pq
=
jQuery
(
'.woocommerce-variation-description'
).
text
();
jQuery
(
'.price .crete'
).
text
(
price
+
" ht"
);
jQuery
(
'.pq'
).
text
(
pq
);
}
}
$
(
'.variations_form'
).
on
(
'found_variation'
,
onFoundVariation
).
trigger
(
'check_variations'
);
//onFoundVariation();
setTimeout
(
function
(){
$
.
fn
.
productAnimation
();
$
(
'#product .product-list'
).
showRightPanel
();
$
.
fn
.
slider_product
();
/*
$('.pa_couleur li').selectColor();
$('.pa_format li').selectFormat();
$('.pa_matiere li').selectFormat();
$('.pa_taille li').selectFormat();
$('.pa_paquets li').selectFormat();
$('.pa_designation li').selectFormat();
*/
$
(
'.color-list.selected'
).
selectSlide
(
$
(
'#slides'
));
$
.
fn
.
getDownloadCurrentSlideLink
();
$
.
fn
.
checkIfFormatDisabled
();
//
$.fn.checkIfFormatDisabled ();
//$('.btn-wrapper.close-panel').addClass('int-link');
},
300
)
$
(
'.download-btn:not(.download_file)'
).
click
(
function
(
e
){
...
...
@@ -78,14 +120,25 @@ $(function(){
}
$
.
fn
.
selectColor
=
function
(){
$
(
this
).
on
(
'click'
,
function
(){
var
$input
=
$
(
this
).
find
(
'input'
);
$input
.
prop
(
'disabled'
,
false
);
$input
.
prop
(
'checked'
,
true
);
$input
.
change
();
/*
$(this).parent().parent().find('li').removeClass('selected');
if (!($(this).hasClass('disabled'))){
$(this).toggleClass('selected');
}
*/
})
}
$
.
fn
.
selectFormat
=
function
(){
$
(
this
).
on
(
'click'
,
function
(){
var
$input
=
$
(
this
).
find
(
'input'
);
$input
.
prop
(
'checked'
,
true
);
$input
.
change
();
/*
var actifImage = $(this).find('img').data('img-active'),
initialImage = $(this).find('img').data('img');
$(this).parent().parent().find('li').each(function(){
...
...
@@ -103,8 +156,10 @@ $(function(){
}else{
$(this).find('img').attr('src',initialImage);
}
*/
})
}
/*
$.fn.checkIfFormatDisabled = function(){
var icons = [];
//var format = getUrlParameter('pa_format');
...
...
@@ -113,9 +168,13 @@ $(function(){
icons.push(getUrlParameter('pa_format')) ;
icons.push(getUrlParameter('pa_taille')) ;
icons.push(getUrlParameter('pa_matiere')) ;
icons.push(getUrlParameter('pa_paquets')) ;
icons.push(getUrlParameter('pa_designation')) ;
console.log(icons);
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')) {
...
...
@@ -127,8 +186,8 @@ $(function(){
});
})
/**/
}
*/
$
.
fn
.
getDownloadCurrentSlideLink
=
function
(){
var
img_link
=
$
(
document
).
find
(
'.slick-current a'
).
attr
(
'href'
);
if
(
img_link
){
...
...
@@ -252,3 +311,4 @@ $(function(){
}(
jQuery
));
wp-content/themes/nap/footer-shop.php
View file @
e05d98ec
...
...
@@ -3,6 +3,6 @@
if
(
$ext_ref
)
{
get_footer
();
}
else
{
wp_footer
();
//
wp_footer();
}
?>
wp-content/themes/nap/footer.php
View file @
e05d98ec
</div>
<div
class=
"right-panel-wrapper abs-full fixed transition"
>
<div
id=
"load-page"
class=
"load-page transition"
></div>
</div>
<footer
class=
"blue-bg"
>
<?php
wp_footer
();
?>
<div
class=
"footer font-small animated fadeInUp"
>
...
...
@@ -65,21 +66,22 @@
</div>
</div>
</div>
<div
id=
"loading-container-subpage"
>
<div
class=
"loading-wrapper"
>
<div
class=
"loading"
>
<div
id=
"loading-center-absolute"
>
<div
class=
"load-4"
>
<div
class=
"ring-1"
></div>
<p
class=
"center"
>
Loading . . .
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"loading-container-subpage"
>
<div
class=
"loading-wrapper"
>
<div
class=
"loading"
>
<div
id=
"loading-center-absolute"
>
<div
class=
"load-4"
>
<div
class=
"ring-1"
></div>
<p
class=
"center"
>
Loading . . .
</p>
</div>
</div>
</div>
</div>
</div>
<!--
<script src="
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/jQuery-v1-11.min.js'
)
?>
"></script>
<script src="
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/jquery-ui.min.js'
)
?>
"></script>
-->
<script
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/vendors/TweenMax.min.js'
)
?>
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/vendors/animsition.min.js'
)
?>
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/vendors/viewportchecker.js'
)
?>
"
></script>
...
...
@@ -89,8 +91,8 @@
<script
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/vendors/animate.js'
)
?>
"
type=
"text/javascript"
></script>
<script
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/vendors/jquery.svg.es5.min.js'
)
?>
"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/main.js'
)
?>
?v=
2
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/map.js'
)
?>
?v=
1
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/product.js'
)
?>
?v=
1
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/nap.js'
)
?>
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/main.js'
)
?>
?v=
3
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/map.js'
)
?>
?v=
2
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/product.js'
)
?>
?v=
2
"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/js/nap.js'
)
?>
?v=2
"
></script>
</body>
wp-content/themes/nap/functions.php
View file @
e05d98ec
...
...
@@ -311,7 +311,11 @@ function nap_menu() {
'taxonomy'
=>
$taxonomy
,
'child_of'
=>
0
,
'parent'
=>
$category_id
,
'orderby'
=>
'title'
,
# JC 20170901
#'orderby' => 'title',
'orderby'
=>
'meta_value_num'
,
'meta_key'
=>
'order'
,
# JC end
'show_count'
=>
$show_count
,
'pad_counts'
=>
$pad_counts
,
'hierarchical'
=>
$hierarchical
,
...
...
wp-content/themes/nap/header-shop.php
View file @
e05d98ec
...
...
@@ -3,6 +3,6 @@ $ext_ref = externe_referrer();
if
(
$ext_ref
)
{
get_header
();
}
else
{
wp_head
();
//
wp_head();
}
?>
wp-content/themes/nap/header.php
View file @
e05d98ec
<!DOCTYPE html>
<html
<?php
language_attributes
();
?>
class=
"no-js no-svg"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/normalize.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/fonts/stylesheet.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/slick-theme.css'
)
?>
?v=432"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/slick.css'
)
?>
?v=432"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/animate.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/animsition.min.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/main.css'
)
?>
?v=454"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/responsive.css'
)
?>
?v=432"
rel=
"stylesheet"
type=
"text/css"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"icon"
type=
"image/png"
href=
"images/favicon.png"
/>
<head>
<meta
charset=
"
<?php
bloginfo
(
'charset'
);
?>
"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1 ,user-scalable = no"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/normalize.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/fonts/stylesheet.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/slick-theme.css'
)
?>
?v=432"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/slick.css'
)
?>
?v=432"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/animate.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/animsition.min.css'
)
?>
"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/main.css'
)
?>
?v=455"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"
<?php
echo
home_url
(
'wp-content/themes/nap/assets/css/responsive.css'
)
?>
?v=432"
rel=
"stylesheet"
type=
"text/css"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<link
rel=
"icon"
type=
"image/png"
href=
"images/favicon.png"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1 ,user-scalable = no"
>
<?php
wp_head
();
?>
</head>
...
...
wp-content/themes/nap/phototheque.php
View file @
e05d98ec
...
...
@@ -79,7 +79,7 @@ if (!$ext_ref) {
$i
=
0
;
foreach
(
$sub_cats
as
$sub_category
)
:
?>
<section
id =
"cat
<?php
echo
$sub_category
->
term_id
?>
"
>
<!--cat
<?php
// echo $i ?>-<?php // echo $current_page;
?>-->
<section
id =
"cat
<?php
echo
$sub_category
->
term_id
?>
"
>
<!--cat
<?php
// echo $i ?>-<?php // echo $current_page;
?>-->
<
h2
class
="
crete
small
-
title
"><?php echo
$sub_category->name
?></h2>
<div class="
product
-
list
">
...
...
@@ -108,10 +108,10 @@ if (!$ext_ref) {
<h3 class="font-small">Ambiance
<?php
echo
$sub_category
->
name
;
?>
</h3>
</article>
<?php
<?php
endforeach
;
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$sub_category
->
name
,
'orderby'
=>
'title'
,
'order'
=>
'ASC'
,
'hide_empty'
=>
0
);
$args
=
array
(
'post_type'
=>
array
(
'product'
,
'product_variation'
)
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$sub_category
->
name
,
'orderby'
=>
'title'
,
'order'
=>
'ASC'
,
'hide_empty'
=>
0
);
$naps_posts
=
new
WP_Query
(
$args
);
$options
=
array
();
...
...
@@ -129,9 +129,50 @@ if (!$ext_ref) {
'post_parent'
=>
$id
);
echo
nap_get_item
(
$id
,
$args
,
$current_page
,
$options
);
if
(
$product
->
is_type
(
'variable'
)
)
:
$product
=
new
WC_Product_Variable
(
$id
);
$variations
=
$product
->
get_available_variations
();
$var_colors
=
array
();
foreach
(
$variations
as
$key
=>
$value
)
:
$color
=
nap_variation_color
(
$value
[
'variation_id'
]);
if
(
!
in_array
(
$color
,
$var_colors
))
:
$var_colors
[]
=
$color
;
$var_image
=
get_the_post_thumbnail_url
(
$value
[
'variation_id'
],
'thumbnail'
);
$var_hd
=
get_the_post_thumbnail_url
(
$value
[
'variation_id'
],
'full'
);
?>
<article class=" visible row ">
<a href="#"></a>
<figure data-bg="" class="big transition">
<div class="abs-full article-bg transition"></div>
<a class="circle-btn download-btn hidden-elem" download href="
<?php
echo
$var_hd
;
?>
"></a>
<img class="transition animated fadeIn visible" src="
<?php
echo
$var_image
;
?>
" alt="
<?php
echo
$sub_category
->
name
;
?>
" title="
<?php
echo
$sub_category
->
name
;
?>
" >
</figure>
<h3 class="font-small">
<?php
echo
$sub_category
->
name
;
$variable_product
=
wc_get_product
(
$value
[
'variation_id'
]);
$name
=
$variable_product
->
get_attribute
(
'couleur'
);
echo
' '
.
strtolower
(
$name
)
?>
</h3>
</article>
<?php
endif
;
endforeach
;
else
:
?>
<article class=" visible row ">
<a href="#"></a>
<figure data-bg="" class="big transition">
<div class="abs-full article-bg transition"></div>
<a class="circle-btn download-btn hidden-elem" download href="
<?php
echo
get_the_post_thumbnail_url
(
$id
,
'full'
)
?>
"></a>
<img class="transition animated fadeIn visible" src="
<?php
echo
get_the_post_thumbnail_url
(
$id
,
'thumbnail'
)
?>
" alt="
<?php
echo
get_the_title
()
?>
" title="
<?php
echo
get_the_title
()
?>
" >
</figure>
<h3 class="font-small">
<?php
echo
get_the_title
()
?>
</h3>
</article>
<?php
endif
;
endwhile
;
wp_reset_query
();
?>
...
...
wp-content/themes/nap/woocommerce/archive-product.php
View file @
e05d98ec
...
...
@@ -26,7 +26,10 @@ $cate = get_queried_object();
$cateID
=
$cate
->
term_id
;
//SubCats
$child_category
=
get_terms
(
'product_cat'
,
array
(
'parent'
=>
$cateID
,
'child_of'
=>
the_category_ID
(),
'exclude'
=>
$cateID
,
'orderby'
=>
'title'
,
'order'
=>
'ASC'
));
# JC 20170901
#$child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' => the_category_ID(), 'exclude' => $cateID, 'orderby' => 'title', 'order' => 'ASC'));
$child_category
=
get_terms
(
'product_cat'
,
array
(
'parent'
=>
$cateID
,
'child_of'
=>
the_category_ID
(),
'exclude'
=>
$cateID
,
'orderby'
=>
'meta_value_num'
,
'meta_key'
=>
'order'
,
'order'
=>
'ASC'
));
# JC 20170901 end
?>
<div
class=
"container clearfix"
id=
"catalogue"
data-page =
"
<?php
echo
$cateID
;
?>
"
>
...
...
@@ -151,7 +154,10 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</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'
);
# JC 20170901
#$args = array('post_type' => 'product', 'stock' => 1, 'posts_per_page' => -1, 'product_cat' => $value->name, 'orderby' => 'title' 'order' => 'ASC');
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$value
->
name
,
'orderby'
=>
array
(
'menu_order'
=>
'ASC'
,
title
=>
'ASC'
));
#, 'order' => 'ASC');
# JC 20170901 end
$naps_posts
=
new
WP_Query
(
$args
);
$options
=
array
();
...
...
@@ -209,4 +215,4 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</div>
</div>
</div>
<?php
get_footer
();
?>
\ No newline at end of file
<?php
get_footer
();
?>
wp-content/themes/nap/woocommerce/single-product/add-to-cart/variable.php
View file @
e05d98ec
...
...
@@ -43,7 +43,7 @@ if (!function_exists('print_attribute_radio')) {
$selected
=
"selected"
;
}
$checked
=
sanitize_title
(
$checked_value
)
===
$checked_value
?
checked
(
$checked_value
,
sanitize_title
(
$value
),
false
)
:
checked
(
$checked_value
,
$value
,
false
);
$checked
=
sanitize_title
(
$checked_value
)
===
$checked_value
?
checked
(
$checked_value
,
sanitize_title
(
$value
),
false
)
:
checked
(
$checked_value
,
$value
,
false
);
$input_name
=
'attribute_'
.
esc_attr
(
$name
);
...
...
@@ -66,17 +66,22 @@ if (!function_exists('print_attribute_radio')) {
$icons
=
nap_icon_format
(
$value
);
if
(
$icons
[
'inactive'
]
||
$icons
[
'active'
])
$format_img
=
'<img src="'
.
$icons
[
'inactive'
]
.
'" data-img = "'
.
$icons
[
'inactive'
]
.
'" data-img-active = "'
.
$icons
[
'active'
]
.
'" id="'
.
$value
.
'" style ="height:'
.
$icons
[
'height'
]
.
'px;width:'
.
$icons
[
'width'
]
.
'px" >'
;
{
//$format_img='<img src="'.$icons['inactive'].'" data-img = "'.$icons['inactive'].'" data-img-active = "'.$icons['active'].'" id="'.$value.'" style ="height:'.$icons['height'].'px;width:'.$icons['width'].'px" >';
$format_img
=
'<img src="'
.
$icons
[
'inactive'
]
.
'" class="inactive" id="'
.
$value
.
'-inactive" style ="height:'
.
$icons
[
'height'
]
.
'px;width:'
.
$icons
[
'width'
]
.
'px" alt="">'
.
'<img src="'
.
$icons
[
'active'
]
.
'" class="active" id="'
.
$value
.
'-active" style ="height:'
.
$icons
[
'height'
]
.
'px;width:'
.
$icons
[
'width'
]
.
'px" alt="">'
;
}
else
{
$default_active
=
home_url
(
'wp-content/themes/nap/assets/css/img/default_active.svg'
);
$default_inactive
=
home_url
(
'wp-content/themes/nap/assets/css/img/default_inactive.svg'
);
$format_img
=
'<img src="'
.
$default_inactive
.
'" data-img = "'
.
$default_inactive
.
'" data-img-active = "'
.
$default_active
.
'" id="'
.
$value
.
'" style ="height:35px;width:35px" >'
;
$format_img
=
'<img src="'
.
$default_inactive
.
'" class="inactive" id="'
.
$value
.
'-inactive" style ="height:35px;width:35px" alt="">'
.
'<img src="'
.
$default_active
.
'" class="active" id="'
.
$value
.
'-active" style ="height:35px;width:35px" alt="">'
;
}
$filtered_label
=
apply_filters
(
'woocommerce_variation_option_name'
,
$label
);
printf
(
'<li class="format-list"><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s>
printf
(
'<li class="format-list
"><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s>
<label class="format-label" for="%3$s">'
.
$format_img
.
'</label>
<div class="format-desc">'
.
$label
.
'</
span
>
<label class="format-label" for="
xx
%3$s">'
.
$format_img
.
'</label>
<div class="format-desc">'
.
$label
.
'</
div
>
</li>'
,
$input_name
,
$esc_value
,
$id
,
$checked
,
$filtered_label
);
//<label class="format-label" style="background:url(' . $icons['inactive'] . ')" for="%3$s"></label>
}
}
...
...
@@ -243,10 +248,11 @@ do_action('woocommerce_before_add_to_cart_form');
}
}
}
?>
</ul>
<?php
echo
end
(
$attribute_keys
)
===
$name
?
apply_filters
(
'woocommerce_reset_variations_link'
,
'<a class="reset_variations" href="#">'
.
__
(
'Clear'
,
'woocommerce'
)
.
'</a>'
)
:
''
;
?>
</ul>
</div>
</div>
<?php
$i
++
;
endforeach
;
?>
...
...
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