Jump to content

{back_order} link empty


frustrate

Recommended Posts

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 by frustrate (see edit history)
Link to comment
Share on other sites

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

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

  • 2 weeks later...
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

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

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

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

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

  • 2 months later...
  • 2 months later...
  • 3 weeks later...
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

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

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

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

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

  • 1 month later...
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

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

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

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.

mail order created.png

BO making order.png

mail no order created yet.png

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...