Hello @khurram virk,
Please note that your requests concern additional customization rather than the correction of theme-related issues or bugs. Below, we have attached an example snippet that you can use in your child-theme/functions.php file (https://prnt.sc/tBMsCQn05tlP).
add_action('wp_footer', function() { ?>
<script type="text/javascript">
(function () {
'use strict';
function smoothScrollTo(el) {
if (!el) return;
var y = el.getBoundingClientRect().top + window.pageYOffset;
window.scrollTo({ top: y, behavior: 'smooth' });
}
function handleClick(e) {
var button = e.target.closest('a.et_element.et_b_single-button[href^="#"]');
if (!button) return;
var hash = button.getAttribute('href'); // "#tab-description"
if (!hash || hash === '#') return;
var panel = document.querySelector(hash); // the actual tab panel
if (!panel) return;
var tabTitle = document.querySelector('.et-woocommerce-tab[aria-controls="' + panel.id + '"]');
var tabLink = tabTitle ? tabTitle.querySelector('a[aria-controls="' + panel.id + '"]') : null;
e.preventDefault();
if (tabTitle && tabTitle.classList.contains('active')) {
smoothScrollTo(panel);
return;
}
if (tabLink) {
tabLink.click();
setTimeout(function () {
smoothScrollTo(panel);
}, 100);
return;
}
smoothScrollTo(panel);
}
document.addEventListener('click', handleClick);
})();
</script>
<?php });
Frontend example of such implementation: https://gyazo.com/a37a0ac1646b972760089c7963f9e6b7
Regarding the popup closing issue, we recommend recreating your popups using the default functionality of Elementor Popups (you can export and then import your Static block content https://elementor.com/help/how-to-duplicate-an-elementor-page/) and verifying whether they work correctly. Please note that this closing action will not apply to popups created with static blocks instead of Elementor Popups. Otherwise, you will need to add custom CSS classes to the buttons inside the popups and create custom JavaScript snippets to trigger the popup closing action.
If you require further assistance, please provide the relevant URLs and wp-admin access details so that we can review the button settings and page content. Please, note that we provide our support according to the Envato privacy policy, so additional customization is out of our basic support scope.
Best regards,
Jack Richardson
The 8Theme’s Team















