Commit 94728130 authored by Nahla Shiri's avatar Nahla Shiri

correction url variation

parent f9152b78
......@@ -320,8 +320,10 @@ function nap_variation_url($variationID) {
$variable_product = wc_get_product($variationID);
$couleur = $variable_product->get_attribute('couleur');
$color_url = get_term_by('slug', $couleur, 'pa_couleur');
$format = $variable_product->get_attribute('format');
$url = '?attribute_couleur=' . $couleur . '&attribute_format=' . $format . '&variation_id=' . $variationID;
$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);
}
......
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