Jump to content

ChineseNorris

Members
  • Posts

    79
  • Joined

  • Last visited

Profile Information

  • Location
    Spain
  • Activity
    User/Merchant

Recent Profile Visitors

3,365,653 profile views

ChineseNorris's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

14

Reputation

  1. Hello, the classes above won't work on prestashop, these will do the trick: .hidden-[size]-[behaviour] Where [size] can be "sm" , "md" , "lg" , "xl" As you can see is very intuitive and you hide it depending on your needs, being "sm" (small) for mobile, "md" (medium) for tablet, "lg" (large) on desktop and "xl" (extra large) for larger displays. Where [behaviour] can be "up" or "down", if you want to be shown should be "up" and hidden with "down". This way you can show things only for mobile, for example : .hidden-sm-up I know it's an old post but for everyone who is looking for this info should be helpful
  2. Hello everyone, I'm following this readme in order to get Vue.JS in development mode since I'm having issues in the stocks page (loads way too slow +50s) https://github.com/PrestaShop/PrestaShop/tree/1.7.7.x/admin-dev/themes/new-theme/js/app But when I do npm install It gives me a lot of warnings, the first one is that there is no package.json, so how do I put Vue.JS in my fresh installed prestashop under dev-mode??? npm WARN saveError ENOENT: no such file or directory, open '/admin/themes/new-theme/package.json' Thanks
  3. No, I just stopped the development because I don't have time but it's on my TO-DO list
  4. Hi, I've been looking at how to use symfony without any success since I'm having issues in the backoffice, especially with stocks page that loads way too slow, it takes up to whole 65seconds to load! Just one page! The other pages takes also a lot of time, but when I check symfony debugger there are no errors, just a bunch of missing translations, might this be the cause of the lack of speed? I have two exactly shops (because I cloned them) with same version 1.7.6.1 at the same server, and one is loading good and the other one is extremely slow, how can I debug this issue? Thanks in advance
  5. Hola, Podrías explicar o poner un fragmento de cómo realizas el update del pedido por webservice? Gracias
  6. Genial post @gusman126 Alguno ha tenido problemas con código de respuesta del servidor "Error (-1 Read timed out)"?
  7. Yo miraría algo del servidor si está bloqueando IP's de google, o que directamente el servidor esté bloqueando crawlers de google, que tiene toda la pinta. Otra cosa que se me podría ocurrir es que tuvieras muchísimas páginas y páginas anidadas una dentro de otra haciendo el script de google eterno y por eso te tira un error 500, habría que ver más datos
  8. Puedes hacer una exportación en CSV de los productos y combinaciones y subirlo directamente, aunque realmente no te lo recomiendo, ya que es algo bastante tedioso en prestashop. Lo que yo suelo hacer es usar un módulo de pago, el mejor que he encontrado y funciona sin problemas es éste: https://addons.prestashop.com/es/migracion-copias-de-seguridad/8934-actualizacion-de-prestashop-y-herramienta-de-migracion.html La ventaja de éste módulo es que puedes migrar los datos de una tienda vieja a otra totalmente nueva, por lo que la tienda seguiría funcionando perfectamente y sin cortes, si es en el mismo dominio lo puedes crear en una subcarpeta y cuando esté todo listo para producción cambiar el nombre de la carpeta en la base de datos. Si te urge, cómpralo que te vas a ahorrar muchas horas de trabajo manual y que encima puede acarrear errores.
  9. La carpeta app está en la raíz de tu instalación de prestashop, que normalmente si estás en un hosting será del palo public_html/app ó public_html/carpeta_prestashop/app
  10. Madre mía, no hay tertulias de éste tipo ni en forocoches😂😂😂 Si seguimos el hilo... es webempresa, qué esperas? Funcionará bien o mal y todo lo que tú quieras, pero sigue siendo un host reseller, son un middleman más que necesitan vender su producto, por lo que no te fies mucho. Está claro que PrestaShop no es el framework definitivo ni de lejos...pero decir que peta cada dos por tres es exagerar un poco, llevo también desde la 1.4 y ha tenido sus cagadas, pero siempre hay un roadmap para arreglar los fallos, de hecho creo que pasar del forge a github ha sido la apuesta más acertada, ya que en github todos los desarrolladores tenemos el mismo "framework para trabajar" lo cual facilita muchísimo el trabajo. En mis inicios todo eran fallos y bugs por todos los lados, porque todo hay que decirlo, cuando empiezas en algo nuevo no entiendes al 100% lo que otro ha desarrollado y eres un paquete, y encima si te niegas a aceptar lo que hizo otro...pues mal vamos, acabarás amargado y quemado hasta las cejas como los colegas de arriba. Si comprendes todo cómo funciona, las cosas van mejor. PrestaShop no brilla por su documentación, al igual que el código que desarrolla la gente en los módulos, donde realmente van los cógidos a pelo estén bien o estén mal, el caso es que funcionen, el problema está en que es un cristo cuando tienes problemas de compatibilidad porque con los overrides se canibalizan los unos a los otros...muchos sabréis de lo que hablo. En vez de redactar una documentación perfecta para el desarrollador el equipo de PS te lo deja en plan "hala, ahí lo llevas, que vamos por la 1.7 y todo lo anterior te lo tienes que releer" y la verdad que es frustrante para gente que viene de otro framework, he pensado muchas veces en escribir una documentación en condiciones, pero creo que siempre es mejor hacerlo en comunidad para poder evitar despistes, nadie es perfecto. Si todo fuese tan fácil de montar, ninguno estaría trabajando en desarrollo o mantenimiento, porque no sería necesario, todo es perfecto tal y como está. El comercio fluye, si no fluyes con el comercio acabarás tu carrera profesional antes de que te puedas dar cuenta, pero los sabios son los que más saben y todo lo demás es "mierda". Y como hizo thirty bees, si no te gusta lo que ves vas y te haces un fork del proyecto y desarrollas tú mismo los cambios😉 Resumen: Más documentación de calidad y menos código basura!
  11. I know this is an old thread but the stock is in another table different from product, as well as product combinations if it has combinations, so you need to find first the product ID, go to the attribute table and check the combinations made with the product ID, and finally check the stock_available for each combination. It's a little confusing but it's kinda easy when you know the structure (which is not described in the documentation, where you can find absolutely nothing)
  12. Hi, I would suggest you to create the order if it's not paid so you can track your customer for payment, but not everyone will be happy with that approach, it depends on what kind of business you are in. For the status update I'm not in that part yet, if I succeed I'll post a solution. Peace
  13. Hello, I know it's kinda late, but you should always post your shop version and php version to get more help
  14. Hi, for all those who are confused and having headaches with prestashop webservice and get multiple code errors, here are some tips you can use: 1. In order to create an order successfully, first you will need customer, customer address and cart, in that order, otherwise you won't succeed. 2.By obtaining /api/resource?schema=blank and /api/resource?schema=synopsis where resource will be "customers,addresses,carts and orders", you MUST fill in all required fields marked with "required" label in schema=synopsis 3. If you do all the steps mentioned above, you will get error 500 because you can't generate an order with an empty cart with no customer or no delivery (these fields are NOT REQUIRED for cart creation, but are MANDATORY for order creation) 4. Still, if you have issues with that, take a look at my code <?php define('PS_SHOP_PATH', 'https://url.com'); define('PS_WS_AUTH_KEY', 'your_api_key'); require_once ('./PSWebServiceLibrary.php'); function getCart($customer, $id_delivery, $id_invoice) { try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $opt = array( 'resource' => 'carts' ); //We prepare the XML in blank so we can pass parameters to the variable $cart = $webService->get(array( 'url' => PS_SHOP_PATH . '/api/carts?schema=blank' )); foreach ($resources as $nodeKey => $node) { $resources->$nodeKey = $_POST[$nodeKey]; } // Here we have XML before update, lets update XML try { $opt = array( 'resource' => 'carts' ); $cart ->cart->id_currency = 1; $cart ->cart->id_lang = 1; $cart ->cart->id_address_delivery = $id_delivery; $cart ->cart->id_address_invoice = $id_invoice; $cart ->cart->id_customer = $customer; //Multidimensional array or products for test purposes. Warning: using same array line inside the main array breaks. $product_list = array( array( 5513, 43816, 1 ) , array( 5514, 43823, 1 ) , array( 5488, 43687, 3 ) , ); //Insertion of the products inside the associations for ($i = 0;$i <= count($product_list);$i++) { $cart ->cart ->associations ->cart_rows ->cart_row[$i]->id_product = $product_list[$i][0]; $cart ->cart ->associations ->cart_rows ->cart_row[$i]->id_product_attribute = $product_list[$i][1]; $cart ->cart ->associations ->cart_rows ->cart_row[$i]->quantity = $product_list[$i][2]; } $opt['postXml'] = $cart->asXML(); //Load XML with values $cart = $webService->add($opt); // Send XML to prestashop } catch(PrestaShopWebserviceException $ex) { // Here we are dealing with errors $trace = $ex->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 />' . $ex->getMessage(); } } 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(); } return $cart ->cart->id; } ?> This is for cart creation used later in the main php file: <html><head><title>Create Order Tutorial</title></head><body> <?php /* * 2007-2020 PrestaShop SA and Contributors * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2020 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA * PrestaShop Webservice Library * @package PrestaShopWebservice */ // Here we define constants /!\ You need to replace this parameters define('DEBUG', false); define('PS_SHOP_PATH', 'https://url.com'); define('PS_WS_AUTH_KEY', 'your_api_key'); require_once ('./PSWebServiceLibrary.php'); require_once ('./GetCart.php'); // Here we use the WebService to get the schema of "customers" resource try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $opt = array( 'resource' => 'orders' ); //If I'm in creating page if (isset($_GET['Create'])) { //We prepare the XML in blank so we can pass parameters to the variable $order = $webService->get(array( 'url' => PS_SHOP_PATH . '/api/orders?schema=blank' )); } else //If not in the creating page, I retrieve the orders list $order = $webService->get($opt); //XML-> prestashop-> valor de resource que es carts $resources = $order->children() ->children(); } 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(); } if (count($_POST) > 0) //If we successfully retrieved the blank schema { //We get all the variables of blank schema foreach ($resources as $nodeKey => $node) { $resources->$nodeKey = $_POST[$nodeKey]; } // Here we have XML before update, lets update XML try { $opt = array( 'resource' => 'orders' ); if ($_GET['Create'] == 'Creating') // If we are creating { //We add required fields. This fields are ALL mandatory. These values are for testing, use your own test variables/values !!! $order->order->id_address_delivery = 2110;//Better approach is to find delivery address of customer as variable $order->order->id_address_invoice = 2110; //We pass the details to the cart, these fields are MANDATORY!!! Otherwise you will get error 500! $order->order->id_cart = getCart($order->order->id_customer, $order->order->id_address_delivery, $order->order->id_address_invoice); $order->order->id_currency = 1; $order->order->id_lang = 2110; $order->order->id_carrier = 89; $order->order->module = "ps_cashondelivery"; $order->order->payment = "Cash on delivery (COD)"; $order->order->total_paid = 41.02; $order->order->total_paid_real = 41.02; $order->order->total_products = 5; $order->order->total_products_wt = 0; $order->order->conversion_rate = 1; $opt['postXml'] = $order->asXML(); //Load XML $order = $webService->add($opt); // Send XML echo "Successfully added."; } } catch(PrestaShopWebserviceException $ex) { // Here we are dealing with errors $trace = $ex->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 />' . $ex->getMessage(); } } /////////////////////////////////////////////////////////////// // This part of the code is for display purposes // /////////////////////////////////////////////////////////////// echo '<table border="5">'; if (isset($resources)) { echo '<tr>'; if (isset($_GET['Create'])) //Display creating page { echo '<h1>Creating...give me values</h1>'; echo '<a href="?">Go back if you change your mind</a>'; echo '<form method="POST" action="?Create=Creating">'; echo '</tr>'; //Getting parameters foreach ($resources as $key => $resource) { //This array lets you display the parameters you want to display, and enter manually like customer $requiredFields = array("id_customer"); if (in_array($key, $requiredFields)) { echo '<tr><th>' . $key . '</th><td>'; echo '<input type="text" name="' . $key . '" value=""/>'; } echo '</td></tr>'; } echo '</table><br/>'; echo '<input type="submit" value="Create"></form>'; } else // Display index { echo '<h1>Here is a list</h1>'; echo '<input type="button" onClick="document.location.href=\'?Create\'" value="Create whateva">'; echo '<th>Id</th></tr>'; foreach ($resources as $resource) { echo '<tr><td>' . $resource->attributes() . '</td></tr>'; } echo '</table><br/>'; } } ?> </body></html> Everything is commented for noobs, so if you don't understand something you can always reach me and I'll try to explain. I think this kind of stuff should be included or posted in the documentation (which is REALLY poor), if not then a better debugger of the errors would be nice. Peace
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More