Home › Forums › WoodMart support forum › Link Failure – Forwarding – Productpage – Brands Image Icon
Link Failure – Forwarding – Productpage – Brands Image Icon
- This topic has 14 replies, 4 voices, and was last updated 6 years, 1 month ago by Artem Temos.
-
AuthorPosts
-
September 28, 2018 at 10:04 am #79628
CeroParticipantLink Failure – Forwarding – Productpage – Brands Image Icon
I i click on Productpage the Brandimage its forwarding too:https://xxx.xx/shop/hyaluronsaeure-serum-hyaluronic-acid-anti-aging/?filter_brand=dnc-cosmetics
but it must:
https://xxx.xx/shop/?filter_brand=dnc-cosmetics
Please tell me FIX
you can check it live on Kosmetik Shop
September 28, 2018 at 10:22 am #79632
Elise NoromitMemberHello,
Please navigate to Settings > Permalink and try to configure links for attributes there. Our theme does not influence on the generation of the URL.
Best Regards
September 29, 2018 at 12:24 am #79748
CeroParticipantI added all Permalinks an other Name. Not working.. The same Problematic
September 29, 2018 at 6:04 am #79758
Elise NoromitMemberHello,
Please provide your site admin access and FTP
Best Regards
September 29, 2018 at 8:12 am #79777
CeroParticipantFTP and WP ADMIN in the Private Content thx
September 29, 2018 at 3:25 pm #79827
Eric WatsonParticipantHello,
Try to add the following PHP code snippet to the child theme functions.php file to do this
function woodmart_product_brand() { global $product; $attr = woodmart_get_opt( 'brands_attribute' ); if( ! $attr || ! woodmart_get_opt( 'product_page_brand' ) ) return; $attributes = $product->get_attributes(); if( ! isset( $attributes[ $attr ] ) || empty( $attributes[ $attr ] ) ) return; $brands = wc_get_product_terms( $product->get_id(), $attr, array( 'fields' => 'all' ) ); if( empty( $brands ) ) return; if ( defined( 'SHOP_IS_ON_FRONT' ) ) { $link = home_url(); } else { $link = get_permalink( wc_get_page_id( 'shop' ) ); } $classes = ( woodmart_get_opt( 'product_brand_location' ) == 'sidebar' && ! woodmart_loop_prop( 'is_quick_view' ) ) ? 'widget sidebar-widget' : ''; echo '<div class="woodmart-product-brands '. esc_attr( $classes ) .'">'; foreach ($brands as $brand) { $image = get_term_meta( $brand->term_id, 'image', true); $filter_name = 'filter_' . sanitize_title( str_replace( 'pa_', '', $attr ) ); $attr_link = apply_filters( 'woodmart_brands_link', add_query_arg( $filter_name, $brand->slug, $link ), $brand ); if( ! empty( $image ) ) { echo '<div class="woodmart-product-brand">'; echo '<a href="' . esc_url( $attr_link ) . '"><img src="' . esc_url( $image ) . '" title="' . esc_attr( $brand->slug ) . '" alt="' . esc_attr( $brand->slug ) . '" /></a>'; echo '</div>'; } } echo '</div>'; }
Kind Regards
XTemos StudioSeptember 30, 2018 at 1:18 am #79880
CeroParticipantThanks
IT working if i am on Productpage but not in Pre-Footer Widget.
he always throws the filter string behind the link
September 30, 2018 at 12:02 pm #79919
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file
function woodmart_product_brands_links() { global $product; $brand_option = woodmart_get_opt( 'brands_attribute' ); $brands = wc_get_product_terms( $product->get_id(), $brand_option, array( 'fields' => 'all' ) ); if( !woodmart_get_opt( 'brands_under_title' ) || empty( $brands ) ) return; $link = ( defined( 'SHOP_IS_ON_FRONT' ) ) ? home_url() : get_permalink( wc_get_page_id( 'shop' ) ); echo '<div class="woodmart-product-brands-links">'; foreach ( $brands as $brand ) { $filter_name = 'filter_' . sanitize_title( str_replace( 'pa_', '', $brand_option ) ); $attr_link = apply_filters( 'woodmart_brands_link', add_query_arg( $filter_name, $brand->slug, $link ), $brand ); $sep = ', '; if ( end( $brands ) == $brand ) $sep = ''; echo '<a href="' . esc_url( $attr_link ) . '">' . $brand->name . '</a>' . $sep; } echo '</div>'; }
October 1, 2018 at 7:32 pm #80206
CeroParticipantIf i click on Footer a Brand after Product Category or A other Site selected. He is pasting after the /SLASH and not after the Domainname. everytime… every new session with brands. You ve a Failure in the ground of the Page with linking i think….
And the second question is:
Can i delete Querystring
?filter_brand=cosmeticbag
and make it clean for seo as /Cosmeticbag or /Brand-Cosmeticbag or the same.October 2, 2018 at 6:31 am #80246
Artem TemosKeymasterTry to tick an option “Enable archives” for your brand product attribute in Dashboard -> Products -> Attributes and add the following code to the functions.php`
add_filter( 'woodmart_brands_link', function( $link, $brand ){ return get_term_link( $brand->term_id, $brand->taxonomy ); }, 10, 2 );
November 3, 2018 at 5:30 pm #86962
CeroParticipantCan you check this? Not working…
<?php /** * Enqueue script and styles for child theme */ function woodmart_child_enqueue_styles() { wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'woodmart-style' ), woodmart_get_theme_info( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'woodmart_child_enqueue_styles', 1000 ); /** * Query string archve */ add_filter( 'woodmart_brands_link', function( $link, $brand ){ return get_term_link( $brand->term_id, $brand->taxonomy ); }, 10, 2 ); //Warenkorb Button umbenennenung auf kaufen add_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); // < 2.1 add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); // 2.1 + function woo_custom_single_add_to_cart_text() { return __( 'kaufen', 'woocommerce' ); } // remove version from rss add_filter('the_generator', '__return_empty_string'); // No need to do anything if there isn't any content if ( empty( $content ) ) { return $content; } // Define links array $links = array(); // Get page content libxml_use_internal_errors(TRUE); $html = new DomDocument; $html->loadHTML( $content ); $html->preserveWhiteSpace = false; // Loop through all content links foreach( $html->getElementsByTagName( 'a' ) as $link ) { // If the title attribute is already defined no need to do anything if ( ! empty( $link->getAttribute( 'title' ) ) ) { continue; } // Get link text $link_text = $link->textContent; // Save links and link text in $links array if ( $link_text ) { $links[$link_text] = $link->getAttribute( 'href' ); } } // Loop through links array and update post content to add link titles if ( ! empty( $links ) ) { foreach ( $links as $text => $link ) { if ( $link && $text ) { $text = esc_attr( $text ); // Sanitize $text = ucwords( $text ); // Captilize words (looks better imo) $replace = $link .'" title="'. $text .'"'; // Add title to link $content = str_replace( $link .'"', $replace, $content ); // Replace post content } } } // Return post content return $content; } function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; return "$url' defer "; } //* TN - Remove Query String from Static Resources function remove_css_js_ver( $src ) { if( strpos( $src, '?ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src; } add_filter( 'style_loader_src', 'remove_css_js_ver', 10, 2 ); add_filter( 'script_loader_src', 'remove_css_js_ver', 10, 2 ); /*SUPORT BRANDS*/ function woodmart_product_brand() { global $product; $attr = woodmart_get_opt( 'brands_attribute' ); if( ! $attr || ! woodmart_get_opt( 'product_page_brand' ) ) return; $attributes = $product->get_attributes(); if( ! isset( $attributes[ $attr ] ) || empty( $attributes[ $attr ] ) ) return; $brands = wc_get_product_terms( $product->get_id(), $attr, array( 'fields' => 'all' ) ); if( empty( $brands ) ) return; if ( defined( 'SHOP_IS_ON_FRONT' ) ) { $link = home_url(); } else { $link = get_permalink( wc_get_page_id( 'shop' ) ); } $classes = ( woodmart_get_opt( 'product_brand_location' ) == 'sidebar' && ! woodmart_loop_prop( 'is_quick_view' ) ) ? 'widget sidebar-widget' : ''; echo '<div class="woodmart-product-brands '. esc_attr( $classes ) .'">'; foreach ($brands as $brand) { $image = get_term_meta( $brand->term_id, 'image', true); $filter_name = 'filter_' . sanitize_title( str_replace( 'pa_', '', $attr ) ); $attr_link = apply_filters( 'woodmart_brands_link', add_query_arg( $filter_name, $brand->slug, $link ), $brand ); if( ! empty( $image ) ) { echo '<div class="woodmart-product-brand">'; echo '<a href="' . esc_url( $attr_link ) . '"><img src="' . esc_url( $image ) . '" title="' . esc_attr( $brand->slug ) . '" alt="' . esc_attr( $brand->slug ) . '" /></a>'; echo '</div>'; } } echo '</div>'; }
November 3, 2018 at 6:44 pm #86964
CeroParticipantIts working on side but not with the Jcomposser Plugin woodmart_brands
[vc_row full_width=”stretch_row_content” css=”.vc_custom_1541270160108{margin-top: -2vh !important;margin-bottom: -5vh !important;padding-top: 0px !important;padding-bottom: 0px !important;background-color: #fcfcfc !important;}” woodmart_parallax=”0″ woodmart_gradient_switch=”no” row_reverse_mobile=”0″ row_reverse_tablet=”0″ woodmart_disable_overflow=”0″][vc_column woodmart_color_scheme=”dark” woodmart_parallax=”0″ parallax_scroll=”no” woodmart_sticky_column=”false” css=”.vc_custom_1541270150069{margin: 0px !important;padding: 0px !important;}”][woodmart_brands orderby=”random” order=”DESC” hover=”simple” brand_style=”default” style=”grid” ids=”” columns=”4″ number=”4″][/vc_column][/vc_row]
November 3, 2018 at 7:59 pm #86978
Artem TemosKeymasterIt seems that you added the code but didn’t activate the child theme in the dashboard.
November 4, 2018 at 2:21 am #86999
CeroParticipantok sorry thanks
November 4, 2018 at 8:32 am #87024
Artem TemosKeymasterYou are welcome.
-
AuthorPosts
Tagged: brands, Forwarding, url, woocommerce
- You must be logged in to create new topics. Login / Register