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
- This topic has 23 replies, 4 voices, and was last updated 6 months, 3 weeks ago by Artem Temos.
-
AuthorPosts
-
December 6, 2023 at 2:16 am #518839
ubistrulParticipantDear 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,
AlexeyDecember 6, 2023 at 1:59 pm #519046
Aizaz Imtiaz AwanKeymasterHello,
Go to Theme Setting > General > Mobile bottom navbar > Use the custom button for the chat and insert your own url.
Best Regards.
December 6, 2023 at 9:47 pm #519231
ubistrulParticipantYes, 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🙁
December 7, 2023 at 2:13 pm #519449
Aizaz Imtiaz AwanKeymasterHello,
Can you please share the WP admin login details of your site so I can check and give you a possible solution?
Best Regards.
January 26, 2024 at 2:23 pm #533855
MikeParticipanti 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
January 26, 2024 at 5:02 pm #533922
Aizaz Imtiaz AwanKeymasterHello,
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
January 26, 2024 at 5:17 pm #533937
MikeParticipantNo 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
January 27, 2024 at 10:05 am #534047
Aizaz Imtiaz AwanKeymasterHello,
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.
February 7, 2024 at 1:37 pm #537625
MikeParticipantHi, 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=%2BPHONENUMBERWITHCOUNTRYCODEFebruary 7, 2024 at 5:22 pm #537739
Aizaz Imtiaz AwanKeymasterHello,
Sorry but this plugin which you are using for the Viber chat is not compatible with the theme.
Best Regards.
February 7, 2024 at 6:20 pm #537773
MikeParticipantHey 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.February 9, 2024 at 3:10 pm #538438
Aizaz Imtiaz AwanKeymasterHello @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.
February 15, 2024 at 4:04 pm #540443
MikeParticipantwhy you not try on a default woodmart environment? you will see by yourself what i told you
February 15, 2024 at 4:17 pm #540451
Aizaz Imtiaz AwanKeymasterHello,
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.
February 15, 2024 at 4:46 pm #540462
MikeParticipant@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.
February 16, 2024 at 6:49 pm #540838
Artem TemosKeymasterTry 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 andviber://chat/?number=%2B0123456789
with your needed URL.February 19, 2024 at 11:15 am #541283
MikeParticipantwhat 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 sakeFebruary 19, 2024 at 11:17 am #541286
Artem TemosKeymasterHello,
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
February 19, 2024 at 11:48 am #541305
MikeParticipanti added the code to functions.php and there is no additional custom button link that refer to the code
February 19, 2024 at 11:51 am #541307
Artem TemosKeymasterAfter 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.
February 19, 2024 at 12:58 pm #541318
MikeParticipantok 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?
February 19, 2024 at 1:09 pm #541324
Artem TemosKeymasterWe recommend you to keep this code in the child theme.
June 25, 2024 at 9:06 pm #575453
ubistrulParticipantHello. Is there a way to do this easier, so as not to insert the code to check the link to the phone in Viber?
June 26, 2024 at 9:24 am #575531
Artem TemosKeymasterHello,
Currently, there are no other options for this in our theme.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register