Jump to content

operador

Members
  • Posts

    20
  • Joined

  • Last visited

operador's Achievements

Rookie

Rookie (2/14)

  • Conversation Starter Rare
  • Dedicated Rare
  • First Post Rare
  • Collaborator Rare
  • Week One Done Rare

Recent Badges

1

Reputation

  1. I need this URL to preload that image in head.tpl like this: <link rel="preload" as="image" href="image_url /> I think javascript isn't the solution. Any idea?
  2. hello I need get the URL of cover image of the first product in categories in head.tpl Can you help me?
  3. No uso modulo de checkout y la plantilla es la classic. La versión de Prestashop es la 1.7.8.3 Uso el modo "Sin distracción" en el proceso de compra y tengo la cuenta de invitados desactivada
  4. Hola a todos Tengo un problema, que no se si es el comportamiento habitual de prestashop 1.7.8.3 Cuando un usuario quiere finalizar una compra y accede al formulario de crear nuevo cliente, si el email existe, prestashop le lleva a la pantalla de Login pero no aparece ningún error indicando: Tu email ya existe identifícate lo cual genera cierto desconcierto. Si por el contrario opta por identificarse en un primero momento pero la contraseña no es correcta, en vez de mostrar el error indicando "Email y contraseña no son correctos" le lleva al formulario para registrarse de nuevo. Esto crea un bucle absurdo ya que al crear un nuevo usuario le volverá a llevar al formulario de login porque el email ya existe ¿A alguien más le pasa? ¿Alguna idea para solucionarlo?
  5. Look this -> https://github.com/PrestaShop/PrestaShop/issues/17390 Maybe can help
  6. Solucionado. Parece que es un error de prestashop 1.6.1.6. La solución https://github.com/PrestaShop/PrestaShop/pull/5978/files
  7. Hola a todos No me había dado cuenta hasta ahora de que al crear una Regla de Compra sin ajustarla a un usuario concreto, el código de descuento generado se muestra en el apartado Mis vales de todos los usuarios registrados, mi pregunta es: ¿Como puedo crear un código de descuento que cualquiera pueda utilizar en mi tienda pero que no le aparezca en el apartado Mis vales? Mi idea es que lo vean cuando yo lo publique por email, redes sociales ... Gracias por adelantado
  8. That work fine¡¡¡ Thanks for your help rocky¡¡ Solved finally
  9. of couse class OrderConfirmationControllerCore extends FrontController { public $ssl = true; public $php_self = 'order-confirmation'; public $id_cart; public $id_module; public $id_order; public $reference; public $secure_key; /** * Initialize order confirmation controller * @see FrontController::init() */ public function init() { parent::init(); $this->id_cart = (int)(Tools::getValue('id_cart', 0)); $is_guest = false; /* check if the cart has been made by a Guest customer, for redirect link */ if (Cart::isGuestCartByCartId($this->id_cart)) { $is_guest = true; $redirectLink = 'index.php?controller=guest-tracking'; } else { $redirectLink = 'index.php?controller=history'; } $this->id_module = (int)(Tools::getValue('id_module', 0)); $this->id_order = Order::getOrderByCartId((int)($this->id_cart)); $this->secure_key = Tools::getValue('key', false); $order = new Order((int)($this->id_order)); if ($is_guest) { $customer = new Customer((int)$order->id_customer); $redirectLink .= '&id_order='.$order->reference.'&email='.urlencode($customer->email); } if (!$this->id_order || !$this->id_module || !$this->secure_key || empty($this->secure_key)) { Tools::redirect($redirectLink.(Tools::isSubmit('slowvalidation') ? '&slowvalidation' : '')); } $this->reference = $order->reference; if (!Validate::isLoadedObject($order) || $order->id_customer != $this->context->customer->id || $this->secure_key != $order->secure_key) { Tools::redirect($redirectLink); } $module = Module::getInstanceById((int)($this->id_module)); if ($order->module != $module->name) { Tools::redirect($redirectLink); } } /** * Assign template vars related to page content * @see FrontController::initContent() */ public function initContent() { parent::initContent(); $cart = new Cart($this->id_cart, $this->context->language->id); $products = $cart->getProducts(); $this->context->smarty->assign(array( 'is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); if ($this->context->customer->is_guest) { $this->context->smarty->assign(array( 'id_order' => $this->id_order, 'products' => $products, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email )); /* If guest we clear the cookie for security reason */ $this->context->customer->mylogout(); } $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); } /** * Execute the hook displayPaymentReturn */ public function displayPaymentReturn() { if (Validate::isUnsignedId($this->id_order) && Validate::isUnsignedId($this->id_module)) { $params = array(); $order = new Order($this->id_order); $currency = new Currency($order->id_currency); if (Validate::isLoadedObject($order)) { $params['total_to_pay'] = $order->getOrdersTotalPaid(); $params['currency'] = $currency->sign; $params['objOrder'] = $order; $params['currencyObj'] = $currency; return Hook::exec('displayPaymentReturn', $params, $this->id_module); } } return false; } /** * Execute the hook displayOrderConfirmation */ public function displayOrderConfirmation() { if (Validate::isUnsignedId($this->id_order)) { $params = array(); $order = new Order($this->id_order); $currency = new Currency($order->id_currency); if (Validate::isLoadedObject($order)) { $params['total_to_pay'] = $order->getOrdersTotalPaid(); $params['currency'] = $currency->sign; $params['objOrder'] = $order; $params['currencyObj'] = $currency; return Hook::exec('displayOrderConfirmation', $params); } } return false; } }
  10. Thanks rocky, I tried this too, but de issue is like OrderConfirmationController.php dont pass variables to tpl file. I use print_r to check the values, and all variables from OrderConfirmationController.php print "1" in order-confirmation.tpl {$id_order|print_r} this print 1 {$email|print_r} this print 1
  11. print_r($products); Works fine in php file. Show all info about the order, but {$products|print_r} in tpl file print "1" value Any idea?
  12. I add this code OrderConfirmationController.php, then I add this other code in order-confirmation.tlp but it dont work: {foreach $products as $product} '{$product["id_product"]}', {/foreach}
  13. I need get the Product Id´s from an order in order-confirmation.tpl I suppose I have to use an foearch but I dont know so much about smarty Can you help me?
×
×
  • Create New...