This file contains hidden or 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
function wc_csp_check_shipping_zones(){ | |
global $current_screen; | |
$screen = get_current_screen(); | |
$screen_id = $screen ? $screen->id : ''; | |
if ( $screen_id == 'woocommerce_page_wc-settings'){ | |
$zones = WC_Shipping_Zones::get_zones(); | |
if ( empty($zones) ) { | |
echo '<div class="notice notice-warning is-dismissible"> | |
<p>It appears that your store does not have any Shipping Zones yet. Before setting up Shipping Methods Restrictions, it will be necessary to create Shipping Zones with all available Shipping Methods. <a href="https://docs.woocommerce.com/document/setting-up-shipping-zones/">Learn more here</a> |
This file contains hidden or 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('woocommerce_after_add_to_cart_form', 'wc_pb_display_bundles'); | |
function wc_pb_display_bundles(){ | |
global $product; | |
$product_id = $product->get_id(); | |
$bundle_ids = wc_pb_get_bundled_product_map( $product_id, false ); | |
if (!empty( $bundle_ids)){ | |
$bundle_ids_list = implode( ",", $bundle_ids ); |