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
9a817afa
Commit
9a817afa
authored
Aug 31, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix]Redmine #682 : Product page -> Bug selector
parent
1fed62e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
10 deletions
+40
-10
main.css
wp-content/themes/nap/assets/css/main.css
+4
-2
product.js
wp-content/themes/nap/assets/js/product.js
+15
-4
functions.php
wp-content/themes/nap/functions.php
+18
-1
simple.php
...mes/nap/woocommerce/single-product/add-to-cart/simple.php
+1
-1
variable.php
...s/nap/woocommerce/single-product/add-to-cart/variable.php
+2
-2
No files found.
wp-content/themes/nap/assets/css/main.css
View file @
9a817afa
...
...
@@ -1345,13 +1345,13 @@ aside.news-wrapper {
display
:
block
;
position
:
relative
;
cursor
:
pointer
;
padding-right
:
17px
;
}
.list
li
input
{
cursor
:
pointer
;
}
.pa_couleur
li
{
margin-bottom
:
21px
;
margin-right
:
17px
;
}
.pa_couleur
li
.selected
>
span
:first-child
,
.pa_couleur
li
.selected
>
span
:first-child
{
...
...
@@ -1443,8 +1443,9 @@ label.chevron.bottom::first-letter {
.pa_format
li
.format-desc
{
font-size
:
9px
;
line-height
:
12px
;
margin-top
:
4px
;
padding
:
0
2px
;
margin
:
4px
auto
8px
;
width
:
75%
;
}
.product-info
{
width
:
56.5%
;
...
...
@@ -1453,6 +1454,7 @@ label.chevron.bottom::first-letter {
height
:
100%
;
opacity
:
0
;
overflow
:
auto
;
overflow-x
:
hidden
;
}
.product-info
.info-content
{
text-align
:
center
;
...
...
wp-content/themes/nap/assets/js/product.js
View file @
9a817afa
...
...
@@ -104,10 +104,18 @@ $(function(){
})
}
$
.
fn
.
checkIfFormatDisabled
=
function
(){
var
format
=
getUrlParameter
(
'attribute_format'
);
var
activeImg
=
$
(
'.format-label #'
+
format
).
data
(
'img-active'
);
$
(
'.format-label #'
+
format
).
attr
(
'src'
,
activeImg
);
$
(
'.format-list'
).
each
(
function
()
{
var
icons
=
[];
//var format = getUrlParameter('pa_format');
//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
()
{
if
(
$
(
this
).
find
(
"input"
).
is
(
':disabled'
))
{
$
(
this
).
addClass
(
"disabled"
);
}
...
...
@@ -115,6 +123,9 @@ $(function(){
$
(
this
).
removeClass
(
"disabled"
);
}
});
})
/**/
}
$
.
fn
.
getDownloadCurrentSlideLink
=
function
(){
var
img_link
=
$
(
document
).
find
(
'.slick-current a'
).
attr
(
'href'
);
...
...
wp-content/themes/nap/functions.php
View file @
9a817afa
...
...
@@ -349,7 +349,17 @@ function nap_menu() {
}
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);
$couleur = $variable_product->get_attribute('couleur');
...
...
@@ -359,6 +369,7 @@ function nap_variation_url($variationID) {
$format_url = get_term_by('slug', $format, 'pa_format');
$url = '?attribute_couleur=' . $color_url->slug . '&attribute_format=' . $format_url->slug . '&variation_id=' . $variationID;
return preg_replace('/\s+/', '', $url);
END OLD NS */
}
function
nap_variation_color
(
$variationID
)
{
...
...
@@ -790,3 +801,9 @@ function nap_show_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
);
wp-content/themes/nap/woocommerce/single-product/add-to-cart/simple.php
View file @
9a817afa
...
...
@@ -130,7 +130,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div
class=
"info-content"
>
<?php
$formats
=
explode
(
','
,
nap_variation_format
(
$id
));
?>
<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"
>
<p
class=
"info-format-txt"
>
<?php
echo
$formats
[
0
];
?>
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/variable.php
View file @
9a817afa
...
...
@@ -36,7 +36,7 @@ if (!function_exists('print_attribute_radio')) {
function
print_attribute_radio
(
$checked_value
,
$value
,
$label
,
$name
,
$index
=
0
)
{
$current_color
=
$_GET
[
'
attribute
_couleur'
];
$current_color
=
$_GET
[
'
pa
_couleur'
];
$selected
=
$default_checked
=
""
;
if
(
$value
==
strtolower
(
$current_color
)){
$default_checked
=
"checked"
;
...
...
@@ -279,7 +279,7 @@ do_action('woocommerce_before_add_to_cart_form');
$format_info
=
get_term_by
(
'slug'
,
$format
,
'pa_format'
);
$format
=
$format_info
->
name
;
?>
<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"
>
<p
class=
"info-format-txt"
>
<?php
echo
$format
;
?>
</p>
<p
class=
"pq"
>
<?php
echo
nap_variable_meta
(
$current_variationID
,
'variation_description'
);
?>
</p>
...
...
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