‘;
$html .= ‘
$tag = wp_tag_cloud( array(
‘format’ => ‘array’,
‘taxonomy’ => ‘product_tag’
) );
$page_path = $_SERVER[„REQUEST_URI“];
$page_url = site_url() . $page_path;
$url_parts = parse_url($page_url);
$constructed_url = $url_parts[‘scheme’] . ‘://’ . $url_parts[‘host’] . (isset($url_parts[‘path’])?$url_parts[‘path’]:“);
$html .= ‘‘;
foreach($tag as $tagkey => $tagvalue)
{
$cleanedup = strip_tags($tagvalue);
$tag_info = get_term_by(‘name’, $cleanedup, ‘product_tag’, ‘ARRAY_A’);
$tag_slug = $tag_info[‘slug’];
if(isset($_GET[‘product_tag’])) {
$value_url = $constructed_url . ‘?product_tag=’ . $tag_slug;
} else {
$value_url = $page_url . ‘?product_tag=’ . $tag_slug;
}
$html .= ‘‘;
}
$html .= ‘‘;
$html .= ‘‘;
$html .= ‘
‘;
echo $html;
}
add_action(‘woocommerce_before_shop_loop’, ‘displayLocationDropdown’, 40);
add_action(‘wp_head’, ‘addDisplayLocationScript’);
function addDisplayLocationScript() {
$script = “;
$script .= ‘‘;
echo $script;
}
Последни ревюта: