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
e8622eb2
Commit
e8622eb2
authored
Aug 25, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix]Page product : Check refresh page
parent
30e4f7b6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
18 deletions
+31
-18
main.css
wp-content/themes/nap/assets/css/main.css
+2
-1
main.js
wp-content/themes/nap/assets/js/main.js
+2
-1
product.js
wp-content/themes/nap/assets/js/product.js
+5
-1
functions.php
wp-content/themes/nap/functions.php
+16
-5
simple.php
...mes/nap/woocommerce/single-product/add-to-cart/simple.php
+3
-6
variable.php
...s/nap/woocommerce/single-product/add-to-cart/variable.php
+3
-4
No files found.
wp-content/themes/nap/assets/css/main.css
View file @
e8622eb2
...
@@ -1818,12 +1818,13 @@ label.chevron.bottom::first-letter {
...
@@ -1818,12 +1818,13 @@ label.chevron.bottom::first-letter {
.filter-list
{
.filter-list
{
background
:
#fff
;
background
:
#fff
;
color
:
inherit
;
color
:
inherit
;
padding
:
98px
31px
15
px
30px
;
padding
:
98px
31px
30
px
30px
;
width
:
245px
;
width
:
245px
;
left
:
0
;
left
:
0
;
opacity
:
0
;
opacity
:
0
;
visibility
:
hidden
;
visibility
:
hidden
;
margin-left
:
-4px
;
margin-left
:
-4px
;
overflow
:
auto
;
}
}
.filter-list
.top-header
{
.filter-list
.top-header
{
margin-bottom
:
25px
;
margin-bottom
:
25px
;
...
...
wp-content/themes/nap/assets/js/main.js
View file @
e8622eb2
...
@@ -113,7 +113,7 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
...
@@ -113,7 +113,7 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
})
})
//END get file name
//END get file name
//END load content page on left Panel
//END load content page on left Panel
$
(
document
).
on
(
'click'
,
'.
close-panel:not(.ext-link)
'
,
function
(
e
){
$
(
document
).
on
(
'click'
,
'.
int-link
'
,
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
$
(
'.load-page'
).
parent
().
removeClass
(
'active'
);
$
(
'.load-page'
).
parent
().
removeClass
(
'active'
);
history
.
pushState
(
null
,
null
,
$
(
this
).
find
(
'a'
).
attr
(
'href'
));
history
.
pushState
(
null
,
null
,
$
(
this
).
find
(
'a'
).
attr
(
'href'
));
...
@@ -124,6 +124,7 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
...
@@ -124,6 +124,7 @@ $('.footer-home-content').on('click','.home-down:not(.scrolled)',function(e){
$
(
document
).
on
(
'click'
,
'.acces li .login'
,
function
(
e
){
$
(
document
).
on
(
'click'
,
'.acces li .login'
,
function
(
e
){
e
.
stopImmediatePropagation
();
e
.
stopImmediatePropagation
();
$
(
'.popup-container'
).
fadeIn
();
$
(
'.popup-container'
).
fadeIn
();
$
(
".c-hamburger"
).
trigger
(
"click"
);
// $('#user_login').attr('placeholder', 'Identifiant');
// $('#user_login').attr('placeholder', 'Identifiant');
// $('#user_pass').attr('placeholder', 'Mot de passe');
// $('#user_pass').attr('placeholder', 'Mot de passe');
$
(
'.popup-first'
).
removeClass
(
'fadeOutDown '
).
addClass
(
'animated visible-elem pulse'
);
$
(
'.popup-first'
).
removeClass
(
'fadeOutDown '
).
addClass
(
'animated visible-elem pulse'
);
...
...
wp-content/themes/nap/assets/js/product.js
View file @
e8622eb2
...
@@ -20,6 +20,7 @@ function loadProductContent() {
...
@@ -20,6 +20,7 @@ function loadProductContent() {
$
(
'.pa_couleur li'
).
selectColor
();
$
(
'.pa_couleur li'
).
selectColor
();
$
(
'.pa_format li'
).
selectFormat
();
$
(
'.pa_format li'
).
selectFormat
();
$
(
'.color-list.selected'
).
selectSlide
(
$
(
'#slides'
));
$
(
'.color-list.selected'
).
selectSlide
(
$
(
'#slides'
));
//$('.btn-wrapper.close-panel').addClass('int-link');
},
100
)
},
100
)
$
(
'.download-btn:not(.download_file)'
).
click
(
function
(
e
){
$
(
'.download-btn:not(.download_file)'
).
click
(
function
(
e
){
e
.
stopPropagation
();
e
.
stopPropagation
();
...
@@ -175,10 +176,13 @@ $(function(){
...
@@ -175,10 +176,13 @@ $(function(){
tlProduct
.
fromTo
(
'.product-info'
,
0.4
,{
autoAlpha
:
0
,
marginLeft
:
"-10%"
},{
autoAlpha
:
1
,
marginLeft
:
"0"
},
0.5
);
tlProduct
.
fromTo
(
'.product-info'
,
0.4
,{
autoAlpha
:
0
,
marginLeft
:
"-10%"
},{
autoAlpha
:
1
,
marginLeft
:
"0"
},
0.5
);
}
}
$
(
'.product-list article img, .product-list article ul li'
).
on
(
'click'
,
function
()
{
$
(
'.product-list article img, .product-list article ul li'
).
on
(
'click'
,
function
()
{
//localStorage['from-site'] = true;
$
(
'head'
).
append
(
$
(
'.header-shop'
));
$
(
'head'
).
append
(
$
(
'.header-shop'
));
var
toLink
=
$
(
this
).
data
(
'link'
);
var
toLink
=
$
(
this
).
data
(
'link'
);
history
.
pushState
(
null
,
null
,
toLink
);
history
.
pushState
(
null
,
null
,
toLink
);
// $.post(toLink, { fromSite: true});
//$.cookie("formSite", 1);
sessionStorage
.
setItem
(
"formSite"
,
"yes"
);
$
(
'.load-page'
).
parent
().
addClass
(
'active'
);
$
(
'.load-page'
).
parent
().
addClass
(
'active'
);
$
(
'.load-page'
).
load
(
toLink
,
function
(){
$
(
'.load-page'
).
load
(
toLink
,
function
(){
loadProductContent
();
loadProductContent
();
...
...
wp-content/themes/nap/functions.php
View file @
e8622eb2
...
@@ -652,16 +652,27 @@ function nap_save_general_proddata_custom_field($post_id) {
...
@@ -652,16 +652,27 @@ function nap_save_general_proddata_custom_field($post_id) {
}
}
}
}
session_start
();
$ref
=
false
;
//MS 2017-08-02 : Get referrer
//MS 2017-08-02 : Get referrer
function
externe_referrer
()
{
function
externe_referrer
()
{
session_start
();
$url
=
$_SERVER
[
'HTTP_REFERER'
];
$url
=
$_SERVER
[
'HTTP_REFERER'
];
$postid
=
url_to_postid
(
$url
);
$postid
=
url_to_postid
(
$url
);
$
ref
=
fals
e
;
$
notRefreshed
=
tru
e
;
$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'
||
$_SERVER
[
'HTTP_CACHE_CONTROL'
]
==
'no-cache'
);
if
(
$pageWasRefreshed
||
empty
(
$url
))
{
//The second parameter on print_r returns the result to a variable rather than displaying it
$ref
=
true
;
$RequestSignature
=
md5
(
$_SERVER
[
'REQUEST_URI'
]
.
$_SERVER
[
'QUERY_STRING'
]
.
print_r
(
$_POST
,
true
));
}
if
((
$pageWasRefreshed
||
empty
(
$url
)
))
// && (from-site) //$_SESSION['LastRequest'] == $RequestSignature
{
$ref
=
true
;
}
else
{
$ref
=
false
;
$_SESSION
[
'LastRequest'
]
=
$RequestSignature
;
}
return
$ref
;
return
$ref
;
}
}
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/simple.php
View file @
e8622eb2
...
@@ -12,12 +12,9 @@ $parent_cat = wp_get_post_terms($product->get_id(), 'product_cat', array('parent
...
@@ -12,12 +12,9 @@ $parent_cat = wp_get_post_terms($product->get_id(), 'product_cat', array('parent
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'all'
));
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'all'
));
$ext_ref
=
externe_referrer
();
$ext_ref
=
externe_referrer
();
$class_back
=
""
;
$category_link
=
get_category_link
(
$parent_cat
[
0
]);
if
(
$ext_ref
)
{
if
(
!
$ext_ref
)
{
$category_link
=
get_category_link
(
$parent_cat
[
0
]);
$class_back
=
"int-link"
;
$class_back
=
"ext-link"
;
}
else
{
$category_link
=
"#"
;
}
}
do_action
(
'woocommerce_before_add_to_cart_form'
);
do_action
(
'woocommerce_before_add_to_cart_form'
);
?>
?>
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/variable.php
View file @
e8622eb2
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* happen. When this occurs the version of the template file will be bumped and
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
* the readme will list any important changes.
*
*
* @see
https://docs.woocommerce.com/document/template-structure/
* @see
https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @author WooThemes
* @package WooCommerce/Templates
* @package WooCommerce/Templates
* @version 3.0.0
* @version 3.0.0
...
@@ -28,10 +28,9 @@ $parent_cat = wp_get_post_terms($product->get_id(), 'product_cat', array( 'paren
...
@@ -28,10 +28,9 @@ $parent_cat = wp_get_post_terms($product->get_id(), 'product_cat', array( 'paren
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'all'
));
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'all'
));
$current_variationID
=
$_GET
[
'variation_id'
];
$current_variationID
=
$_GET
[
'variation_id'
];
$ext_ref
=
externe_referrer
();
$ext_ref
=
externe_referrer
();
$class_back
=
""
;
$category_link
=
get_category_link
(
$parent_cat
[
0
]);
$category_link
=
get_category_link
(
$parent_cat
[
0
]);
if
(
$ext_ref
)
{
if
(
!
$ext_ref
)
{
$class_back
=
"
ex
t-link"
;
$class_back
=
"
in
t-link"
;
}
}
if
(
!
function_exists
(
'print_attribute_radio'
))
{
if
(
!
function_exists
(
'print_attribute_radio'
))
{
...
...
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