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
94728130
Commit
94728130
authored
Jul 21, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction url variation
parent
f9152b78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
functions.php
wp-content/themes/nap/functions.php
+4
-2
No files found.
wp-content/themes/nap/functions.php
View file @
94728130
...
...
@@ -320,8 +320,10 @@ function nap_variation_url($variationID) {
$variable_product
=
wc_get_product
(
$variationID
);
$couleur
=
$variable_product
->
get_attribute
(
'couleur'
);
$format
=
$variable_product
->
get_attribute
(
'format'
);
$url
=
'?attribute_couleur='
.
$couleur
.
'&attribute_format='
.
$format
.
'&variation_id='
.
$variationID
;
$color_url
=
get_term_by
(
'slug'
,
$couleur
,
'pa_couleur'
);
$format
=
$variable_product
->
get_attribute
(
'format'
);
$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
);
}
...
...
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