Jump to content

jaimesks

Members
  • Posts

    23
  • Joined

  • Last visited

Profile Information

  • Location
    España

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jaimesks's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. he estado toda la tarde investigando la forma de conectar mi cuenta Gsuite de google para que envie correos y no puedo hacerlo desde que google desactivo las aplicaciones menos seguras alguno sabe alguna forma de poder utilizar este servicio de correo o tengo que migrar a otra empresa
  2. I am trying to create a different redirect after a customer is registered any hint of how I can do this in prestashop 1.7.6
  3. <?php /** * 2007-2018 PrestaShop * * 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: * https://opensource.org/licenses/OSL-3.0 * 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-2018 PrestaShop SA * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ use Symfony\Component\Translation\TranslatorInterface; class CustomerFormatterCore implements FormFormatterInterface { private $translator; private $language; private $ask_for_birthdate = true; private $ask_for_partner_optin = true; private $partner_optin_is_required = true; private $ask_for_password = true; private $password_is_required = true; private $ask_for_new_password = false; public function __construct( TranslatorInterface $translator, Language $language ) { $this->translator = $translator; $this->language = $language; } public function setAskForBirthdate($ask_for_birthdate) { $this->ask_for_birthdate = $ask_for_birthdate; return $this; } public function setAskForPartnerOptin($ask_for_partner_optin) { $this->ask_for_partner_optin = $ask_for_partner_optin; return $this; } public function setPartnerOptinRequired($partner_optin_is_required) { $this->partner_optin_is_required = $partner_optin_is_required; return $this; } public function setAskForPassword($ask_for_password) { $this->ask_for_password = $ask_for_password; return $this; } public function setAskForNewPassword($ask_for_new_password) { $this->ask_for_new_password = $ask_for_new_password; return $this; } public function setPasswordRequired($password_is_required) { $this->password_is_required = $password_is_required; return $this; } public function getFormat() { $format = []; $format['id_customer'] = (new FormField) ->setName('id_customer') ->setType('hidden') ; $format['nombre_negocio'] = (new FormField) ->setName('nombre_negocio') ->setType('text') ->setLabel( $this->translator->trans( 'Nombre del Negocio', [], 'Shop.Forms.Labels' ) ) ->setRequired(true) ; $format['firstname'] = (new FormField) ->setName('firstname') ->setLabel( $this->translator->trans( 'Nombre de contacto', [], 'Shop.Forms.Labels' ) ) ->setRequired(true) ; $format['atendido'] = (new FormField) ->setName('atendido') ->setType('text') ->setLabel( $this->translator->trans( 'Atendido por', [], 'Shop.Forms.Labels' ) ) ->setRequired(true); $genderField = (new FormField) ->setName('id_gender') ->setType('radio-buttons') ->setLabel( $this->translator->trans( 'Social title', [], 'Shop.Forms.Labels' ) ) ; foreach (Gender::getGenders($this->language->id) as $gender) { $genderField->addAvailableValue($gender->id, $gender->name); } $format['lastname'] = (new FormField) ->setName('lastname') ->setLabel( $this->translator->trans( 'Last name', [], 'Shop.Forms.Labels' ) ) ->setType('hidden') ->setRequired(true) ->setValue('Actualizar') ; if (Configuration::get('PS_B2B_ENABLE')) { $format['company'] = (new FormField) ->setName('company') ->setType('text') ->setType('hidden') ->setLabel($this->translator->trans( 'Company', [], 'Shop.Forms.Labels' )); } $format['email'] = (new FormField) ->setName('email') ->setType('email') ->setLabel( $this->translator->trans( 'Correo Electronico', [], 'Shop.Forms.Labels' ) ) ->setRequired(true) ; $format['tlf_movil'] = (new FormField) ->setName('tlf_movil') ->setType('text') ->setLabel( $this->translator->trans( 'Telefono Movil', [], 'Shop.Forms.Labels' ) ); $format['recomendado'] = (new FormField) ->setName('recomendado') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Recomendado', [], 'Shop.Theme.Customeraccount' ) ) ; $format['google'] = (new FormField) ->setName('google') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Google', [], 'Shop.Theme.Customeraccount' ) ) ; $format['facebook'] = (new FormField) ->setName('facebook') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Facebook', [], 'Shop.Theme.Customeraccount' ) ) ; $format['folleto'] = (new FormField) ->setName('folleto') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Buzoneo', [], 'Shop.Theme.Customeraccount' ) ) ; $format['telemarketing'] = (new FormField) ->setName('telemarketing') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Telemarketing', [], 'Shop.Theme.Customeraccount' ) ) ; $format['visita'] = (new FormField) ->setName('visita') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Visita', [], 'Shop.Theme.Customeraccount' ) ) ; $format['violocal'] = (new FormField) ->setName('violocal') ->setType('checkbox') ->setLabel( $this->translator->trans( 'Vio el local', [], 'Shop.Theme.Customeraccount' ) ) ; $format['tlf_fijo'] = (new FormField) ->setName('tlf_fijo') ->setType('text') ->setLabel( $this->translator->trans( 'Telefono Fijo', [], 'Shop.Forms.Labels' ) ); $format['direccion_negocio'] = (new FormField) ->setName('direccion_negocio') ->setType('text') ->setLabel($this->translator->trans('Direccion del Negocio', [], 'Shop.Forms.Labels')); $format['codigo_postal_negocio'] = (new FormField) ->setName('codigo_postal_negocio') ->setType('text') ->setLabel($this->translator->trans('Codigo posta del Negocio', [], 'Shop.Forms.Labels')); $format['localidad_negocio'] = (new FormField) ->setName('localidad_negocio') ->setType('text') ->setLabel($this->translator->trans('Localidad del Negocio', [], 'Shop.Forms.Labels')); $format['provincia_negocio'] = (new FormField) ->setName('provincia_negocio') ->setType('text') ->setLabel($this->translator->trans('Provincia del Negocio', [], 'Shop.Forms.Labels')); $format['contacto1'] = (new FormField) ->setName('contacto1') ->setType('text') ->setLabel($this->translator->trans('Contacto 2', [], 'Shop.Forms.Labels')); $format['telefono1'] = (new FormField) ->setName('telefono1') ->setType('text') ->setLabel($this->translator->trans('Telefono 2', [], 'Shop.Forms.Labels')); $format['mail1'] = (new FormField) ->setName('mail1') ->setType('mail') ->setLabel($this->translator->trans('Correo Electronico 2', [], 'Shop.Forms.Labels')); if ($this->ask_for_password) { $format['password'] = (new FormField) ->setName('password') ->setType('text') ->setValue('12345') ->setType('hidden') ->setLabel( $this->translator->trans( 'Password', [], 'Shop.Forms.Labels' ) ) ; } if ($this->ask_for_new_password) { $format['rason_social'] = (new FormField) ->setName('rason_social') ->setType('text') ->setLabel($this->translator->trans('Razón social', [], 'Shop.Forms.Labels')); $format['cif'] = (new FormField) ->setName('cif') ->setType('text') ->setLabel($this->translator->trans('CIF', [], 'Shop.Forms.Labels')); $format['direccion_fiscal'] = (new FormField) ->setName('direccion_fiscal') ->setType('text') ->setLabel($this->translator->trans('Direccion Fiscal', [], 'Shop.Forms.Labels')); $format['codigo_postal_fiscal'] = (new FormField) ->setName('codigo_postal_fiscal') ->setType('text') ->setLabel($this->translator->trans('Codigo postal Fiscal', [], 'Shop.Forms.Labels')); $format['localidad_fiscal'] = (new FormField) ->setName('localidad_fiscal') ->setType('text') ->setLabel($this->translator->trans('Localidad Fiscal', [], 'Shop.Forms.Labels')); $format['provincia_fiscal'] = (new FormField) ->setName('provincia_fiscal') ->setType('text') ->setLabel($this->translator->trans('Provincia Fiscal', [], 'Shop.Forms.Labels')); $format['contacto2'] = (new FormField) ->setName('contacto2') ->setType('text') ->setLabel($this->translator->trans('Contacto 3', [], 'Shop.Forms.Labels')); $format['telefono2'] = (new FormField) ->setName('telefono2') ->setType('text') ->setLabel($this->translator->trans('Telefono 3', [], 'Shop.Forms.Labels')); $format['mail2'] = (new FormField) ->setName('mail2') ->setType('mail') ->setLabel($this->translator->trans('Email 3', [], 'Shop.Forms.Labels')); $format['contacto3'] = (new FormField) ->setName('contacto3') ->setType('text') ->setLabel($this->translator->trans('Contacto 4', [], 'Shop.Forms.Labels')); $format['telefono3'] = (new FormField) ->setName('telefono3') ->setType('text') ->setLabel($this->translator->trans('Telefono 4', [], 'Shop.Forms.Labels')); $format['mail3'] = (new FormField) ->setName('mail3') ->setType('mail') ->setLabel($this->translator->trans('Email 4', [], 'Shop.Forms.Labels')); $format['contacto4'] = (new FormField) ->setName('contacto4') ->setType('text') ->setLabel($this->translator->trans('Contacto 5', [], 'Shop.Forms.Labels')); $format['telefono4'] = (new FormField) ->setName('telefono4') ->setType('text') ->setLabel($this->translator->trans('Telefono 5', [], 'Shop.Forms.Labels')); $format['mail4'] = (new FormField) ->setName('mail4') ->setType('mail') ->setLabel($this->translator->trans('Email 5', [], 'Shop.Forms.Labels')); $format['contacto5'] = (new FormField) ->setName('contacto5') ->setType('text') ->setLabel($this->translator->trans('Contacto 6', [], 'Shop.Forms.Labels')); $format['telefono5'] = (new FormField) ->setName('telefono5') ->setType('text') ->setLabel($this->translator->trans('Telefono 6', [], 'Shop.Forms.Labels')); $format['mail5'] = (new FormField) ->setName('mail5') ->setType('mail') ->setLabel($this->translator->trans('Email 6', [], 'Shop.Forms.Labels')); $format['new_password'] = (new FormField) ->setName('new_password') ->setType('password') ->setType('hidden') ->setLabel( $this->translator->trans( 'New password', [], 'Shop.Forms.Labels' ) ) ; } // ToDo, replace the hook exec with HookFinder when the associated PR will be merged $additionalCustomerFormFields = Hook::exec('additionalCustomerFormFields', array(), null, true); // TODO: TVA etc.? return $this->addConstraints($format); } private function addConstraints(array $format) { $constraints = Customer::$definition['fields']; foreach ($format as $field) { if (!empty($constraints[$field->getName()]['validate'])) { $field->addConstraint( $constraints[$field->getName()]['validate'] ); } } return $format; } }
  4. ¿Can someone explain to me what these methods do? public function postProcess() { parent::postProcess(); if (Tools::isSubmit('submitReorder') && $id_order = (int) Tools::getValue('id_order')) { $oldCart = new Cart(Order::getCartIdStatic($id_order, $this->context->customer->id)); $duplication = $oldCart->duplicate(); if (!$duplication || !Validate::isLoadedObject($duplication['cart'])) { $this->errors[] = $this->trans('Sorry. We cannot renew your order.', array(), 'Shop.Notifications.Error'); } elseif (!$duplication['success']) { $this->errors[] = $this->trans( 'Some items are no longer available, and we are unable to renew your order.', array(), 'Shop.Notifications.Error' ); } else { $this->context->cookie->id_cart = $duplication['cart']->id; $context = $this->context; $context->cart = $duplication['cart']; CartRule::autoAddToCart($context); $this->context->cookie->write(); Tools::redirect('https://www.graficosta.com/carrito?action=show'); } } $this->bootstrap(); } AND public function hookActionCartSave() { $this->calculator->emptyCache(); if (Tools::getIsset('submitReorder') && $this->duplicate_order) { $id_order_old = Tools::getValue('id_order'); $cookie = new Cookie('reorder'); $cookie->setExpire(time() + 20 * 60); $cookie->id_order_old = $id_order_old; $cookie->write(); $this->duplicate_order = false; } if (! Validate::isLoadedObject($this->context->cart)) { return; } $id_cart = (int)$this->context->cart->id; $id_special = $this->handler->getSpecialProduct(); if ($id_special) { $id_lang = $this->context->language->id; $id_shop = $this->context->shop->id; $product_special = new Product($id_special, false, $id_lang, $id_shop, $this->context); $quantity = $this->context->cart->containsProduct($id_special); $quantity = isset($quantity['quantity']) ? (int)$quantity['quantity'] : 0; if ($product_special->active && DynamicInput::cartHasCustomization($id_cart)) { if (!$quantity) { $this->context->cart->updateQty(1, $id_special); } elseif ($quantity > 1) { $this->context->cart->updateQty($quantity - 1, $id_special, null, false, 'down'); } } elseif ($quantity) { $this->context->cart->deleteProduct($id_special); } } $where = ''; $id_guest = (int)$this->context->cookie->id_guest; $id_customer = (int)$this->context->cookie->id_customer; if ($id_customer && $id_guest) { $where = 'AND (id_customer = '.(int)$id_customer.' OR id_guest = '.(int)$id_guest.')'; } elseif ($id_customer) { $where = 'AND id_customer = '.(int)$id_customer; } elseif ($id_guest) { $where = 'AND id_guest = '.(int)$id_guest; } if (! empty($where)) { $sql = 'UPDATE `'._DB_PREFIX_.$this->name.'_input` SET `id_cart` = '.(int)$id_cart.' WHERE `id_cart` = 0 '.pSQL($where); Db::getInstance()->execute($sql); } } OrderController.php dynamicproduct.php
  5. How could you include only the header in a page.php that is, I would like to enter the header.tpl only inside my php code
  6. Como podría incluir solo el header en una pagina.php es decir me gustaría introducir el header.tpl solo dentro de mi código php
  7. I have the need to create a list of clients and log in with them in a very fast way. all customers have the same password I do not know how I could create the session for each of them
  8. When customers want to buy the same order again, it loads them directly, I would like them to show the products in the cart HistoryController.php public static function getUrlToReorder($id_order, $context) { $url_to_reorder = ''; if (!(bool) Configuration::get('PS_DISALLOW_HISTORY_REORDERING')) { $url_to_reorder = $context->link->getPageLink('order', true, null, 'submitReorder&id_order='.(int) $id_order); } return $url_to_reorder; }
  9. I have the need to modify the prices of each product added to the cart, as a discount or something similar manually Basically I would like to choose the product and put the price manually I've been looking at the file cart.php but I do not get anything clear
  10. I have the need to modify the status of an order from front office (order history) for my store, you can guide me a little
  11. Desde hace un tiempo tengo problemas para iniciar sesión blackoffice, solo puedo acceder borrando el historial del navegador, si utilizo el navegador incógnito después de un tiempo sucede lo mismo básicamente introduzco la contraseña y se queda en la misma pagina no entra al blackoffice he borrado el chache, actualizado, reinstalado el certificado ssl, reiniciado el servidor, no se que podrá ser. también tengo el opcache de php activado
×
×
  • Create New...