Jump to content

Order history confirmation


Recommended Posts

I am on the latest version of Prestashop with payment modules of First Data and Paypal. I am not getting the order confirmation.tpl firing and order history comes up


My order when completed via First Data or when there is no payment(using discount voucher to make it zero), it goes directly to Order history bypassing order confirmation page. I have 3 scripts there- Google Analytics, FB Pixel and BizInsights survey and none of them are firing. I see some code changes to the 1.5 version in order confirmation controller, not sure this bugs follows?


Thanks in advance


www.bedandwood.com


Link to comment
Share on other sites

FirstData has a few bugs, at least in the version I tried. You have to check the validation.php file and see where it dies when coming back from the remote page. See where it's supposed to redirect to, and under what conditions

Link to comment
Share on other sites

FirstData has a few bugs, at least in the version I tried. You have to check the validation.php file and see where it dies when coming back from the remote page. See where it's supposed to redirect to, and under what conditions

Thanks much Nemo!  Here is the relevant code I think, can you kindly do a quick scan

 

/* Redirect the user to the order confirmation page / history */

                if (_PS_VERSION_ < 1.5)

                    $redirect = __PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->id.'&id_order='.(int)$this->currentOrder.'&key='.$this->context->customer->secure_key;

                else

                    $redirect = __PS_BASE_URI__.'index.php?controller=order-confirmation&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->id.'&id_order='.(int)$this->currentOrder.'&key='.$this->context->customer->secure_key;

 

                header('Location: '.$redirect);

                exit;

            }

            else

            {

                if (isset($json_result->transaction_approved) && !$json_result->transaction_approved && isset($json_result->bank_message) && $json_result->bank_message != '')

                    $error_msg = Tools::safeOutput($json_result->bank_message);

 

Link to comment
Share on other sites

Hi Nemo- any response. I found this in the order controller confirmation which seems to redirect to history

 

   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);
        }

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...