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 | |
add_filter( 'redsys_modify_data_to_send', 'datos_modificados_por_moneda_en_redsys' ); | |
/** | |
* Modifica los datos enviados a Redsys dependiendo de la moneda del pedido. | |
* | |
* @param array $redsys_data_send Datos que se enviarán a Redsys. | |
* @return array Datos modificados según la moneda de la orden. | |
*/ |
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 | |
add_filter( 'redsys_send_expired_credit_card_email', 'custom_redsys_send_expired_credit_card_email' ); | |
function custom_redsys_send_expired_credit_card_email( $data ) { | |
// Obtener el nombre y apellido del usuario | |
$user_id = $data['user_id']; | |
$nombre = get_user_meta( $user_id, 'billing_first_name', true ); | |
$apellido = get_user_meta( $user_id, 'billing_last_name', true ); | |
$payment_methods_url = wc_get_endpoint_url( 'payment-methods', '', wc_get_page_permalink( 'myaccount' ) ); |
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 | |
$url_conexion = 'https://sis-t.redsys.es:25443'; | |
$conexion = curl_init(); | |
curl_setopt( $conexion, CURLOPT_URL, $url_conexion ); | |
curl_setopt( $conexion, CURLOPT_CONNECTTIMEOUT, 10 ); | |
curl_setopt( $conexion, CURLOPT_TIMEOUT, 60 ); | |
curl_setopt( $conexion, CURLOPT_RETURNTRANSFER, true ); | |
curl_setopt( $conexion, CURLOPT_POST, true ); | |
// CURLOPT_SSL_VERIFYPEER indica a cURL que valide la cadena de certificados del servidor con los certificados raíz del almacén local |
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
In the following list of actions, there are paths from my Mac. You should replace the path with the one that corresponds to yours. | |
In principle, you should only change the username in the path to yours. | |
(Install Xcode > https://guide.macports.org/#installing.xcode) | |
xcode-select --install | |
sudo xcodebuild -license | |
Descargar PKG para OS https://www.macports.org/install.php | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
sudo port -v selfupdate |
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 | |
function jconti_activar_gutenberg_en_productos( $can_edit, $post_type ){ | |
if ( $post_type === 'product' ){ | |
$can_edit = true; | |
} | |
return $can_edit; | |
} | |
add_filter( 'use_block_editor_for_post_type', 'jconti_activar_gutenberg_en_productos', 10, 2 ); |
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 | |
// Filtro que solo funciona en el plugin premium WooCommerce Redsys Gateway https://woocommerce.com/products/redsys-gateway | |
add_filter( 'redsys_modify_data_to_send', 'datos_modificados_pasarela_pago_en_redsys' ); // Filtro para «Redsys redirección (por Jose Conti)» | |
function datos_modificados_pasarela_pago_en_redsys( $redsys_data_send ) { | |
$order_id = WCRed()->clean_order_number( $redsys_data_send['transaction_id2'] ); | |
$order = new WC_Order( $order_id ); |
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 | |
add_filter( 'language_attributes', 'mi_lang_personalizado' ); | |
function mi_lang_personalizado( $output ) { | |
if ( is_page( 34 ) ) { | |
return 'lang="en_US"'; | |
} | |
return $output; | |
} |
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 | |
add_filter( 'redsys_mail_add_token', 'datos_modificados_redsys_mail_add_token' ); | |
function datos_modificados_redsys_mail_add_token( $data ) { | |
$name = $data['name']; | |
$last_name = $data['last_name']; | |
$site_title = $data['site_title']; | |
$subject = $data['subject']; | |
$body = $data['body']; |
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 | |
/** | |
* SOAP Test for Redsys. | |
* | |
* @package WooCommerce Redsys Gateway (https://woocommerce.com/es-es/products/redsys-gateway/) | |
* @copyright José Conti | |
*/ | |
if ( ! class_exists( 'SoapClient' ) ) { | |
echo 'ATENCIÓN, SOAP NO ACTIVO'; |
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 | |
function anadir_metaboxes_the7_a_cpt( $post_type_array ) { | |
$post_type_array[] = 'nombre_custom_post_type'; | |
return $post_type_array; | |
} | |
add_filter( 'presscore_pages_with_basic_meta_boxes', 'anadir_metaboxes_the7_a_cpt' ); |
NewerOlder