function mi_plugin_enviar_datos_pedido_y_notificar($order_id, $old_status, $new_status, $order) { // Verifica si WooCommerce está instalado y activado if (!class_exists('WooCommerce')) { error_log('WooCommerce no está instalado o activado.'); return; } // Solo procesar si el nuevo estado es "processing" if ($new_status !== 'processing') { error_log("Pedido $order_id en estado '$new_status' - No se envía a la API (solo se envía en estado 'processing')."); return; } // Comprobar si el pedido ya ha sido procesado previamente $already_processed = get_post_meta($order_id, '_mi_plugin_processed', true); if ($already_processed) { error_log("Pedido $order_id ya fue procesado anteriormente - No se envía de nuevo."); return; } // Marcar el pedido como procesado para evitar que se ejecute múltiples veces update_post_meta($order_id, '_mi_plugin_processed', true); $data = mi_plugin_preparar_datos_pedido($order_id); if (!$data) { error_log("No se pudieron preparar los datos para el pedido $order_id"); return; } $json_data = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); error_log("Datos a enviar a la API: $json_data"); // Agregar el JSON generado como una nota al pedido $order->add_order_note("JSON Generado para la API:\n" . $json_data); try { $curl = curl_init(); if (!$curl) { throw new Exception('No se pudo inicializar cURL.'); } curl_setopt_array($curl, array( CURLOPT_URL => 'http://119.8.3.165:60080/ApiCoreOne/TV/v1/PedidosVentas', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $json_data, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'X-API-Key: 27d34740-c3d4-1120-2023-b5ba3a62922c' ), )); $response = curl_exec($curl); $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); $err = curl_error($curl); curl_close($curl); if ($err) { throw new Exception("Error al enviar pedido a la API: " . $err); } if ($http_code >= 200 && $http_code < 300) { // Comprobar si el objeto en la respuesta no es null $response_data = json_decode($response, true); if (isset($response_data['Objeto']) && $response_data['Objeto'] !== null) { // Si el objeto no es null, continuar con el flujo de éxito $success_message = "Pedido enviado correctamente a la API. Respuesta: " . $response; error_log($success_message); $order->add_order_note($success_message); // Almacena los datos en la tabla global $wpdb; $table_name = $wpdb->prefix . 'wc_pedidos_api'; $wpdb->insert( $table_name, array( 'order_id' => $order_id, 'json_data' => $json_data, 'api_response' => $response ) ); } else { // Si el objeto es null, manejar como error $error_message = "Error en la respuesta de la API: El objeto es null. Respuesta: " . $response; error_log($error_message); $order->add_order_note($error_message); // Lanzar una excepción throw new Exception("Error en la respuesta de la API: El objeto es null. Respuesta: " . $response); } } else { // Código de respuesta de error (4xx, 5xx) $error_message = "Error en la respuesta de la API. Código HTTP: " . $http_code . ", Respuesta: " . $response; error_log($error_message); $order->add_order_note($error_message); // Lanzar una excepción throw new Exception("Error en la respuesta de la API. Código HTTP: " . $http_code . ", Respuesta: " . $response); } } catch (Exception $e) { // Manejo de errores $error_message = $e->getMessage(); error_log($error_message); // Almacena los datos en la tabla, incluso en caso de error global $wpdb; $table_name = $wpdb->prefix . 'wc_pedidos_api'; $wpdb->insert( $table_name, array( 'order_id' => $order_id, 'json_data' => $json_data, 'api_response' => $error_message ) ); // Agregar nota con el error $order->add_order_note("Error al enviar a la API:\n" . $error_message); // Desmarcar el pedido como procesado para permitir reintentos delete_post_meta($order_id, '_mi_plugin_processed'); } }Greenlam laminate 276-09 - Pebble - Texture - 4x8 - No postforming - with protective film - Lumber Express
Skip links

Greenlam laminate 276-09 – Pebble – Texture – 4×8 – No postforming – with protective film

In stock

$37.95

Greenlam laminate 276-09 – Pebble – Texture – 4×8 – No postforming – with protective film

SKU: LAA262 Categories: , Availability: 76 in stock

Description

Greenlam laminate 276-09 – Pebble – Texture – 4×8 – No postforming – with protective film

The Greenlam 276-09 laminate in Pebble color with texture is perfect for a wide range of interior design applications. Its textured surface gives it a natural and sophisticated look, while the protective film ensures resistance to scratches and wear. This laminate comes in a 4×8 feet format and is not postformable, making it ideal for flat applications or surfaces that don’t require bending. It is an excellent choice for furniture, kitchens, and work surfaces, combining durability and aesthetics.

Benefits

  • Textured surface that mimics natural stone.
  • Highly resistant to scratches and wear thanks to the protective film.
  • Easy maintenance and cleaning.
  • Ideal for furniture and flat surface applications.
  • Non-postforming, making it suitable for surfaces that do not require bending.
Technical dataDescription
ModelGreenlam laminate 276-09
ColorPebble
FinishMetalized
Size4x8 feet
PostformingNo postforming
ProtectionProtective film

Similar products

Reviews

There are no reviews yet.

Be the first to review “Greenlam laminate 276-09 – Pebble – Texture – 4×8 – No postforming – with protective film”

Your email address will not be published. Required fields are marked *

1
Greenlam laminate 5722-30 - Nogal Parma - Matte - 4x8 - Not postforming
Greenlam laminate 5722-30 - Nogal Parma - Matte - 4x8 - Not postforming

Greenlam laminate 5722-30 - Nogal Parma - Matte - 4x8 - Not postforming

+
$27.95
Subtotal - 1 item
Shipping & taxes calculated at checkout.
$27.95
Checkout Now
Inicio
Whatsapp
Traducir
Login
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.