Commit 349939a3 authored by imac's avatar imac

[Merge]

parent 1bc53557
......@@ -290,7 +290,7 @@ function nap_menu() {
$menu = "";
$taxonomy = 'product_cat';
$orderby = 'title';
$orderby = 'id';
$show_count = 0;
$pad_counts = 0;
$hierarchical = 1;
......@@ -316,7 +316,7 @@ function nap_menu() {
'taxonomy' => $taxonomy,
'child_of' => 0,
'parent' => $category_id,
'orderby' => $orderby,
'orderby' => 'title',
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
......@@ -597,5 +597,41 @@ function nap_save_general_proddata_custom_field( $post_id ) {
update_post_meta( $post_id, '_itf14_simple', esc_attr( $text_itf14 ) );
}
}
//MS 2017-08-02 : Get referrer
function externe_referrer( ) {
$url = $_SERVER['HTTP_REFERER'];
$postid = url_to_postid( $url );
$ref = false;
$uri = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';
if($pageWasRefreshed ) {
$postid = -1;
} else{
$postid = 0;
}
if ($postid < 0){
$ref = true;
}
echo $postid;
if($pageWasRefreshed ) {
$postid = -1;
}
global $post;
$terms = get_the_terms( $post->ID, 'product_cat' );
foreach ( $terms as $term ) {
$product_cat_id = $term->term_id;
echo 'prod_eeeeee === '. $product_cat_id;
break;
return $ref ;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment