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
0ea3dfba
Commit
0ea3dfba
authored
Jul 31, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction sub cat + order
parent
5601f964
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
55 deletions
+11
-55
archive-product.php
wp-content/themes/nap/woocommerce/archive-product.php
+3
-3
simple.php
...mes/nap/woocommerce/single-product/add-to-cart/simple.php
+4
-48
variable.php
...s/nap/woocommerce/single-product/add-to-cart/variable.php
+4
-4
No files found.
wp-content/themes/nap/woocommerce/archive-product.php
View file @
0ea3dfba
...
...
@@ -114,7 +114,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
<h2
class=
"crete small-title"
>
<?php
echo
$value
->
name
?>
</h2>
<div
class=
"product-list"
>
<?php
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$value
->
name
);
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'
orderby'
=>
'title'
,
'order'
=>
'ASC'
,
'
posts_per_page'
=>
-
1
,
'product_cat'
=>
$value
->
name
);
$naps_posts
=
new
WP_Query
(
$args
);
$options
=
array
();
...
...
@@ -126,8 +126,8 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
'post_type'
=>
array
(
'product'
,
'product_variation'
),
'post_status'
=>
array
(
'private'
,
'publish'
),
'numberposts'
=>
-
1
,
'orderby'
=>
'
menu_order
'
,
'order'
=>
'
asc
'
,
'orderby'
=>
'
title
'
,
'order'
=>
'
ASC
'
,
'post_parent'
=>
$id
);
?>
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/simple.php
View file @
0ea3dfba
...
...
@@ -22,53 +22,9 @@ if (!defined('ABSPATH')) {
global
$product
;
$id
=
get_the_ID
();
$product_cats
=
wp_get_post_terms
(
$id
,
'product_cat'
);
//print_r($product_cats);
$subcat_iD
=
$product_cats
[
0
]
->
term_id
;
//$current_variationID = $_GET['variation_id'];
$parent_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
0
,
'fields'
=>
'ids'
));
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'names'
));
/* if (!function_exists('print_attribute_radio')) {
function print_attribute_radio($checked_value, $value, $label, $name, $index=0) {
$current_color = $_GET['attribute_couleur'];
$selected = $default_checked = "";
if ($value == strtolower($current_color)){
$default_checked = "checked";
$selected = "selected";
}
$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);
$esc_value = esc_attr($value);
$id = esc_attr($name . '_v_' . $value);
if ($name == 'pa_couleur') {
$hexa = nap_color_attribute($value);
$filtered_label = apply_filters('woocommerce_variation_option_name', $label);
printf(' <style>
#' . $id . ':after { background-color: ' . $hexa . '; }
</style><li class="color-list '.$selected.' " data-color="' . $hexa . '">
<input data-color="' . $hexa . '" type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s ' . $default_checked . '></li>', $input_name, $esc_value, $id, $checked, $filtered_label);
} else {
$icons = nap_icon_format($value);
$format_img='<img src="'.$icons['inactive'].'" data-img = "'.$icons['inactive'].'" data-img-active = "'.$icons['active'].'" id="format_'.$index.'">';
$filtered_label = apply_filters('woocommerce_variation_option_name', $label);
printf('<li class="format-list selected"><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">'.$value.'</span>
</li>', $input_name, $esc_value, $id, $checked, $filtered_label); //<label class="format-label" style="background:url(' . $icons['inactive'] . ')" for="%3$s"></label>
}
}
}
*
*/
do_action
(
'woocommerce_before_add_to_cart_form'
);
?>
...
...
@@ -80,7 +36,7 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
<div
class=
"product-slides row"
>
<div
class=
"product-header"
>
<h2
class=
"crete -italic font-small"
>
<?php
echo
$
product_cats
[
0
]
->
name
?>
</h2>
<h2
class=
"crete -italic font-small"
>
<?php
echo
$
sub_cat
[
0
]
?>
</h2>
<h3
class=
"crete"
>
<?php
the_title
();
?>
</h3>
</div>
<div
class=
"slides-wrapper center"
>
...
...
@@ -166,7 +122,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div
class=
"product-info row center right border-l"
>
<div
class=
"info-content"
>
<?php
$formats
=
explode
(
','
,
nap_variation_format
(
$id
));
?>
<h2
class =
"crete font-small"
>
<?php
echo
$
product_cats
[
0
]
->
name
?>
</h2>
<h2
class =
"crete font-small"
>
<?php
echo
$
sub_cat
[
0
]
?>
</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>
<div
class=
"details font-small"
>
<p
class=
"info-format-txt"
>
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/variable.php
View file @
0ea3dfba
...
...
@@ -24,9 +24,9 @@ global $product;
$attribute_keys
=
array_keys
(
$attributes
);
$product_cats
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
);
$parent_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
0
,
'fields'
=>
'ids'
));
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'names'
));
$subcat_iD
=
$product_cats
[
1
]
->
term_id
;
$current_variationID
=
$_GET
[
'variation_id'
];
if
(
!
function_exists
(
'print_attribute_radio'
))
{
...
...
@@ -80,7 +80,7 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
<div
class=
"product-slides row"
>
<div
class=
"product-header"
>
<h2
class=
"crete -italic font-small"
>
<?php
echo
$
product_cats
[
1
]
->
name
?>
</h2>
<h2
class=
"crete -italic font-small"
>
<?php
echo
$
sub_cat
[
0
];
?>
</h2>
<h3
class=
"crete"
>
<?php
the_title
();
?>
</h3>
</div>
<div
class=
"slides-wrapper center"
>
...
...
@@ -245,7 +245,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div
class=
"product-info row center left border-l"
>
<div
class=
"info-content"
>
<h2
class =
"crete font-small"
>
<?php
echo
$
product_cats
[
1
]
->
name
?>
</h2>
<h2
class =
"crete font-small"
>
<?php
echo
$
sub_cat
[
0
];
?>
</h2>
<h3
class =
"crete font-small info-attr"
><span
class=
"info-format"
>
<?php
echo
$_GET
[
'attribute_format'
]
?>
</span>
<span
class=
"info-color"
>
<?php
echo
$_GET
[
'attribute_couleur'
]
?>
</span></h3>
<div
class=
"details font-small"
>
<p
class=
"info-format-txt"
>
<?php
echo
$_GET
[
'attribute_format'
]
?>
</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