Jump to content

crisalidainhalada

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by crisalidainhalada

  1. Estoy en la misma, quiero agregar una variable que intento obtener de la DB al template shipping.html.twig en la pagina del Pedido. Todavia no he logrado en mi caso encontrar el metodo render que agrega todas las variables ya existentes en el template, pero si puedo ayudarte con el hecho de como sobreescribir el template sin tocar el core. Basicamente la unica manera (y la oficial mencionada en la documentacion de PS) es creando un modulo. No necesita ser un modulo especifico ni estar ubicado en ningun hook en particular, podes crearlo con ESTA herramienta de prestashop y luego una vez creado el modulo, dentro de la carpeta Views del modulo debes crear la misma ruta del template que queres sobreescribir. Si el tempate tiene blocks podes extender el original y solo sobreescribir el bloque deseado o directamente sobreescribir todo el template. Aca te dejo el link de la docu oficial donde lo explica con un ejemplo. https://devdocs.prestashop-project.org/1.7/modules/concepts/templating/admin-views/ Nota: con la herramienta para generar el boilerplate del modulo tenes que tener una consideracion en el campo Module name debes poner el nombre del modulo sin espacios, pero utiliza solo PascalCase no camelCase, no kebab-case, no snake_case. Porque es este campo el que va a utilizar para crear el nombre de la class php ppal del modulo y si usas guiones vas a generar un error de sintaxis y cuando lo instales va a romper.
  2. Hi all! I had the same problem. In my case I suppose that the issue is with one custom carrier API (from Envio Pack company) that I have installed, but maybe not and the problem is with prestashop, I'm not completly sure so I will share my case and my solution with you. Maybe this isn't the best solution from technical point of view, is a brute way, but it worked for me. If you find or know the root of issue, share it with me please. My problem happened during the purchase process, when you selected some carrier custom carrier option no payment option appeared available in the next step, but if you selected "pick up from shop" all payment options was available, then the problem was not with country, currency or group restrictions. I Though that the issue was in the carrier module (am owned module) I researched regarding tables relationships and found that on table ps_module_carrier (a table that stores relationships between modules and carriers) some records was missing. For some reason the custom carriers did not mantain any relationship with any payment module. I though as a quick solution that I' ll insert the missing records in the DB manually. I KNOW!, a very unstable and inconsistent way... buuut I needed to work... to sell my production so... Here my brute solution: The table structure is module_id | shop_id | carrier_id Then I needed to know two IDs (one from module, and one from carrier), Module_ID Carrier_ID * For the first I searched in ps_module table. what I searched? well in my case I have 2 payments way active "Wire Transfer" and "Mercadopago" (a custom payment module installed in my prestashop) I needed its IDs then I made a simple query to found it SELECT id_module, name FROM `ps_module` WHERE name LIKE '%wire%' OR name LIKE '%mercado%' This query return 2 records with following information id_module | name 29 | ps_wirepayment 95 | mercadopago * for the other, the carrier_id i searched in ps_carrier table, in this case I searched manually because, I wasn't sure the name from the carriers, so of all records I just paid attention to the followings id_carrier | ... | name | url 1 | ... | (yout shop name) | ... 24 | ... | Envio a sucursal | https://seguimiento.enviopack.com/@ 25 | ... | Envio a domicilio | https://seguimiento.enviopack.com/@ 26 | ... | Envio a domicilio | https://seguimiento.enviopack.com/@ 27 | ... | Envio a domicilio | https://seguimiento.enviopack.com/@ why those records? because the first (1, shop name) is the record that represent the "pick up from shop" and the 24,25,26,27 (enviopack) are the records that represents different options from my custom installed module. You should search for the carriers that you want to add. Well, right now we have all IDs that we needed so we will proceed with made a query that insert these records into ps_module_carrier INSERT INTO ps_module_carrier VALUES(29,1,24); INSERT INTO ps_module_carrier VALUES(29,1,25); INSERT INTO ps_module_carrier VALUES(29,1,26); INSERT INTO ps_module_carrier VALUES(29,1,27); INSERT INTO ps_module_carrier VALUES(95,1,24); INSERT INTO ps_module_carrier VALUES(95,1,25); INSERT INTO ps_module_carrier VALUES(95,1,26); INSERT INTO ps_module_carrier VALUES(95,1,27); I performed it and done! Well as I said previously, maybe my problem was with enviopack module, and do not work for you, but if you check that your case is also with missing relationships between carriers and modules, this solution can give you a quickly solution, and/or give any idea for some contributor. byeee!
×
×
  • Create New...