Home Forums WoodMart support forum Banner links not working

Banner links not working

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #176338

    ex501
    Participant

    Banner links are not working on my website. Actually few of them stopped working on main page.
    Please check private content:

    #176357

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #176366

    ex501
    Participant

    Ok but I doubt it’s plugin because one of the banners is working and banners on other pages are working as well.

    Check private content:

    #176368

    Artem Temos
    Keymaster

    We were not able to login with this data and can’t retry now https://gyazo.com/484d88a5add7874a7df8e08e25f88e8f

    #176439

    ex501
    Participant

    Check private

    #176489

    Artem Temos
    Keymaster

    Could you please send us your FTP access as well? And switch to the parent theme too.

    #176502

    ex501
    Participant

    Credentials are below

    #176506

    Artem Temos
    Keymaster

    Please, disable all external plugins and the child theme. And your FTP access is empty. If you can’t do this, you need to create a staging development copy of your website. There, you will be able to do such kind of experiments without any harm to your production website.

    Kind Regards

    #176509

    ex501
    Participant

    Please try again.
    It seems that WPML is screwing up banners links …

    #176523

    Artem Temos
    Keymaster

    Strange but it seems that WPML somehow modifies the link and breaks it. Try to contact WPML devs to investigate this issue. As for workaround, you can edit this file wp-content/themes/woodmart/inc/shortcodes/promo-banner.php and replace the code from

    $onclick = 'window.location.href=\''. esc_url( $attributes['url'] ).'\'';

    to

    $onclick = 'window.location.href=\''. $attributes['url'] .'\'';

    as shown on the screenshot http://prntscr.com/r8d9fp

    #176546

    ex501
    Participant

    your alternative didn’t work :/

    #176599

    Artem Temos
    Keymaster

    Please, send us a screenshot where you have changed the code so we can check it.

    #176637

    ex501
    Participant

    Here is screen of modified code: https://c2n.me/46cDWGe

    Problem is still there. WPML says that I shall contact theme authors and you say that I shall contact WPML….

    #176639

    Artem Temos
    Keymaster

    But what exactly should we fix from our theme side? It is just a regular link and WPML seems to break it somehow. It is not something that our theme breaks in WPML but the WPML breaks in the theme. If there are some requirements from their side then we will be glad to help you to implement this.

    As a workaround, try to replace this code

    <div id="<?php echo esc_attr( $id ); ?>" class="promo-banner<?php echo esc_attr( $class ); ?>" <?php if( $link && $attributes['url'] ) echo 'onclick="' . $onclick . '"'; ?> >

    with this on

    <div id="<?php echo esc_attr( $id ); ?>" class="promo-banner<?php echo esc_attr( $class ); ?>" data-click="<?php echo esc_url( $attributes['url'] ); ?>">

    and put the following code to the Custom JS field in Theme Settings

    jQuery('.promo-banner').on('click', function(){
    	if (jQuery(this).data('click')) {
    		window.location.href=jQuery(this).data('click');
    	}
    });
    #176653

    ex501
    Participant

    Your patch works. Thank you! I assume I will have to do this every time when I update theme.
    I will bother WPML support to fix this issue, I am sure other woodmart users may have a problem.

    #176654

    Artem Temos
    Keymaster

    Fine, contact us if you will have any further information about the issue.

    #223034

    incomaz
    Participant

    In the latest version of Woodmart, I have observed that the LINK does not work on the promotional banner.

    To solve it I have modified the file
    wp-content/themes/woodmart/inc/shortcodes/promo-banner.php.

    I have replaced:

    if ( strrpos( $link, '|') ){
    			$attributes = woodmart_vc_get_link_attr( $link );
    		}else{
    			$attributes = array(
    				'target' => '',
    				'url' => $link,
    			);
    		}

    by:

    $attributes = woodmart_vc_get_link_attr( $link );

    #223042

    Artem Temos
    Keymaster

    It is working correctly for us without any fixes now. If you have any problems, please, create a separate topic and provide us your website access so we can check.

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