This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_bar_menu', function( $wp_admin_bar ) { | |
if ( is_object( $wp_admin_bar ) && $wp_admin_bar->get_node( 'woocommerce-site-visibility-badge' ) ) { | |
$wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' ); | |
} | |
}, 100 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_account_menu_items', 'customize_my_account_menu' ); | |
function customize_my_account_menu( $items ) { | |
// Remove the 'downloads' endpoint | |
unset($items['downloads']); | |
// Remove the 'edit-address' endpoint | |
unset($items['edit-address']); | |
return $items; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modifies the billing address fields to make the state field required. | |
* | |
* @param array $address_fields The array of address fields used in WooCommerce checkout. | |
* @return array The modified array of address fields with 'state' field set as required. | |
*/ | |
function force_state_field_default_required( $address_fields ) { | |
// Set the 'required' flag for the 'billing_state' field to true. | |
$address_fields['billing_state']['required'] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Hook for reactivation from 'on-hold' to 'active' | |
add_action('woocommerce_subscription_status_on-hold_to_active', 'send_custom_email_on_reactivation', 10, 1); | |
function send_custom_email_on_reactivation($subscription) { | |
$user_email = $subscription->get_billing_email(); | |
// Optional: Check if this is an admin reactivation | |
if (is_admin() && current_user_can('manage_woocommerce')) { | |
$action = 'admin reactivated'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the cross-sells displayed in the cart to always show specific products. | |
*/ | |
function custom_filter_woocommerce_cart_cross_sells( $cross_sell_ids, $cart ) { | |
// Specify the IDs of the products you want to always show as cross-sells. | |
$custom_cross_sell_ids = array( '1', '2' ); | |
// Return your custom cross-sell product IDs. | |
return $custom_cross_sell_ids; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media screen and (min-width: 768px) { | |
.site-main ul.products li.product, .smm-mega-menu ul.products li.product { | |
overflow: visible; | |
} | |
.site-main ul.products li.product .button, | |
.site-main ul.products li.product .g-product-title, | |
.smm-mega-menu ul.products li.product .button, | |
.smm-mega-menu ul.products li.product .g-product-title { | |
display: block; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add following snippet to "Header & Footers WordPress Plugin. Replace wc.local with your own website URL --> | |
<link rel='stylesheet' id='select2-css' href='https://wc.local/wp-content/plugins/woocommerce/assets/css/select2.css?ver=4.6.1' media='all' /> | |
<script src="https://wc.local/wp-content/plugins/woocommerce/assets/js/selectWoo/selectWoo.full.min.js?ver=1.0.6" id="selectWoo-js"></script> | |
<script> | |
jQuery( document ).ready( | |
function ($) { | |
$( '.wc-pao-addon-select' ).filter( ':not(.enhanced)' ).each( | |
function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_stripe_supported_countries', 'wc_stripe_CN_support', 10, 1 ); | |
function wc_stripe_CN_support( $supported_countries ) { | |
$supported_countries = array( | |
'CN', // China | |
); | |
return $supported_countries; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.main-navigation ul.menu ul li:hover>a, | |
.main-navigation ul.nav-menu ul li:hover>a { | |
background-color: #ff2b71; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.site-main ul.products li.product, .smm-mega-menu ul.products li.product { | |
overflow: visible; | |
} | |
.site-main ul.products li.product .button, | |
.site-main ul.products li.product .g-product-title, | |
.smm-mega-menu ul.products li.product .button, | |
.smm-mega-menu ul.products li.product .g-product-title { | |
display: block; | |
opacity: 1; |
NewerOlder