Jump to content

Presta Web Developer

New Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

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

Presta Web Developer's Achievements

Newbie

Newbie (1/14)

  • One Month Later Rare
  • First Post Rare
  • Week One Done Rare
  • Dedicated Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Thanks for the reply. I have just checked the id_customer field in the ps_orders table and all off them are fullfilled. so I don't think thats the reason.
  2. I can remove the code above, to skip the check. What purpose does it have??
  3. Hi, I have a problem for some customers. When someone buy a product, they should go to the order confirmation site. The correct flow: 1. 4 step ptestashop checkout 2. Redirected to external payment gateway (in this step the customer leaves my site, to make payment) 3. Order confirmation page In step 3, some customers, get an 302 on the Order confirmation site, and is redirected to history. I have debug the code and can see the redirct happening in /PRESTASHOPPATH/controller/front/OrderConfirmationController.php, init function: public function init() { parent::init(); if (true === (bool) Tools::getValue('free_order')) { $this->checkFreeOrder(); } $this->id_cart = (int) (Tools::getValue('id_cart', 0)); $redirectLink = 'index.php?controller=history'; $this->id_module = (int) (Tools::getValue('id_module', 0)); $this->id_order = Order::getIdByCartId((int) ($this->id_cart)); $this->secure_key = Tools::getValue('key', false); $order = new Order((int) ($this->id_order)); 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); } $this->order_presenter = new OrderPresenter(); } I have found out the problem is in the variable: $this->context->customer->id, which is null on the customers who is redirected I can't replicate the error myself. I'm running Prestashop 1.7.7.5. Does someone have an idea why? how is the context->customer object initialized, and why should it be deleted on some customers?
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More