No se han encontrado widgets en la barra lateral

Obtener Wishlist por usuario

/** * @param int $customerId */ public function getWishlistByCustomerId($customerId) { $wishlist = $this->wishlist->loadByCustomerId($customerId)->getItemCollection(); return $wishlist; } getWishlistByCustomerId($customerId); if(count($wishlistCollection)) { foreach ($wishlistCollection as $_item) { /* You can get ID, Name,…

Leer más

Quitar regiones al state field del checkout woocommerce

add_filter( 'woocommerce_states', 'custom_us_states', 10, 1 ); function custom_us_states( $states ) { $non_allowed_us_states = array( 'CL-AI', 'CL-AN', 'CL-AP', 'CL-AR', 'CL-AT', 'CL-BI', 'CL-CO', 'CL-LI', 'CL-LL', 'CL-LR', 'CL-MA', 'CL-ML', 'CL-NB', 'CL-TA', 'CL-VS'); //…

Leer más

Obtener categoría primaria de Yoast

if ( ! function_exists( 'get_primary_taxonomy' ) ) { function get_primary_taxonomy( $post_id, $taxonomy ) { $prm_term = ''; if (class_exists('WPSEO_Primary_Term')) { $wpseo_primary_term = new WPSEO_Primary_Term( $taxonomy, $post_id ); $prm_term = $wpseo_primary_term->get_primary_term();…

Leer más

Consultar Token de google

function getCaptchaGoogle(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://www.google.com/recaptcha/api/siteverify"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'secret=6Lcv9YEaAAAAAAgfqv9zfwLcgknsWnLEzSLq3_N3&response='.$_REQUEST['resp']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec($ch); curl_close($ch); echo $server_output; die(); } add_action('wp_ajax_getCaptchaGoogle', 'getCaptchaGoogle'); add_action('wp_ajax_nopriv_getCaptchaGoogle', 'getCaptchaGoogle');

Leer más

Métodos del objeto $orden

Array ( [0] get_data_without_line_items [1] get_line_item_data [2] add_filters [3] order_class_name [4] get_report_customer_id [5] is_returning_customer [6] get_customer_first_name [7] get_customer_last_name [8] payment_complete [9] get_formatted_order_total [10] save [11] set_status [12] maybe_set_date_paid [13] update_status…

Leer más

[Seguridad] Limpiar código PHP

Para todos los input que se envían por POST o GET usar la función sanitize_text_field(), esta quita los "<", espacios, limpia en general todos los textos :) Ejemplo de uso:…

Leer más