Home Forums WoodMart support forum Link Failure – Forwarding – Productpage – Brands Image Icon

Link Failure – Forwarding – Productpage – Brands Image Icon

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #79628

    Cero
    Participant

    Link 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

    #79632

    Hello,

    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

    #79748

    Cero
    Participant

    I added all Permalinks an other Name. Not working.. The same Problematic

    #79758

    Hello,

    Please provide your site admin access and FTP

    Best Regards

    #79777

    Cero
    Participant

    FTP and WP ADMIN in the Private Content thx

    #79827

    Eric Watson
    Participant

    Hello,

    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 Studio

    #79880

    Cero
    Participant

    Thanks

    IT working if i am on Productpage but not in Pre-Footer Widget.

    he always throws the filter string behind the link

    #79919

    Artem Temos
    Keymaster

    Try 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>';
    	}
    #80206

    Cero
    Participant

    https://cosmeticbag.de/Kosmetik-Shop/wimpernserum-wimpernverlaengerung-serum-eyelashes/?filter_brand=cosmeticbag

    If 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.

    #80246

    Artem Temos
    Keymaster

    Try 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 );
    #86962

    Cero
    Participant

    Can you check this? Not working…

    BEAUTY

    <?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>';
    
    	}
    #86964

    Cero
    Participant

    Its 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]

    #86978

    Artem Temos
    Keymaster

    It seems that you added the code but didn’t activate the child theme in the dashboard.

    #86999

    Cero
    Participant

    ok sorry thanks

    #87024

    Artem Temos
    Keymaster

    You are welcome.

Viewing 15 posts - 1 through 15 (of 15 total)