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
add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields'); | |
function custom_override_checkout_fields($fields) | |
{ | |
$fields['billing']['billing_documento'] = array( | |
'type' => 'select', | |
'label' => __('Documento', 'woocommerce'), | |
'options' => array(33=>'Factura', 39=>'Boleta'), | |
'required' => true, | |
'class' => array('form-row-wide'), | |
'clear' => true, |
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
<!-- Ubicar, por ejemplo, justo después de tag form --> | |
<!-- | |
Este ejemplo permite elegir boleta o factura | |
Si se desea sólo: | |
- Boleta nominativa: quitar selección de boleta/factura y giro | |
- Boleta no nominativa: no colocar este código (no modificar template) | |
- Factura: quitar selección boleta/factura y cambiar por campo hidden con value 33 | |
--> | |
{% comment %}Inicio LibreDTE{% endcomment %} | |
<div class="row"> |
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
/** | |
* Servicio web para recibir una notificación de pago de LibreDTE | |
*/ | |
// configuración auth en LibreDTE | |
$emisor = 76192083; // RUT sin puntos ni DV | |
$hash = ''; // en perfil del usuario | |
$user = ''; // definido en la config del servicio web en LibreDTE | |
$pass = ''; // definido en la config del servicio web en LibreDTE |
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 | |
show('$_GET', $_GET); | |
show('$_POST', $_POST); | |
show('$_FILES', $_FILES); | |
show('apache_request_headers()', apache_request_headers()); | |
show('php://input', file_get_contents('php://input')); | |
function show($name, $var) | |
{ |
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 | |
// ejemplo de uso | |
libredte_preauth('hash-del-usuario', 76192083, '/dte/dte_emitidos'); | |
/** | |
* Función para preautenticar y redireccionar a un usuario en LibreDTE | |
* @param hash Hash del usuario, está en su perfil | |
* @param rut RUT del contribuyente sin DV | |
* @param uri Donde se desea enviar al usuario luego de autenticar y seleccionar contribuyente |