frustrate Posted February 18, 2022 Share Posted February 18, 2022 (edited) I am running Prestashop 1.7.8.1 and have a problem when creating an order through the backoffice. The order is created, emails are sent however the link in the back_order is empty A new order has been generated on your behalf. Please go on {order_link} to complete the payment. I have checked to see if it was related to Paypal or Stripe but it occurs in both payment gateways. So when hovering over the link in the email no link is displayed except for {order_link} Edited February 18, 2022 by frustrate (see edit history) Link to comment Share on other sites More sharing options...
Ress Posted February 19, 2022 Share Posted February 19, 2022 Try to locate the code from which the email is sent, and check if the variable {order_link} is sent, because if it is not sent, it is considered normal text. Link to comment Share on other sites More sharing options...
frustrate Posted February 21, 2022 Author Share Posted February 21, 2022 Ress, that is the problem the text is sent and not the variable. I have tried to find where the particular variable is generated from but cannot find it. It is obviously quite a long variable with the key included for STripe or Paypal. Any other ideas? Link to comment Share on other sites More sharing options...
Ress Posted February 21, 2022 Share Posted February 21, 2022 You can find the variable in \src\Adapter\Order\CommandHandler\SendProcessOrderEmailHandler.php Link to comment Share on other sites More sharing options...
frustrate Posted February 24, 2022 Author Share Posted February 24, 2022 On 2/22/2022 at 2:35 AM, Ress said: You can find the variable in \src\Adapter\Order\CommandHandler\SendProcessOrderEmailHandler.php private function getEmailTemplateVars(int $cartId, Language $cartLanguage, Customer $customer): array { $orderLink = $this->contextLink->getPageLink( 'order', false, $cartLanguage->id, http_build_query([ 'step' => 3, 'recover_cart' => $cartId, 'token_cart' => md5(_COOKIE_KEY_ . 'recover_cart_' . $cartId), ]) ); return [ '{order_link}' => $orderLink, '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, ]; } } The {order_link} is present as you can see but I don't think it is sent in the email or $ordeLink is empty. The only other section is this below public function handle(SendProcessOrderEmailCommand $command): void { $cartId = $command->getCartId(); try { $cart = $this->getCart($cartId); $customer = $this->getCustomer(new CustomerId((int) $cart->id_customer)); $cartLanguage = $cart->getAssociatedLanguage(); $langId = (int) $cartLanguage->getId(); if (!Mail::send( $langId, 'backoffice_order', $this->getSubject($cartLanguage), $this->getEmailTemplateVars($cartId->getValue(), $cartLanguage, $customer), $customer->email, $customer->firstname . ' ' . $customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, $cart->id_shop )) { throw new OrderEmailSendException('Failed to send order process email to customer', OrderEmailSendException::FAILED_SEND_PROCESS_ORDER); } } catch (PrestaShopException $e) { throw new OrderException('An error occurred when trying to get info for order processing'); } } I can't see that $orderLink has a value Link to comment Share on other sites More sharing options...
frustrate Posted March 7, 2022 Author Share Posted March 7, 2022 On 2/24/2022 at 9:10 AM, frustrate said: private function getEmailTemplateVars(int $cartId, Language $cartLanguage, Customer $customer): array { $orderLink = $this->contextLink->getPageLink( 'order', false, $cartLanguage->id, http_build_query([ 'step' => 3, 'recover_cart' => $cartId, 'token_cart' => md5(_COOKIE_KEY_ . 'recover_cart_' . $cartId), ]) ); return [ '{order_link}' => $orderLink, '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, ]; } } The {order_link} is present as you can see but I don't think it is sent in the email or $ordeLink is empty. The only other section is this below public function handle(SendProcessOrderEmailCommand $command): void { $cartId = $command->getCartId(); try { $cart = $this->getCart($cartId); $customer = $this->getCustomer(new CustomerId((int) $cart->id_customer)); $cartLanguage = $cart->getAssociatedLanguage(); $langId = (int) $cartLanguage->getId(); if (!Mail::send( $langId, 'backoffice_order', $this->getSubject($cartLanguage), $this->getEmailTemplateVars($cartId->getValue(), $cartLanguage, $customer), $customer->email, $customer->firstname . ' ' . $customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, $cart->id_shop )) { throw new OrderEmailSendException('Failed to send order process email to customer', OrderEmailSendException::FAILED_SEND_PROCESS_ORDER); } } catch (PrestaShopException $e) { throw new OrderException('An error occurred when trying to get info for order processing'); } } I can't see that $orderLink has a value Anybody have a solution for this issue! Link to comment Share on other sites More sharing options...
frustrate Posted March 7, 2022 Author Share Posted March 7, 2022 On 2/18/2022 at 1:23 PM, frustrate said: I am running Prestashop 1.7.8.1 and have a problem when creating an order through the backoffice. The order is created, emails are sent however the link in the back_order is empty A new order has been generated on your behalf. Please go on {order_link} to complete the payment. I have checked to see if it was related to Paypal or Stripe but it occurs in both payment gateways. So when hovering over the link in the email no link is displayed except for {order_link} I am looking for a solution for this issue. Who else is experiencing this. The STRIPE payment token is not attached and normal text is sent instead Link to comment Share on other sites More sharing options...
frustrate Posted March 8, 2022 Author Share Posted March 8, 2022 On 3/7/2022 at 9:54 AM, frustrate said: I am looking for a solution for this issue. Who else is experiencing this. The STRIPE payment token is not attached and normal text is sent instead can anyone please help me this issue, there must be someone else with the same issue and how to solve it Link to comment Share on other sites More sharing options...
frustrate Posted March 8, 2022 Author Share Posted March 8, 2022 On 2/24/2022 at 9:10 AM, frustrate said: private function getEmailTemplateVars(int $cartId, Language $cartLanguage, Customer $customer): array { $orderLink = $this->contextLink->getPageLink( 'order', false, $cartLanguage->id, http_build_query([ 'step' => 3, 'recover_cart' => $cartId, 'token_cart' => md5(_COOKIE_KEY_ . 'recover_cart_' . $cartId), ]) ); return [ '{order_link}' => $orderLink, '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, ]; } } The {order_link} is present as you can see but I don't think it is sent in the email or $ordeLink is empty. The only other section is this below public function handle(SendProcessOrderEmailCommand $command): void { $cartId = $command->getCartId(); try { $cart = $this->getCart($cartId); $customer = $this->getCustomer(new CustomerId((int) $cart->id_customer)); $cartLanguage = $cart->getAssociatedLanguage(); $langId = (int) $cartLanguage->getId(); if (!Mail::send( $langId, 'backoffice_order', $this->getSubject($cartLanguage), $this->getEmailTemplateVars($cartId->getValue(), $cartLanguage, $customer), $customer->email, $customer->firstname . ' ' . $customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, $cart->id_shop )) { throw new OrderEmailSendException('Failed to send order process email to customer', OrderEmailSendException::FAILED_SEND_PROCESS_ORDER); } } catch (PrestaShopException $e) { throw new OrderException('An error occurred when trying to get info for order processing'); } } I can't see that $orderLink has a value Is anybody else experiencing this from the back office. None of the payment links or supposely variables in emails have an actual value in them. There are multiple bugs, almost to the point where it is an embarrassment to use the platform at all because people cannot pay you. Who can help and solve this issue. I have posted this weeks ago with no answer. Is there actually anybody on this forum that are interested or this just one of those forums where things get posted and absolutely no comment are given by members Link to comment Share on other sites More sharing options...
Ress Posted March 8, 2022 Share Posted March 8, 2022 Hi, Send me an PM, I can take a look to see what it's all about. Link to comment Share on other sites More sharing options...
frustrate Posted March 10, 2022 Author Share Posted March 10, 2022 On 2/24/2022 at 9:10 AM, frustrate said: private function getEmailTemplateVars(int $cartId, Language $cartLanguage, Customer $customer): array { $orderLink = $this->contextLink->getPageLink( 'order', false, $cartLanguage->id, http_build_query([ 'step' => 3, 'recover_cart' => $cartId, 'token_cart' => md5(_COOKIE_KEY_ . 'recover_cart_' . $cartId), ]) ); return [ '{order_link}' => $orderLink, '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, ]; } } The {order_link} is present as you can see but I don't think it is sent in the email or $ordeLink is empty. The only other section is this below public function handle(SendProcessOrderEmailCommand $command): void { $cartId = $command->getCartId(); try { $cart = $this->getCart($cartId); $customer = $this->getCustomer(new CustomerId((int) $cart->id_customer)); $cartLanguage = $cart->getAssociatedLanguage(); $langId = (int) $cartLanguage->getId(); if (!Mail::send( $langId, 'backoffice_order', $this->getSubject($cartLanguage), $this->getEmailTemplateVars($cartId->getValue(), $cartLanguage, $customer), $customer->email, $customer->firstname . ' ' . $customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, $cart->id_shop )) { throw new OrderEmailSendException('Failed to send order process email to customer', OrderEmailSendException::FAILED_SEND_PROCESS_ORDER); } } catch (PrestaShopException $e) { throw new OrderException('An error occurred when trying to get info for order processing'); } } I can't see that $orderLink has a value I can't believe that only one person on this whole forum posted any comments on this. Who are the moderators of this forum because it serves absolutely no purpose if people experience bugs in the code and there is nothing done about it. Pathetic! Link to comment Share on other sites More sharing options...
frustrate Posted June 8, 2022 Author Share Posted June 8, 2022 anybody have an idea how to fix this issue. Should be easy if one can find where the variable data is generated but it is like searching a needle in a haystack Link to comment Share on other sites More sharing options...
frustrate Posted August 28, 2022 Author Share Posted August 28, 2022 Anybody find a solution to this issue. I can't be the only one experiencing this issue Link to comment Share on other sites More sharing options...
boetje Posted September 13, 2022 Share Posted September 13, 2022 @frustrate have you found a solution to this issue? Experiencing the same problem Link to comment Share on other sites More sharing options...
frustrate Posted September 14, 2022 Author Share Posted September 14, 2022 16 hours ago, boetje said: @frustrate have you found a solution to this issue? Experiencing the same problem Not a single person that gave insight into this issue, it has been more than a year now, a known and reported issue along with a long list of bugs as I become more familiar with the framework. I have reported it and at first it was ignored as nonsense, then after multiple reporting that it is a bug, someone finally marked it as a bug. Now it just sits there as if everything is working fine and it is not! Extremely frustrating that there are so many people on this forum and nobody can give insight. Are we all clueless as to how this platform works? Or are there people just waiting to make a buck on somebody else's lack of knowledge and experience. Defeats the purpose of open source. I had one guy offering to charge me $30 to fix it and when I accepted the offer he just disappeared never to be heard from again. Unfortunately the documentation is not very clear on where to find files. All I know is that it is an embaressment working with something that continually causes issues for my customers when I use the platform in my business. Link to comment Share on other sites More sharing options...
ComGrafPL Posted September 14, 2022 Share Posted September 14, 2022 It is only when you're creating order from BO? Normal orders from clients working fine? Link to comment Share on other sites More sharing options...
boetje Posted September 14, 2022 Share Posted September 14, 2022 I noticed the issue when sending mail backoffice_order after creating an order from backoffice. variable {order_link} is not replaced in the mail with the link to the order When I send the same link for an order created in frontoffice I get the same issue. Link to comment Share on other sites More sharing options...
frustrate Posted September 15, 2022 Author Share Posted September 15, 2022 23 hours ago, ComGrafPL said: It is only when you're creating order from BO? Normal orders from clients working fine? As far as I know it is just the back office. I have had customers using the front end and payment through paypal with no issue Link to comment Share on other sites More sharing options...
frustrate Posted September 15, 2022 Author Share Posted September 15, 2022 22 hours ago, boetje said: I noticed the issue when sending mail backoffice_order after creating an order from backoffice. variable {order_link} is not replaced in the mail with the link to the order When I send the same link for an order created in frontoffice I get the same issue. Not sure what you mean. Are you saying that customers click items to be added to their cart and upon checkout there are issues as well with going through the payment gateways? I have not experienced that issue. Link to comment Share on other sites More sharing options...
boetje Posted September 15, 2022 Share Posted September 15, 2022 2 minutes ago, frustrate said: Not sure what you mean. Are you saying that customers click items to be added to their cart and upon checkout there are issues as well with going through the payment gateways? I have not experienced that issue. Creating order from BO based on previous order or cart from customer. Status of this order set to waiting for credit card payment This status sends mail "backoffice_order" to customer where he should be able to get step 3 of order process and choose payment method Link to comment Share on other sites More sharing options...
frustrate Posted September 16, 2022 Author Share Posted September 16, 2022 22 hours ago, boetje said: Creating order from BO based on previous order or cart from customer. Status of this order set to waiting for credit card payment This status sends mail "backoffice_order" to customer where he should be able to get step 3 of order process and choose payment method Yes that is the issue and known bug, maybe data required is in step 2nand not passed on in step 3 when it is done this way Link to comment Share on other sites More sharing options...
frustrate Posted October 28, 2022 Author Share Posted October 28, 2022 On 2/19/2022 at 6:18 PM, Ress said: Try to locate the code from which the email is sent, and check if the variable {order_link} is sent, because if it is not sent, it is considered normal text. Have you been able to solve this, I am getting no response form PRESTASHOP Link to comment Share on other sites More sharing options...
frustrate Posted October 28, 2022 Author Share Posted October 28, 2022 On 9/15/2022 at 4:17 PM, boetje said: Creating order from BO based on previous order or cart from customer. Status of this order set to waiting for credit card payment This status sends mail "backoffice_order" to customer where he should be able to get step 3 of order process and choose payment method Have you got any solution to the BO issue of empty order_link variable, I am not getting any response from PRESTASHOP Link to comment Share on other sites More sharing options...
frustrate Posted October 28, 2022 Author Share Posted October 28, 2022 On 9/14/2022 at 5:02 PM, ComGrafPL said: It is only when you're creating order from BO? Normal orders from clients working fine? Have you worked out any solution to this issue, I am getting no response from PRESTASHOP and nobody of the thousands of members here are contributing Link to comment Share on other sites More sharing options...
ComGrafPL Posted October 28, 2022 Share Posted October 28, 2022 Have you checked backoffice_order template? Link to comment Share on other sites More sharing options...
frustrate Posted October 28, 2022 Author Share Posted October 28, 2022 12 minutes ago, ComGrafPL said: Have you checked backoffice_order template? yes the template is correct Link to comment Share on other sites More sharing options...
boetje Posted October 28, 2022 Share Posted October 28, 2022 4 hours ago, frustrate said: Have you got any solution to the BO issue of empty order_link variable, I am not getting any response from PRESTASHOP After some testing I noticed the following: When you start creating order from BO a cart is created. choose customer, choose cart or previous order from customer, select address If you do not click to create order but send email to customer then I get email with link to cart When you click make order you receive mail with faulty link {order_link} I assume as soon as the order is created it is no longer possible to send mail with cart link. 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