Created
December 7, 2021 20:10
-
-
Save hostingpage/ba44ffa4bc06b210369e72660f438107 to your computer and use it in GitHub Desktop.
Agregar simbolo MXN en los precios en Woocommerce
This file contains 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 | |
/** | |
* Plugin Name: WooCommerce Mostrar Simbolo | |
* Plugin URI: https://github.com/hostingpage/ | |
* Description: Agregar MXN en los precios, tambien USD, etc. | |
* Author: WebMaster - Departamento | |
* Author URI: https://www.hostingpage.com/ | |
* Version: 1.0 | |
* | |
* Este programa es software gratuito: puedes redistribuirlo y / o modificar | |
* bajo los términos de la Licencia Pública General GNU publicada por | |
* a Free Software Foundation, ya sea la versión 3 de la Licencia, o | |
* (a su elección) cualquier versión posterior. | |
* | |
* Este programa se distribuye con la esperanza de que sea útil, | |
* pero SIN NINGUNA GARANTÍA; sin siquiera la garantía implícita de | |
* COMERCIABILIDAD o APTITUD PARA UN PROPÓSITO PARTICULAR. Ver el | |
* Licencia pública general GNU para obtener más detalles. | |
* | |
* Debería haber recibido una copia de la Licencia Pública General GNU | |
* junto con este programa. De lo contrario, consulte <http://www.gnu.org/licenses/>. | |
* | |
*/ | |
function whpi_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'USD': | |
$currency_symbol = 'USD $'; | |
break; | |
case 'MXN': | |
$currency_symbol = 'MXN $'; | |
break; | |
} | |
return $currency_symbol; | |
} | |
add_filter('woocommerce_currency_symbol', 'whpi_currency_symbol', 30, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment