Tagged: x
-
AuthorPosts
-
June 4, 2016 at 5:46 pm #1025999
sebagcParticipantHi!
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!
June 4, 2016 at 5:49 pm #1026001
sebagcParticipantThe URL in which i need it is http://www.petitecotton.cl and http://www.sudgower.com
Thank you very much in advance!June 5, 2016 at 6:52 am #1026526
ThaiModeratorHi 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 🙂
June 6, 2016 at 11:50 am #1028317
sebagcParticipantthank you very much!!
June 6, 2016 at 3:35 pm #1028654
DarshanaModeratorGlad we were able to help 🙂
June 7, 2016 at 8:09 pm #1030999
sebagcParticipantHi 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!
June 8, 2016 at 6:26 am #1031651
ChristianModeratorHey 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.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1025999 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
