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
adc6a1ce
Commit
adc6a1ce
authored
Sep 06, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format fiche décorée
parent
7706af58
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
17 deletions
+52
-17
main.css
wp-content/themes/nap/assets/css/main.css
+2
-2
product.js
wp-content/themes/nap/assets/js/product.js
+19
-5
fiche-technique.php
wp-content/themes/nap/fiche-technique.php
+2
-2
functions.php
wp-content/themes/nap/functions.php
+1
-0
archive-product.php
wp-content/themes/nap/woocommerce/archive-product.php
+23
-3
simple.php
...mes/nap/woocommerce/single-product/add-to-cart/simple.php
+5
-5
No files found.
wp-content/themes/nap/assets/css/main.css
View file @
adc6a1ce
...
...
@@ -1703,7 +1703,7 @@ label.chevron.bottom::first-letter {
position
:
relative
;
}
.phototheque-content
.nav-phototeque
{
padding
:
40px
;
padding
:
40px
10px
40px
40px
;
max-width
:
465px
;
width
:
34%
;
border-right
:
1px
solid
rgba
(
26
,
26
,
26
,
0.2
);
...
...
@@ -1711,7 +1711,7 @@ label.chevron.bottom::first-letter {
height
:
100%
;
}
.phototheque-content
.header
h2
{
padding-top
:
2
6
px
;
padding-top
:
2
5
px
;
margin-bottom
:
22px
;
}
.phototheque-content
.header
h2
:after
{
...
...
wp-content/themes/nap/assets/js/product.js
View file @
adc6a1ce
...
...
@@ -27,13 +27,26 @@ function loadProductContent() {
$
.
fn
.
responsive
();
$
(
'.variations_form'
).
on
(
'reset_data'
,
function
()
{
$firstInput
=
$
(
'.variations_form .format-list input:not(:disabled)'
).
first
();
$firstInput
.
prop
(
'checked'
,
true
);
$firstInput
.
change
();
console
.
log
(
"reset data"
);
$attributes
=
$
(
'.variations .list'
);
$attributes
.
each
(
function
(
i
)
{
var
$attr
=
$
(
this
);
if
(
!
$attr
.
hasClass
(
'pa_couleur'
))
{
console
.
log
(
i
,
$attr
,
$attr
.
find
(
'input:not(:disabled):checked'
).
length
);
if
(
!
$attr
.
find
(
'input:not(:disabled):checked'
).
length
)
{
$firstInput
=
$attr
.
find
(
'input:not(:disabled)'
).
first
();
$firstInput
.
prop
(
'checked'
,
true
);
$firstInput
.
change
();
}
}
});
});
function
onFoundVariation
(
a
,
b
,
c
)
function
onFoundVariation
()
{
console
.
log
(
a
,
b
,
c
,
this
);
console
.
log
(
'found variation'
);
//$('.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'
));
...
...
@@ -302,6 +315,7 @@ $(function(){
$
(
'.load-page'
).
parent
().
addClass
(
'active'
);
$
(
'.load-page'
).
load
(
toLink
,{
'ajax'
:
1
},
function
(){
history
.
pushState
(
null
,
null
,
toLink
);
jQuery
(
'.variations_form'
).
wc_variation_form
();
loadProductContent
();
$
(
'html'
).
css
(
'overflow'
,
'hidden'
);
});
...
...
wp-content/themes/nap/fiche-technique.php
View file @
adc6a1ce
...
...
@@ -39,14 +39,14 @@ if($variation_id !='undefined'){
//fiche simple
else
{
$product
=
wc_get_product
(
$product_id
);
$fiche_id
=
get_post_meta
(
$product_id
,
'_fiche_simple'
,
true
);
$sku
=
get_post_meta
(
$product_id
,
'_sku'
,
true
);
$gencod
=
get_post_meta
(
$product_id
,
'_gencod_simple'
,
true
);
$itf14
=
get_post_meta
(
$product_id
,
'_itf14_simple'
,
true
);
$thumb_image
=
get_the_post_thumbnail
(
$product_id
,
'medium'
);
$file_title
.=
"<br/>"
.
get_the_title
(
$product_id
);
$file_title
.=
"<br/>"
.
$product
->
get_attribute
(
'pa_format'
)
.
' '
.
get_the_title
(
$product_id
);
}
...
...
wp-content/themes/nap/functions.php
View file @
adc6a1ce
...
...
@@ -25,6 +25,7 @@ function nap_enqueue_scripts() {
// Enqueue jQuery UI and autocomplete
wp_enqueue_script
(
'jquery-ui-core'
);
wp_enqueue_script
(
'jquery-ui-autocomplete'
);
wp_enqueue_script
(
'wc-add-to-cart-variation'
);
}
add_action
(
'wp_enqueue_scripts'
,
'nap_enqueue_scripts'
);
...
...
wp-content/themes/nap/woocommerce/archive-product.php
View file @
adc6a1ce
...
...
@@ -168,7 +168,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
$options
[
'size'
]
=
(
get_field
(
'produit_affichage'
,
$id
))
?
get_field
(
'produit_affichage'
,
$id
)
:
'small'
;
$args
=
array
(
'post_type'
=>
array
(
'product'
,
'product_variation'
),
'post_status'
=>
array
(
'p
rivate'
,
'p
ublish'
),
'post_status'
=>
array
(
'publish'
),
'numberposts'
=>
-
1
,
'orderby'
=>
'menu_order'
,
'order'
=>
'asc'
,
...
...
@@ -178,18 +178,38 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
$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'
);
//var_dump($attribute_value['pa_format']);
if
(
is_array
(
$attribute_value
[
'pa_format'
]))
{
$list_formats
=
''
;
foreach
(
$attribute_value
[
'pa_format'
]
as
$key
=>
$value
)
{
$list_formats
.=
$value
->
name
.
','
;
}
$list_att
[
'pa_format'
]
=
explode
(
','
,
$list_formats
);
}
/* print '*********************';
var_dump($list_att['pa_format']);*/
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'
]))
{
$list_formats
=
''
;
foreach
(
$attribute_value
[
'pa_format'
]
as
$key
=>
$value
)
{
$list_
att
[
'pa_format'
]
=
$value
->
name
;
$list_
formats
.=
$value
->
name
.
','
;
}
$list_att
[
'pa_format'
]
=
explode
(
','
,
$list_formats
);
}
if
(
is_array
(
$attribute_value
[
'pa_matiere'
]))
{
foreach
(
$attribute_value
[
'pa_matiere'
]
as
$key
=>
$value
)
{
$list_att
[
'pa_matiere'
]
=
$value
->
name
;
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/simple.php
View file @
adc6a1ce
...
...
@@ -121,19 +121,19 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
</div>
</div>
<?php
$formats
=
explode
(
','
,
nap_variation_format
(
$id
));
?>
<div
class=
"product-details full-height row right transition"
>
<div
class=
"product-info row center right border-l"
>
<div
class=
"inner-product-info"
>
<div
class=
"info-content"
>
<?php
$formats
=
explode
(
','
,
nap_variation_format
(
$id
));
?>
<?php
$format
=
$product
->
get_attribute
(
'pa_format'
);
?>
<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
s
[
0
]
;
?>
</span>
<span
class=
"info-color"
>
<?php
echo
$_GET
[
'pa_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
s
[
0
]
;
?>
<?php
echo
$format
;
?>
</p>
<p
class=
"pq"
>
<?php
echo
do_shortcode
(
get_the_excerpt
());
?>
</p>
</div>
...
...
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