Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nathanvs

    (@nathanvs)

    Since we only sell digital products without tax, we don’t rely on any sort of validation of the country field.

    Therefore, I thought we could either make the field not mandatory to fill or remove it entirely and create a new field that people just type in.

    I tried both options using code snippets as well as the plugin “Flexible Checkout Fields for WooCommerce” by WP Desk, but nothing did the job. In fact, I tried disabling other fields too but without any effect.

    This is very puzzling to say the least.

    On another note, just after I started this thread, we have had one person go through the checkout successfully. The country field was already not working then. After that, no one has been able to check out. I’m sharing this in case it helps your team understand the cause of the problem.

    Thank you for your assistance.

    • This reply was modified 1 year ago by nathanvs.
    Thread Starter nathanvs

    (@nathanvs)

    Dear?@shameemreza and @ckadenge,

    I have no doubt that the issue doesn’t exist on a fresh install with the latest version of WooCommerce and the default WordPress theme. However, that is not the context in which WooCommerce is used.

    As mentioned in my original post, the store is set to sell in all countries.

    After further investigation, our theme, Newspaper, is said to be tested and fully compatible with WooCommerce.

    So we are clueless as to where the issue might be coming from.

    We really need a fix for this. Thank you for your assistance.

    Thread Starter nathanvs

    (@nathanvs)

    Dear @shameemreza,

    Thank you for your assistance.

    First, a quick note: since posting this message, we have downgraded to WooCommerce 8.5.2.

    Nonetheless, I have tried the workaround you sent but couldn’t find anything starting with ‘woocommerce_blocks’ within Transients Manager. There are other entries for WooCommerce, but not the type mentioned in the documentation.

    I didn’t realise we were using a checkout block on the order page. Upon checking, indeed the page is Gutenberg enabled. I discovered a handful of settings related to this block, but nothing about the country.

    Therefore, at this stage the country field still doesn’t work.

    I do have two snippets of code relative to WooCommerce in my function.php file, which were copied from different sources. Please see below:

    // Enable Gutenberg editor for WooCommerce
    function activate_gutenberg_product( $can_edit, $post_type ) {
    if ( $post_type == 'product' ) {
    $can_edit = true;
    }
    return $can_edit;
    }
    add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 );
    
    // Enable taxonomy fields for WooCommerce with Gutenberg on
    function enable_taxonomy_rest( $args ) {
    $args['show_in_rest'] = true;
    return $args;
    }
    add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
    add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
    // Add Third Description to WooCommerce Product Pages by businessbloomer.com
    
    add_action( 'add_meta_boxes', 'bbloomer_new_meta_box_single_prod' );
    function bbloomer_new_meta_box_single_prod() {
    add_meta_box(
    'custom_product_meta_box',
    'Troisième description du produit',
    'bbloomer_add_custom_content_meta_box',
    'product',
    'normal',
    'default'
    );
    }
    function bbloomer_add_custom_content_meta_box( $post ){
    $third_desc = get_post_meta( $post->ID, '_third_desc', true ) ? get_post_meta( $post->ID, '_third_desc', true ) : '';
    wp_editor( $third_desc, '_third_desc' );
    }
    add_action( 'save_post_product', 'bbloomer_save_custom_content_meta_box', 10, 1 );
    function bbloomer_save_custom_content_meta_box( $post_id ) {
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
    if ( ! isset( $_POST['_third_desc'] ) ) return;
    update_post_meta( $post_id, '_third_desc', $_POST['_third_desc'] );
    }
    add_action( 'woocommerce_after_single_product_summary' , 'bbloomer_third_desc_bottom_single_product', 99 );
    function bbloomer_third_desc_bottom_single_product() {
    global $product;
    $third_desc = get_post_meta( $product->get_id(), '_third_desc', true ) ? get_post_meta( $product->get_id(), '_third_desc', true ) : '';
    if ( ! $third_desc ) return;
    echo '
    
    '; echo $third_desc; echo '';
    }

    However when I remove them, the problem still exists. I have checked twice now.

    What can you suggest we do? Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)