Home Forums WoodMart support forum Assistance with Creating a Viber Link Button in the Mobile Toolbar

Assistance with Creating a Viber Link Button in the Mobile Toolbar

Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #518839

    ubistrul
    Participant

    Dear Woodmart Support Team,

    I hope this message finds you well. I am reaching out to request assistance with implementing a feature on my mobile site using the Woodmart theme. Specifically, I would like to add a custom button to the mobile toolbar that links directly to a Viber chat with a user’s phone number.

    The goal is to provide a convenient way for visitors to initiate a Viber conversation with us by simply tapping the button on the mobile toolbar. I have attempted to find a solution within the theme settings and documentation but have not been successful.

    Could you please provide me with guidance or instructions on how to achieve this? If there are any specific settings or custom CSS that I need to apply, I would greatly appreciate your detailed advice.

    Thank you for your time and assistance. I look forward to your prompt response.

    Best regards,
    Alexey

    #519046

    Hello,

    Go to Theme Setting > General > Mobile bottom navbar > Use the custom button for the chat and insert your own url.

    Best Regards.

    #519231

    ubistrul
    Participant

    Yes, but when I paste this link into a field, when I save and open it, the attribute with this link completely disappears in the tag.

    the link is correct Viber-link
    viber://chat/?number=%2B389993333444

    🙁

    #519449

    Hello,

    Can you please share the WP admin login details of your site so I can check and give you a possible solution?

    Best Regards.

    #533855

    Mike
    Participant

    i can confirm that this is really happen. I tried also to add a viber button link on mobile bottom navbar with a custom button url but when you save the settings the the 3 first part “%2B” is automatically removed. The %2B viber say that we should use that instead of + before the country code as the + its not working anymore

    #533922

    Hello,


    @mike

    Have you solved the issue?. Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.

    Best Regards

    #533937

    Mike
    Participant

    No i have not solved it, the problem is on the theme because when you save the settings, the part “%2B” its automatically removed, so the link its not set properly

    #534047

    Hello,

    Can you please test the plugin link with the default wordpress theme such as Storefront or Twenty Twenty-Three in the form of a custom link from Appearance > Menu.

    Best Regards.

    #537625

    Mike
    Participant

    Hi, sorry for late reply. The problem is on woodmart theme settings. If i use another theme then i can use woodmart theme settings. Just add a viber link like this
    format: viber://chat/?number=%2BPHONENUMBERWITHCOUNTRYCODE

    #537739

    Hello,

    Sorry but this plugin which you are using for the Viber chat is not compatible with the theme.

    Best Regards.

    #537773

    Mike
    Participant

    Hey bro, did you even read what i wrote? tell me please where i told that i use a plugin? As i told you before and please take the time to read earlier message. The link of the viber chat its not working because when you try to save the settings a part of the number is automatically removed. As you can see on the screenshot that i have upload. Try on your end to add this link: viber://chat/?number=%2B1234567890

    and when you will save the theme settings you will see that the “%2B” part that is required by viber will be removed

    Attachments:
    You must be logged in to view attached files.
    #538438

    Hello @Mike,

    Can you please share the WP admin login details of your site so I will check and give you a possible solution.

    Best Regards.

    #540443

    Mike
    Participant

    why you not try on a default woodmart environment? you will see by yourself what i told you

    #540451

    Hello,

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Best Regards.

    #540462

    Mike
    Participant

    @aizaz_awan check private.

    Try to add this link on custom button 2 in Mobile bottom navbar: viber://chat/?number=%2B0123456789

    • This reply was modified 11 months, 1 week ago by Mike.
    #540838

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to add this link

    if ( ! function_exists( 'woodmart_sticky_toolbar_custom_link_template' ) ) {
    	/**
    	 * Sticky toolbar custom link template
    	 *
    	 * @since 3.6
    	 *
    	 * @param string $key Key.
    	 */
    	function woodmart_sticky_toolbar_custom_link_template( $key ) {
    		global $woodmart_options, $xts_woodmart_options;
    		woodmart_lazy_loading_deinit( true );
    		$wrapper_classes = '';
    		$url             = woodmart_get_opt( $key . '_url' );
    		$text            = woodmart_get_opt( $key . '_text' );
    		$icon            = woodmart_get_opt( $key . '_icon' );
    		if ( 'link_2' === $key ) {
    			$url = 'viber://chat/?number=%2B0123456789';
    		}
    		$wrapper_classes .= isset( $icon['id'] ) && $icon['id'] ? ' wd-tools-custom-icon' : '';
    		$wrapper_classes .= woodmart_get_old_classes( ' woodmart-toolbar-item woodmart-toolbar-link' );
    		?>
    		<?php if ( $url && $text ) : ?>
    			<div class="wd-toolbar-link wd-tools-element wd-toolbar-item<?php echo esc_attr( $wrapper_classes ); ?>">
    				<a href="<?php echo $url; ?>">
    			<span class="wd-toolbar-icon wd-tools-icon wd-icon wd-custom-icon">
    				<?php if ( isset( $icon['id'] ) && $icon['id'] ) : ?>
    					<?php echo wp_get_attachment_image( $icon['id'] ); ?>
    				<?php endif; ?>
    			</span>
    			<span class="wd-toolbar-label">
    				<?php echo esc_html( $text ); ?>
    			</span>
    				</a>
    			</div>
    		<?php endif; ?>
    		<?php
    		woodmart_lazy_loading_init();
    	}
    }

    Replace link_2 to the number of custom link for viber and viber://chat/?number=%2B0123456789 with your needed URL.

    #541283

    Mike
    Participant

    what is this exactly, and what is supposed this code to do?
    did you read my previous message? please check the fcking video on private content i made for you.. for god sake

    #541286

    Artem Temos
    Keymaster

    Hello,

    The code we gave you adds a custom Viber button to the navbar. You can’t add it through Theme Settings at the moment because all our fields are sanitized with WordPress security functions according to Envato Security requirements.

    Kind Regards

    #541305

    Mike
    Participant

    i added the code to functions.php and there is no additional custom button link that refer to the code

    #541307

    Artem Temos
    Keymaster

    After adding this code you can now replace the URL for the second custom button in your navbar with your Viber URL. So you just need to a random button that will be replaced with Viber in this custom code.

    #541318

    Mike
    Participant

    ok i checked it now and i saw that its working even if the value is removed after saving settings. Is this something temporary and will be fixed in future releases or its a permanent fix?

    #541324

    Artem Temos
    Keymaster

    We recommend you to keep this code in the child theme.

    #575453

    ubistrul
    Participant

    Hello. Is there a way to do this easier, so as not to insert the code to check the link to the phone in Viber?

    #575531

    Artem Temos
    Keymaster

    Hello,

    Currently, there are no other options for this in our theme.

    Kind Regards

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