Jump to content

rafapas22

Members
  • Posts

    70
  • Joined

  • Last visited

About rafapas22

  • Birthday 08/19/1983

Contact Methods

Profile Information

  • Activity
    Developer

Recent Profile Visitors

2,623,981 profile views

rafapas22's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Buenas noches. Tengo una duda con PS1.7, uso Tools::fd('text','log') para poder debuguear mis módulos pero con 1.7 no puedo, no funciona. ¿Que alternativa tengo para debuguear archivos php y ver logs en la consola de Chrome en PS 1.7 ? Gracias de antemano
  2. Goodnight. I have a question with PS1.7, I use Tools :: fd ('text', 'log') to be able to debug my modules but with 1.7 I can not, it does not work. What alternative do I have to debug php files and see logs in the Chrome console in PS 1.7? Thanks in advance
  3. But I have fill all fields and save and the error continue. Any solution?
  4. Not works, when click un URL redirect me to personal data. I have 2 módules upload without problems Gracias
  5. Hello. I have a dead-line 24-4-2017 for submit a module for Integration Fund of prestashop but i don't see the button "+FUND" for submit module, where is this button? In a conversation with a member of integration module team say me that for a correct submit the module i must submit with a button that i don't see, paste the conversation NOTE: to be considered as an Integration Fund module, it must be submitted via the " + FUND " button rather than the " + MODULE " button in your seller account. Please is very urgent!! Thanks
  6. Hello. I have this code public function install() { ..... return parent::install() && $this->registerHook('header') && $this->registerHook('backOfficeHeader') && $this->registerHook('actionOrderStatusPostUpdate') && $this->registerHook('actionOrderStatusUpdate') && $this->registerHook('actionValidateOrder') && $this->installTab() && $this->registerHook('displayBackOfficeHeader'); } ....... public function hookActionOrderStatusPostUpdate($params) { /* Place your code here. */ Tools::fd($params, 'log'); Tools::fd('hola hookActionOrderStatusPostUpdate', 'log'); } public function hookActionOrderStatusUpdate($params) { /* Place your code here. */ Tools::fd($params, 'log'); Tools::fd('hola hookActionOrderStatusUpdate', 'log'); and not work. I change status of any order and not is print anything in log, ideas?
  7. Thanks now I am investigating how build controller... how render
  8. I have a problem I am using classes CustomerCore,AddressCore, Cart, Order but orders are being created without products, does anyone know why? $order->getProducts($order->getCartProducts()); $result = $order->add(); I have attached more code igf is necessary Regards and thaks for help
  9. Please I need help, I am creating order with web service and all my orders are created with errors, why? This is my code: <?php /* * * 1) create Customer (opt.) * 2) create Address (opt.) * 3) create Cart with order_rows and with product id's and quantities * 4) create the Order * */ require_once dirname(__FILE__).'/config/config.inc.php'; //////////////////////////////////////////////////////////////////////////////////// ////////////////////////////// ENTRY DATA - VARIABLES ////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// //** CUSTOMERS **// // Required $passwd = 'hhee'; $lastname = 'bielsa'; $firstname = 'marcelo'; $email = '[email protected]'; // Others $id_lang = $id_default_group = $id_gender = $id_shop_customer = $id_shop_group_customer = '1'; $date_now = date('Y-m-d H:i:s'); //** END CUSTOMERS **// //** ADDRESS **// // Required $id_country = '6'; //España $city = 'Narnia'; $address1 = 'Calle Falsa 123'; // Others $phone_mobile = '666666666'; $postcode = '30740'; //** END ADDRESS **// //** CARTS **// // Required $id_currency = '1'; $products = array( array( 'id_product' => '1', 'id_product_attribute' => '1', 'quantity' => '2', 'name' => 'pantalones cortos vaqueros', 'reference' => 'inventado 1', 'product_price' => '119.95' ), array( 'id_product' => '2', 'id_product_attribute' => '1', 'quantity' => '4', 'name' => 'traje negro de vieja', 'reference' => 'inventado 2', 'product_price' => '111.95' ) ); // Others $id_carrier = '1'; //** END CARTS **// //** ORDERS **// // Required $order_module = 'bankwire'; //Nombre del módulo de Forma de pago $order_payment = 'Bank wire'; // Forma de pago para el Frontend $total_paid = $total_paid_real = '123.45'; $total_products = $total_products_wt = '119.95'; //Supongo que será precio sin envio y tal, solo de los productos // Others $id_status = '3'; //Estado del pedido $total_discounts = $total_discounts_tax_incl = $total_discounts_tax_excl = '0.00'; $total_paid_tax_incl = $total_paid_tax_excl = '123.45'; $total_shipping = $total_shipping_tax_incl = $total_shipping_tax_excl = '3.50'; //** END ORDERS **// //////////////////////////////////////////////////////////////////////////////////// ////////////////////////////// ENTRY DATA - VARIABLES ////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// /* Loading Class Request*/ $classes_to_load = array( 'ConfigurationWS', 'CustomersWS', 'AddressWS' ); foreach ($classes_to_load as $classname) { if (file_exists(dirname(__FILE__).'/'.$classname.'.php')) { require_once dirname(__FILE__).'/'.$classname.'.php'; } } $configuration = new ConfigurationWS(); $customer = new CustomersWS(); $address = new AddressWS(); if ($customer->exists($email)){ $data_customer = $customer->getDataCustomer($email); $id_customer = $data_customer['id_customer']; $lastname = $data_customer['lastname']; $firstname = $data_customer['firstname']; $id_lang = $data_customer['id_lang']; $id_default_group = $data_customer['id_default_group']; $id_gender = $data_customer['id_gender']; $id_shop_customer = $data_customer['id_shop']; $id_shop_group_customer = $data_customer['id_shop_group']; } else { // Dejamos los valores por defecto $id_customer = 0; } if ($address->exists($address1,$id_customer)){ $data_address = $address->getDataAdress($address1,$id_customer); $id_address = $data_address['id_address']; $id_country = $data_address['id_country']; $city = $data_address['city']; $address1 = $data_address['address1']; $phone_mobile = $data_address['phone_mobile']; $postcode = $data_address['postcode']; } else { // Dejamos los valores por defecto $id_address = 0; } $id_cart = 0; //Quizás se pueda recuperar un carrito pero ahora mismo.... try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); /* * 1. Create new customer */ if($id_customer == 0){ // Getting the empty XML document to send back completed $xml = $webService->get( array( 'url' => PS_SHOP_PATH .'api/customers?schema=blank' ) ); // Adding dinamic values // Required $xml->customer->passwd = $passwd; $xml->customer->lastname = $lastname; $xml->customer->firstname = $firstname; $xml->customer->email = $email; // Others $xml->customer->id_lang = $id_lang; $xml->customer->id_shop = $id_shop_customer; $xml->customer->id_shop_group = $id_shop_group_customer; $xml->customer->id_default_group = $id_default_group; // Customers $xml->customer->active = 1; $xml->customer->newsletter = 0; $xml->customer->newsletter_date_add = $date_now; $xml->customer->last_passwd_gen = $date_now; $xml->customer->date_add = $date_now; $xml->customer->date_upd = $date_now; $xml->customer->id_gender = $id_gender; $xml->customer->associations->groups->group[0]->id = $id_default_group; // customers // Adding the new customer $opt = array( 'resource' => 'customers' ); $opt['postXml'] = $xml->asXML(); $xml = $webService->add( $opt ); $id_customer = $xml->customer->id; } /* * 2. Create an address */ if($id_address == 0){ // Getting the empty XML document to send back completed $xml = $webService->get( array( 'url' => PS_SHOP_PATH .'api/addresses?schema=blank' ) ); // Adding dinamic and mandatory fields // Required $xml->address->id_customer = $id_customer; $xml->address->id_country = $id_country; $xml->address->alias = $firstname.' '.$lastname.'\'alias'; $xml->address->lastname = $lastname; $xml->address->firstname = $firstname; $xml->address->city = $city; $xml->address->address1 = $address1; // Others $xml->address->phone_mobile = $phone_mobile; $xml->address->postcode = $postcode; $xml->address->date_add = $date_now; $xml->address->date_upd = $date_now; // Adding the new Customer's Addresss $opt = array( 'resource' => 'addresses' ); $opt['postXml'] = $xml->asXML(); $xml = $webService->add( $opt ); $id_address = $xml->address->id; } /* * 3. Create new cart * */ if($id_cart == 0){ // Getting the empty XML document to send back completed $xml = $webService->get( array( 'url' => PS_SHOP_PATH .'api/carts?schema=blank' ) ); // Adding dinamic and mandatory fields // Required $xml->cart->id_currency = $id_currency; $xml->cart->id_lang = $id_lang; $xml->cart->associations->cart_rows->cart_row[0]->id_product = $products[0]['id_product']; $xml->cart->associations->cart_rows->cart_row[0]->id_product_attribute = $products[0]['id_product_attribute']; $xml->cart->associations->cart_rows->cart_row[0]->id_address_delivery = $id_address; $xml->cart->associations->cart_rows->cart_row[0]->quantity = $products[0]['quantity']; // Others $xml->cart->id_address_delivery = $id_address; $xml->cart->id_address_invoice = $id_address; $xml->cart->id_customer = $id_customer; $xml->cart->carrier = $id_carrier; $xml->cart->date_add = $date_now; $xml->cart->date_upd = $date_now; // Adding the new customer's cart $opt = array( 'resource' => 'carts' ); $opt['postXml'] = $xml->asXML(); $xml = $webService->add( $opt ); $id_cart = $xml->cart->id; } /* * 4. Create the order * */ // Getting the structure of an order $xml = $webService->get(array('url' => PS_SHOP_PATH .'api/orders/?schema=blank')); // Adding dinamic and required fields // Required $xml->order->id_address_delivery = $id_address; // Customer address $xml->order->id_address_invoice = $id_address; $xml->order->id_cart = $id_cart; $xml->order->id_currency = $id_currency; $xml->order->id_lang = $id_lang; $xml->order->id_customer = $id_customer; $xml->order->id_carrier = $id_carrier; $xml->order->module = $order_module; $xml->order->payment = $order_payment; $xml->order->total_paid = $total_paid; $xml->order->total_paid_real = $total_paid_real; $xml->order->total_products = $total_products; $xml->order->total_products_wt = $total_products_wt; $xml->order->conversion_rate = 1; // Others $xml->order->valid = 0; $xml->order->current_state = $id_status; $xml->order->total_paid_tax_incl = $total_paid_tax_incl; $xml->order->total_paid_tax_excl = $total_paid_tax_excl; $xml->order->total_shipping = $total_shipping; $xml->order->total_shipping_tax_incl = $total_shipping_tax_incl; $xml->order->total_shipping_tax_excl = $total_shipping_tax_excl; // Order Row. Required $xml->order->associations->order_rows->order_row[0]->product_id = $products[0]['id_product']; $xml->order->associations->order_rows->order_row[0]->product_attribute_id = $products[0]['id_product_attribute']; $xml->order->associations->order_rows->order_row[0]->product_quantity = $products[0]['quantity']; // Order Row. Others $xml->order->associations->order_rows->order_row[0]->product_name = $products[0]['name']; $xml->order->associations->order_rows->order_row[0]->product_reference = $products[0]['reference']; $xml->order->associations->order_rows->order_row[0]->product_price = $products[0]['product_price']; $xml->order->associations->order_rows->order_row[0]->unit_price_tax_incl = $products[0]['product_price']; $xml->order->associations->order_rows->order_row[0]->unit_price_tax_excl = $products[0]['product_price']; // Creating the order $opt = array( 'resource' => 'orders' ); $opt['postXml'] = $xml->asXML(); $xml = $webService->add( $opt ); $id_order = $xml->order->id; echo "Customer: ".$id_customer." address: ".$id_address." cart: ".$id_cart." Order: .".$id_order; } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad ID'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error<br />'.$e->getMessage(); }
  10. With that code all orders are created with state "Payment error", Someone knows the solution? and in table ps_orders and in prestashop i have 49 order and in table ps_order_State only have 14 rows, it is normal? Should not there be the same number of records in the two tables?
  11. Good morning everyone. I'm modifying a module already made to be multi-store, in the test prestashop I use I installed a new fake store to start testing and now in the module I get this message: Both in the fake store and in the original, in the good, to what is this error message? Has a box of marking to the laf that if I mark / unmark it is left thinking but does nothing
  12. Buenas a todos. Estoy modificando un módulo ya hecho para que sea multitienda, en el prestashop de pruebas que uso he instalado una nueva tienda falsa para empezar a probar y ahora en el módulo me aparece esto: tanto en la tienda falsa como en la original, en la buena, a qué se debe este mensaje de error ? tiene una casilla de marcado al lafo que si marco/desmarco se queda pensando pero no hace nada
×
×
  • Create New...