Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1025999
    sebagc
    Participant

    Hi!
    I hope im not being inappropriate with my request, since i know you don’t have to include support for third party plugins.
    Im working on a Theme X and Woocommer site. My country is Chile, which has no States/provinces in core code.
    I tried to add a piece of code into the child theme’s functions.php(according to https://docs.woothemes.com/document/addmodify-states/) but the theme broke…
    Can you help out in order to know if the code i put was incorrect or if there is any compatibility with the theme itself? Thank you very much!!
    Tha function i added was something like this:
    (i only added 2 lines of new states but actually they are more than 300)

    <?php
    /**
    * Chile
    *
    * @author WooThemes
    * @category i18n
    * @package WooCommerce/i18n
    * @version 2.0.0
    */
    global $states;

    $states[‘CL’] = array(
    ‘AN’ => __( ‘Antofagasta’, ‘woocommerce’ ),
    ‘MJ’ => __( ‘Mejillones’, ‘woocommerce’ ),

    );

    Thank you very much for the answer!

    #1026001
    sebagc
    Participant

    The URL in which i need it is http://www.petitecotton.cl and http://www.sudgower.com
    Thank you very much in advance!

    #1026526
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme instead:

    add_filter( 'woocommerce_states', 'x_custom_woocommerce_states' );
    function x_custom_woocommerce_states( $states ) {
    	$states['CL'] = array(
    		'AN' => __( 'Antofagasta', 'woocommerce' ),
    		'MJ' => __( 'Mejillones', 'woocommerce' ),
    	);
    	return $states;
    }

    Hope it helps 🙂

    #1028317
    sebagc
    Participant

    thank you very much!!

    #1028654
    Darshana
    Moderator

    Glad we were able to help 🙂

    #1030999
    sebagc
    Participant

    Hi Guys! I Hope not to bother!
    I Take the opportunity to ask another question, since its related to main one, an Action in the functions.php.

    I need to hide a certain Shipping option from the woo commerce Cart, (since shipping is going to be calculated later based on Country/State) The Code im planning to use is the following. I ask you guys before using it since last time i did the theme broke and according to your instructions the code was not correct.
    Code:

    function remove_title_from_shipping_label($full_label, $method){
    return str_replace(‘Shipping: ‘, “”, $full_label);
    }
    add_filter( ‘woocommerce_cart_shipping_method_full_label’, ‘remove_title_from_shipping_label’, 10, 2 );

    Thank you very much in advance!

    #1031651
    Christian
    Moderator

    Hey there,

    We’re sorry but further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.

  • <script> jQuery(function($){ $("#no-reply-1025999 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>