Payment Plan Calculator

// Register a shortcode to display payment plans with minimalistic design add_shortcode(‘pedro_payment_plans’, ‘pedro_display_payment_plans’); function pedro_display_payment_plans() { // Get the global product object global $product; // Ensure $product is valid if (!$product || !is_a($product, ‘WC_Product’)) { return ”; // Return nothing…Continue reading

modify woocommerce states list

function custom_override_woocommerce_states( $states ) { // Override ‘AO’ states Արարատ. $states[‘AO’] = array( ‘AO1’ => __( ‘Ագարակ’, ‘woocommerce’ ), ‘AO2’ => __( ‘Ագարակավան’, ‘woocommerce’ ), ‘AO3’ => __( ‘Ալագյազ’, ‘woocommerce’ ), ‘AO4’ => __( ‘Ակունք’, ‘woocommerce’ ), ‘AO5’ => __(…Continue reading

modify woocommerce countries list

add_filter( ‘woocommerce_countries’, ‘modify_woocommerce_country_names’ ); function modify_woocommerce_country_names( $countries ) { // List of country codes to keep $allowed_countries = array( ‘ER’, ‘AO’, ‘DZ’, ‘AU’, ‘BD’, ‘BG’, ‘BJ’, ‘BO’, ‘BR’, ‘CA’, ‘CH’ ); // Loop through all countries and remove the ones…Continue reading

JavaScript for Craft Picker

// Menu Toggle function toggleMenu() { const mobileNav = document.querySelector(‘.mobile-nav’); mobileNav.classList.toggle(‘active’); } // Close Menu on Scroll function closeMenuOnScroll() { const mobileNav = document.querySelector(‘.mobile-nav’); if (mobileNav.classList.contains(‘active’)) { mobileNav.classList.remove(‘active’); } } // Attach the scroll event listener window.addEventListener(‘scroll’, closeMenuOnScroll); // Show…Continue reading

CSS For Craft Picker

/* General Styles */ body { margin: 0; font-family: ‘Arial’, sans-serif; background-color: #f9f9f9; color: #333; line-height: 1.6; } /* Header Styles */ .header { background-color: #ffe4e1; text-align: center; padding: 20px 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }…Continue reading

Allow SVG uploads for administrator users.

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading