0

How can I change the alert style of the Wood Mart template in WordPress on the single product page when I did not select the variable product feature?

function custom_enqueue_scripts() {
  wp_enqueue_style('custom-alert-style', get_stylesheet_directory_uri() . '/custom-alert-style.css');
  wp_enqueue_script('custom-alert-script', get_stylesheet_directory_uri() . '/custom-alert-script.js', array('jquery'), '', true);
}
add_action('wp_enqueue_scripts', 'custom_enqueue_scripts');


var customAlertButton = document.getElementsByClassName('myButton');
var customAlert = document.getElementById('custom-alert');
var customAlertClose = document.getElementById('custom-alert-close');

customAlertButton.addEventListener('click', function() {
  customAlert.style.display = 'block';
});

customAlertClose.addEventListener('click', function() {
  customAlert.style.display = 'none';
});

0 Answers0