Vanesax Posted November 14, 2014 Share Posted November 14, 2014 Hola a tod@s, tengo una duda, cuando un cliente recibe un email de informacion y confirmacion de su compra, el correo que recibe pone una frase asi: Si usted tiene una cuenta de invitado, puede seguir su pedido a través del "Tracking Invitado" sección de nuestra tienda.-- Al clicar, te dirige a una pagina donde hay que poner el numero de pedido y la direccion de email para realizar el seguimiento del pedido, pero solo lo puede hacer una cuenta de invitado, pero como invitado yo no dejo comprar, ¿como puedo hacer eso mismo desde una cuenta de un cliente registrado? Ya que al meter uno los datos estando registrado me dice que solo es para cuentas de invitado....¿alguna solucion a este jaleo? Tengo Prestashop 1.6 Muchas gracias a todos por adelantado. Un saludo. Link to comment Share on other sites More sharing options...
Rolige Posted November 14, 2014 Share Posted November 14, 2014 Efectivamente es solo para pedidos con invitado, el cliente común no necesita esto porque puede ingresar a su cuenta y ver los detalles del pedido, para hacer posible lo que quieres quizá tendrías que hacer algunos cambios en el archivo GuestTrackingController.php que creo es el encargado de validar esa información. 1 Link to comment Share on other sites More sharing options...
Vanesax Posted November 15, 2014 Author Share Posted November 15, 2014 (edited) Efectivamente es solo para pedidos con invitado, el cliente común no necesita esto porque puede ingresar a su cuenta y ver los detalles del pedido, para hacer posible lo que quieres quizá tendrías que hacer algunos cambios en el archivo GuestTrackingController.php que creo es el encargado de validar esa información. Hola COTOKO, muchas gracias por responder, ¿donde podria conseguir esa información para modificar el archivo GuestTrackingController.php? ¿tienes idea de como hacerlo mas o menos? Muchas gracias y un saludo. Pongo aqui el archivo por si alguien sabe que modificar o añadir: <?php /* * 2007-2014 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: * http://opensource.org/licenses/osl-3.0.php * 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-2014 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class GuestTrackingControllerCore extends FrontController { public $ssl = true; public $php_self = 'guest-tracking'; /** * Initialize guest tracking controller * @see FrontController::init() */ public function init() { $this->display_column_left = false; parent::init(); if ($this->context->customer->isLogged()) Tools::redirect('history.php'); } /** * Start forms process * @see FrontController::postProcess() */ public function postProcess() { if (Tools::isSubmit('submitGuestTracking') || Tools::isSubmit('submitTransformGuestToCustomer')) { // These lines are here for retrocompatibility with old theme $id_order = Tools::getValue('id_order'); $order_collection = array(); if ($id_order) { if (is_numeric($id_order)) { $order = new Order((int)$id_order); if (Validate::isLoadedObject($order)) $order_collection[] = $order; } else $order_collection = Order::getByReference($id_order); } // Get order reference, ignore package reference (after the #, on the order reference) $order_reference = current(explode('#', Tools::getValue('order_reference'))); // Ignore $result_number if (!empty($order_reference)) $order_collection = Order::getByReference($order_reference); $email = Tools::getValue('email'); if (empty($order_reference) && empty($id_order)) $this->errors[] = Tools::displayError('Please provide your order\'s reference number.'); else if (empty($email)) $this->errors[] = Tools::displayError('Please provide a valid email address.'); else if (!Validate::isEmail($email)) $this->errors[] = Tools::displayError('Please provide a valid email address.'); else if (!Customer::customerExists($email, false, false)) $this->errors[] = Tools::displayError('There is no account associated with this email address.'); else if (Customer::customerExists($email, false, true)) { $this->errors[] = Tools::displayError('This page is for guest accounts only. Since your guest account has already been transformed into a customer account, you can no longer view your order here. Please log in to your customer account to view this order'); $this->context->smarty->assign('show_login_link', true); } else if (!count($order_collection)) $this->errors[] = Tools::displayError('Invalid order reference'); else if (!$order_collection->getFirst()->isAssociatedAtGuest($email)) $this->errors[] = Tools::displayError('Invalid order reference'); else { $this->assignOrderTracking($order_collection); if (Tools::isSubmit('submitTransformGuestToCustomer')) { $customer = new Customer((int)$order->id_customer); if (!Validate::isLoadedObject($customer)) $this->errors[] = Tools::displayError('Invalid customer'); else if (!Tools::getValue('password')) $this->errors[] = Tools::displayError('Invalid password.'); else if (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) // @todo clarify error message $this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.'); else $this->context->smarty->assign('transformSuccess', true); } } } } /** * Assign template vars related to page content * @see FrontController::initContent() */ public function initContent() { parent::initContent(); /* Handle brute force attacks */ if (count($this->errors)) sleep(1); $this->context->smarty->assign(array( 'action' => $this->context->link->getPageLink('guest-tracking.php', true), 'errors' => $this->errors, )); $this->setTemplate(_PS_THEME_DIR_.'guest-tracking.tpl'); } /** * Assign template vars related to order tracking informations */ protected function assignOrderTracking($order_collection) { $customer = new Customer((int)$order_collection->getFirst()->id_customer); $order_collection = ($order_collection->getAll()); $order_list = array(); foreach ($order_collection as $order) $order_list[] = $order; foreach ($order_list as &$order) { $order->id_order_state = (int)$order->getCurrentState(); $order->invoice = (OrderState::invoiceAvailable((int)$order->id_order_state) && $order->invoice_number); $order->order_history = $order->getHistory((int)$this->context->language->id, false, true); $order->carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang); $order->address_invoice = new Address((int)$order->id_address_invoice); $order->address_delivery = new Address((int)$order->id_address_delivery); $order->inv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_invoice->id_country); $order->dlv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_delivery->id_country); $order->invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_invoice, $order->inv_adr_fields); $order->deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_delivery, $order->dlv_adr_fields); $order->currency = new Currency($order->id_currency); $order->discounts = $order->getCartRules(); $order->invoiceState = (Validate::isLoadedObject($order->address_invoice) && $order->address_invoice->id_state) ? new State((int)$order->address_invoice->id_state) : false; $order->deliveryState = (Validate::isLoadedObject($order->address_delivery) && $order->address_delivery->id_state) ? new State((int)$order->address_delivery->id_state) : false; $order->products = $order->getProducts(); $order->customizedDatas = Product::getAllCustomizedDatas((int)$order->id_cart); Product::addCustomizationPrice($order->products, $order->customizedDatas); $order->total_old = ($order->total_discounts > 0) ? (float)($order->total_paid - $order->total_discounts) : false; if ($order->carrier->url && $order->shipping_number) $order->followup = str_replace('@', $order->shipping_number, $order->carrier->url); $order->hook_orderdetaildisplayed = Hook::exec('displayOrderDetail', array('order' => $order)); Hook::exec('actionOrderDetail', array('carrier' => $order->carrier, 'order' => $order)); } $this->context->smarty->assign(array( 'shop_name' => Configuration::get('PS_SHOP_NAME'), 'order_collection' => $order_list, 'return_allowed' => false, 'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'), 'is_guest' => true, 'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC), 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, 'use_tax' => Configuration::get('PS_TAX'), )); } public function setMedia() { parent::setMedia(); $this->addCSS(_THEME_CSS_DIR_.'history.css'); $this->addCSS(_THEME_CSS_DIR_.'addresses.css'); } protected function processAddressFormat(Address $delivery, Address $invoice) { $inv_adr_fields = AddressFormat::getOrderedAddressFields($invoice->id_country, false, true); $dlv_adr_fields = AddressFormat::getOrderedAddressFields($delivery->id_country, false, true); $this->context->smarty->assign('inv_adr_fields', $inv_adr_fields); $this->context->smarty->assign('dlv_adr_fields', $dlv_adr_fields); } } Edited November 15, 2014 by Vanesax (see edit history) Link to comment Share on other sites More sharing options...
Vanesax Posted November 17, 2014 Author Share Posted November 17, 2014 ¿Nadie sabe nada? Venga esos expertosssssss!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now