-
Posts
19 -
Joined
-
Last visited
About José Antonio
- Birthday 01/05/1988
Profile Information
-
Location
Spain
-
Activity
Web development agency
Recent Profile Visitors
1,899,850 profile views
José Antonio's Achievements
-
Invoice template by iso country
José Antonio replied to José Antonio's topic in Taxes, Translations & Laws
Hi. Template by state is default in prestashop, you must create template as invoice.iso_country.tpl in pdf folder. Example: invoice.61.tpl You can see this function on ROOT/classes/pdf/HTMLTemplateInvoice.php protected function getTemplateByCountry($iso_country) { $file = Configuration::get('PS_INVOICE_MODEL'); // try to fetch the iso template $template = $this->getTemplate($file . '.' . $iso_country); // else use the default one if (!$template) { $template = $this->getTemplate($file); } return $template; } I modified the function for a template by state. Regards. -
How can I make a field required by state? For example, if the user chooses country: Canada, now request identification number is optional, this is a prestashop option but if you choose city: Ontario (contains states), identification number is required I've tried a thousand ways but I think it would be best to do it using javascript, any ideas?
-
OK, solved.... ithink <FILE original="pdf/invoice.addresses-tab.tpl" source-language="en-US" target-language="en" datatype="plaintext"> <BODY> <TRANS-UNIT id="1f2f0f119a907c6c67a3c6fcde0193ab"> <SOURCE>simplified</SOURCE> <TARGET>simplified</TARGET> <NOTE>Context: File: pdf/invoice.addresses-tab.tpl:36</NOTE> </TRANS-UNIT> I have changed trans-unit for a random one and it works in translations -> Shop - PDF
- 1 reply
-
- translations
- invoice
-
(and 1 more)
Tagged with:
-
It is impossible in prestashop 1.7 to add new text on the invoice with translation! Insert on invoices.adresses-tab.tpl {l s='simplified' d='Shop.Pdf' pdf='true'} I do not have a cache, I have recompiled, I have tried different formats, I have seen a thousand tutorials but none have found the text in translations. Can anybody help me? I'm desperate
- 1 reply
-
- translations
- invoice
-
(and 1 more)
Tagged with:
-
Invoice template by iso country
José Antonio replied to José Antonio's topic in Taxes, Translations & Laws
solved: $state = $delivery_address->id_state; ///// return $this->smarty->fetch($this->getTemplateByState($state)); ///// protected function getTemplateByState($state) { $file = Configuration::get('PS_INVOICE_MODEL'); // try to fetch the iso template $template = $this->getTemplate($file.'.'.$state); // else use the default one if (!$template) { $template = $this->getTemplate($file); } return $template; } -
Invoice template by iso country
José Antonio replied to José Antonio's topic in Taxes, Translations & Laws
Ok, its solved, filenamed as invoice.US.tpl but i want take ISO by state no country. public function getContent() { $invoiceAddressPatternRules = json_decode(Configuration::get('PS_INVCE_INVOICE_ADDR_RULES'), true); $deliveryAddressPatternRules = json_decode(Configuration::get('PS_INVCE_DELIVERY_ADDR_RULES'), true); $invoice_address = new Address((int)$this->order->id_address_invoice); $country = new Country((int)$invoice_address->id_country); $state = new State((int)$invoice_address->id_state); $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, $invoiceAddressPatternRules, '<br />', ' '); $delivery_address = null; $formatted_delivery_address = ''; if (isset($this->order->id_address_delivery) && $this->order->id_address_delivery) { $delivery_address = new Address((int)$this->order->id_address_delivery); $state = new State((int)$id_address_delivery->id_state); $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, $deliveryAddressPatternRules, '<br />', ' '); } ////////////////////// return $this->smarty->fetch($this->getTemplateByState($state->iso_code)); ////////////////////// protected function getTemplateByState($iso_state) { $file = Configuration::get('PS_INVOICE_MODEL'); // try to fetch the iso template $template = $this->getTemplate($file.'.'.$iso_state); // else use the default one if (!$template) { $template = $this->getTemplate($file); } return $template; } Not working -
José Antonio changed their profile photo
-
I can not make this function work. I should take the invoice template by country code, I have tried as invoice.tpl.US or invoice.US but it does not work, it always returns template by default, does anyone know how to create templates by delibery address? HTMLTemplateIvoice.tpl /** * Returns the invoice template associated to the country iso_code * * @param string $iso_country */ protected function getTemplateByCountry($iso_country) { $file = Configuration::get('PS_INVOICE_MODEL'); // try to fetch the iso template $template = $this->getTemplate($file.'.'.$iso_country); // else use the default one if (!$template) { $template = $this->getTemplate($file); } return $template; } I need to use templates by country of delibery destination. Thanks!
-
[Solved] Estadisticas en 1.5.6 no me funcionan
José Antonio replied to mlarbi's topic in Discusión general
Pero has mirado donde tienes instalados los hooks?? debes tenerlo en al menos 2 sitios, creacion de cuenta, autentificacion -
SOLUCIONADO... Soy nuevo en prestashop....resulta que el módulo que genera el sitemap en (seo search page) modulo sitemap....ese enlace no es válido, hay que introducir sin más tu sitemap del directorio raíz, un sitemap .xml, que aunque para la mayoría es obvio, para mí ha sido una hazaña porque no se programación.
-
Hola a todo: Haber si alguien me ayuda a solucionar algo con lo que llevo días y días y no encuentro solución Al enviar mi sitemap de prestashop 1.5 a webmaster tools google y bing me da el siguiente error - Bloqueado por robots.txt ¿qué puedo hacer para poder solucionar esto? no me sirve de nada la ayuda de google ni de bing. ¿esto hace que mi página no se indexe en los buscadores? Gracias, agradecería cualquier tipo de ayuda
-
[Solved] Estadisticas en 1.5.6 no me funcionan
José Antonio replied to mlarbi's topic in Discusión general
Has comprobado la fecha para comprobar en la parte de arriba del gráfico?? Otra cosa que suele pasar, cuando se le da demasiado margen te aparece cero. Ej: tenerlo configurado para que mira desde hace dos dias hasta seis meses después, suele pasar que no te muestra ningún dato, intenta que el rango sea de unos días y que además las fechas esten correctas. A mi me pasó lo mismo y luego al concretar más las fechas se soluciona solo el problema, prueba aver y nos cuentas. A unas malas reinicia el módulo de estadísticas e intenta verificar que los hooks están bien insertados -
[sOLUCIONADO] Aunque no os puedo dar una solucion concreta, lo que hice fué ponerme en contacto con el técnico de themeforest, la verdad son muy rápidos y muy simpaticos, estoy bastante contento de haberle comprado la plantilla a ellos, responden muy bien y te ayudan muchísimo. Suerte
-
No, no está resuelto, te explico: lo he visto porque he abierto el live edit de posicionar módulos, y se ve que está ahí, pero no ocupa el enorme espacio que suele ocupar, por lo que parece no se ejecuta, por eso no se ve en el front office, pero como insertado está. Lo que me falta por averiguar es por qué no se ejecuta. Al no ejecutarse simplemente no se muestra, el live edit sólo te dice :- oye aqui tienes un módulo!. Pero no consigo hacerlo funcionar ni haciendo todas las cosas que ya dije antes. Ahora también supongo que fué algo que dejo de funcionar en la base de datos, pues resulta que el editor de configuración templain no guarda los datos en archivos tpl ni css ni nada por el estilo, parece que los guarda y los destruye de la base de datos. Creo que es así pero seguro que me equivoco en muchas cosas, no quiero que se ofenda nadie, soy un principiante de principiante, no sé ni un milésima parte de lo que vosotros sabeis. si necesitas algun dato mas o algún acceso te lo proporcionare con mucho gusto, y a quien sea tambien porque me trae loco este problema. Gracias a todos