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
1bc53557
Commit
1bc53557
authored
Aug 03, 2017
by
imac
Browse files
Options
Browse Files
Download
Plain Diff
[Merge]
parents
bbd65944
28e5ba5b
Hide 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 @
1bc53557
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
* 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 2.0.0
* @version 2.0.0
*/
*/
if
(
!
defined
(
'ABSPATH'
))
{
if
(
!
defined
(
'ABSPATH'
))
{
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/simple.php
View file @
1bc53557
...
@@ -22,53 +22,9 @@ if (!defined('ABSPATH')) {
...
@@ -22,53 +22,9 @@ if (!defined('ABSPATH')) {
global
$product
;
global
$product
;
$id
=
get_the_ID
();
$id
=
get_the_ID
();
$product_cats
=
wp_get_post_terms
(
$id
,
'product_cat'
);
$parent_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
0
,
'fields'
=>
'ids'
));
//print_r($product_cats);
$sub_cat
=
wp_get_post_terms
(
$product
->
get_id
(),
'product_cat'
,
array
(
'parent'
=>
$parent_cat
[
0
],
'fields'
=>
'names'
));
$subcat_iD
=
$product_cats
[
0
]
->
term_id
;
//$current_variationID = $_GET['variation_id'];
/* 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'
);
do_action
(
'woocommerce_before_add_to_cart_form'
);
?>
?>
...
@@ -80,7 +36,7 @@ do_action('woocommerce_before_add_to_cart_form');
...
@@ -80,7 +36,7 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
</div>
<div
class=
"product-slides row"
>
<div
class=
"product-slides row"
>
<div
class=
"product-header"
>
<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>
<h3
class=
"crete"
>
<?php
the_title
();
?>
</h3>
</div>
</div>
<div
class=
"slides-wrapper center"
>
<div
class=
"slides-wrapper center"
>
...
@@ -166,7 +122,7 @@ do_action('woocommerce_before_add_to_cart_form');
...
@@ -166,7 +122,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div
class=
"product-info row center right border-l"
>
<div
class=
"product-info row center right border-l"
>
<div
class=
"info-content"
>
<div
class=
"info-content"
>
<?php
$formats
=
explode
(
','
,
nap_variation_format
(
$id
));
?>
<?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>
<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"
>
<div
class=
"details font-small"
>
<p
class=
"info-format-txt"
>
<p
class=
"info-format-txt"
>
...
...
wp-content/themes/nap/woocommerce/single-product/add-to-cart/variable.php
View file @
1bc53557
...
@@ -24,9 +24,9 @@ global $product;
...
@@ -24,9 +24,9 @@ global $product;
$attribute_keys
=
array_keys
(
$attributes
);
$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'
];
$current_variationID
=
$_GET
[
'variation_id'
];
if
(
!
function_exists
(
'print_attribute_radio'
))
{
if
(
!
function_exists
(
'print_attribute_radio'
))
{
...
@@ -80,7 +80,7 @@ do_action('woocommerce_before_add_to_cart_form');
...
@@ -80,7 +80,7 @@ do_action('woocommerce_before_add_to_cart_form');
</div>
</div>
<div
class=
"product-slides row"
>
<div
class=
"product-slides row"
>
<div
class=
"product-header"
>
<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>
<h3
class=
"crete"
>
<?php
the_title
();
?>
</h3>
</div>
</div>
<div
class=
"slides-wrapper center"
>
<div
class=
"slides-wrapper center"
>
...
@@ -245,7 +245,7 @@ do_action('woocommerce_before_add_to_cart_form');
...
@@ -245,7 +245,7 @@ do_action('woocommerce_before_add_to_cart_form');
<div
class=
"product-info row center left border-l"
>
<div
class=
"product-info row center left border-l"
>
<div
class=
"info-content"
>
<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>
<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"
>
<div
class=
"details font-small"
>
<p
class=
"info-format-txt"
>
<?php
echo
$_GET
[
'attribute_format'
]
?>
</p>
<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