Jump to content

pepitofgg

Members
  • Posts

    27
  • Joined

  • Last visited

Profile Information

  • Location
    Spain
  • Activity
    Freelancer

Recent Profile Visitors

1,751,733 profile views

pepitofgg's Achievements

Newbie

Newbie (1/14)

7

Reputation

  1. Hola Zebrama. Yo aun no he encontrado una forma fácil de hacerlo. Por ahora, lo que hago es ir guardando un histórico de las modificaciones que hago en local, lo más detallado posible. Luego, cuando una modificación me va bien en local, subo los ficheros que haya modificado, y el resto de cambios los vuelvo a hacer en remoto, usando como guión el histórico. Es un poco tedioso, pero tiene la ventaja añadida de que si en el futuro actualizo a otra versión de Prestashop, será más fácil rehacer todos los cambios que hice para la versión actual. De todas formas, si encuentras algo por ahí, te agradecería que lo postearas aquí (no sigo el foro en francés, porque no domino el idioma de Asterix).
  2. Esto debe ser bastante común, pero no encuentro nada por más que busco. Supongamos esta situación: Por un lado, tengo una tienda funcionando, en un host de pago, en Prestashop 1.5.4.1. Por otro lado, tengo la misma tienda, en un servidor local, para hacer modificaciones, añadir prestaciones, probar configuraciones mejores, etc, y poder probarlas en local. Una vez que todo está como yo quiero en local, ahora tengo que subir los cambios que haya hecho, a la tienda real, la que está alojada en un host, pero sin que se pierdan datos de pedidos, clientes, productos, etc de la tienda real, y sin que se añadan pedidos, clientes, productos, etc, de la tienda de pruebas local a la tienda real alojada en el host. ¿Alguien puede decirme como se hace esto? He visto explicaciones para migrar de una versión a otra, para exportar productos y categorías de un Prestashop a otro, etc, pero no veo como hacer esto, que debería ser algo común. Entiendo que si he modificado o añadido ficheros (php, tpl, módulos) tengo que subirlos, eso está claro. El problema está en que los cambios en la configuración de Prestashop, en los CMS, y en determinados módulos, afectan a la base de datos, y por tanto habría que exportar la base de datos también, pero sólo la parte que afecte a esos cambios, y no a los pedidos, clientes, etc, que deberían conservarse sólo los de la tienda real. En fin, a ver si alguien puede orientarme.
  3. Por si a alguien le sirve, yo lo he solucionado haciendo un truco un poco cutre pero válido si el embalaje tiene un peso fijo. En mi caso, el embalaje es siempre un sobre burbuja de tamaño fijo, y por tanto de peso fijo. Supongamos que el embalaje pesa 100g, y tu empresa de transporte tiene tres tramos de peso, hasta 500g, hasta 1000g y hasta 2000g. Lo normal sería definir los tres rangos de peso, uno de 0 a 499g, otro de 500g a 999g, y otro de 1000g a 1999g. Pero en lugar de eso, defines uno de 0 a 399g, otro de 400g a 899g, y otro de 900g a 1899g, y listo. No es perfecto, y según para qué tipo de tienda servirá o no, pero a mí me funciona.
  4. I have found that solution for PS 1.5.5: https://github.com/PrestaShop/PrestaShop/commit/9ff0d601589fdf791a8bd895de187bb45eb7939f It works in my PS 1.5.4.1 making theese changes in classes\order\OrderHistory.php file: Arround line 370, replace this: SELECT osl.`template`, c.`lastname`, c.`firstname`, osl.`name` AS osname, c.`email`, os.`module_name` by this: SELECT osl.`template`, c.`lastname`, c.`firstname`, osl.`name` AS osname, c.`email`, os.`module_name`, os.`id_order_state` And arround line 403, replace this: if (Validate::isLoadedObject($order)) Mail::Send((int)$order->id_lang, $result['template'], $topic, $data, $result['email'], $result['firstname'].' '.$result['lastname'], null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop); by this: if (Validate::isLoadedObject($order)) { // Join PDF invoice if order state is "payment accepted" if ((int)$result['id_order_state'] === 2 && (int)Configuration::get('PS_INVOICE') && $order->invoice_number) { $context = Context::getContext(); $pdf = new PDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE, $context->smarty); $file_attachement['content'] = $pdf->render(false); $file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf'; $file_attachement['mime'] = 'application/pdf'; } else $file_attachement = null; Mail::Send((int)$order->id_lang, $result['template'], $topic, $data, $result['email'], $result['firstname'].' '.$result['lastname'], null, null, $file_attachement, null, _PS_MAIL_DIR_, false, (int)$order->id_shop); } I guess it will not be difficult to adapt these changes to other sub-versions of PS 1.5.
  5. Wow! Scorpionsworld, you're my hero. A superb explanation. In my first attemp it didn't go, because my Prestashop is 1.5.4.1, and the override you posted is for 1.5.5. But with your explanation, and using your override as a guide, I created my own one, starting from original PaymentModule.php of 1.5.4.1 version, and now everything works perfect. Many many thanks.
  6. I think I have read the whole thread, and have found nothing about that (I can be wrong, because of my poor English). If I understand, it is possible to avoid this issue adding any code to PaymentModule controller. Can you post a bit more detailed explanation? I have only some knowledge of php, but I would fix it, if only temporarily. Thanks
  7. First, all my thanks, Scorpionsworld. Your module is almost perfect. But I have found a small bug. When a customer spends a part of a discount voucher, then a new discount voucher is created with the rest of the money, and an email is sent to the customer, with the new voucher code. In that email, and only in it, still appears the order number in the old format. It should be easy to correct that bug, I suppose, but I have no idea on how to do it Anyway, thank you very much.
×
×
  • Create New...