• Resolved asuserviciosdara

    (@asuserviciosdara)


    Estoy configurando zonas de envío dentro de Cuba, pero no aparecen ninguna de las provincias. Alguien sabe como las puedo añadir?

Viewing 4 replies - 1 through 4 (of 4 total)
  • WooCommerce doesn’t have any states for Cuba, but you can add them with a code snippet:

    add_filter( 'woocommerce_states', 'custom_states' );
    function custom_states( $states ) {
      $states['CU'] = array (          
              'PR' => 'Pinar del Río',
              'AR' => 'Artemisa',
    
      );          
      return $states;
    }

    You will need to fill out the array with the full list of states and state codes. I don’t have local knowledge of your country to be able to do that.

    The code snippet goes in functions.php for your child theme or you can try a snippets plugin.

    Thread Starter asuserviciosdara

    (@asuserviciosdara)

    Muchas gracias por la información. Si ya lo añadiría. Otra pregunta después que añada los estados que en cuba se llaman provincias, como puedo añadir también los municipios? Que vienen siento los que componen la provincia o estado.
    Y después como logro añadir un filtro o buscador a los clientes que cuando vayan a comprar escojan primero la provincia y el municipio?
    Si no es molestia también indicarme como llegar a functions.php
    Y luego en que parte le puedo pegar el código? Gracias

    WooCommerce doesn’t have a system for municipalities. If you want to add municipalities you will need to get a developer to write some code. That may not be cheap.

    If you want to get visitors to put in their address before shopping, I think that would also be a custom code development.

    Regarding functions.php, its best to make a child theme. Child themes are described here:
    https://developer.wordpress.org/themes/advanced-topics/child-themes/

    There are several plugins which can help you:
    https://wordpress.org/plugins/search/child+theme/

    When you have made a child theme, you will need to make a file called functions.php. This must go int child theme diretcory. The first line must be <?php to tell the system that the file contains php code.

    If you don’t want to make a child theme, the other way would be to use a snippets plugin for the code. There is this one for example:
    https://wordpress.org/plugins/code-snippets/

    Hi @asuserviciosdara

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No aparece la zona de envío’ is closed to new replies.