Skip to content

[Connect to customer account] Button in Orders > #837

@andilog-pat

Description

@andilog-pat

Hi thank you for the hard work and an excellent module !

In the last few versions i'm encountering errors on the
Orders > Orders > View (+) Page

It seems the cuplrit is the
[Connect to customer account] Button

I needed to make changes to the files :

everblock.php
Line 4599=> function hookActionGetAdminOrderButtons

/**
     * Add buttons to main buttons bar
     */
    public function hookActionGetAdminOrderButtons(array $params)
    {
        $order = new Order(
            (int) $params['id_order']
        );
        if (Validate::isLoadedObject($order)) {
            $everToken = $this->encrypt($this->name . '/everlogin');
            $link = new Link();
            $connectLink = $link->getModuleLink(
                $this->name,
                'everlogin',
                [
                    'id_ever_customer' => $order->id_customer,
                    'evertoken' => $everToken,
                    'ever_id_cart' => Cart::lastNoneOrderedCart($order->id_customer),
                ]
            );

            /** @var \PrestaShop\PrestaShop\Core\Action\ActionsBarButtonsCollection $bar */
            $bar = $params['actions_bar_buttons_collection'];
            $bar->add(
                new \PrestaShop\PrestaShop\Core\Action\ActionsBarButton(
                    'btn-info', 
                    ['href' => $connectLink, 'target' => '_blank'], 
                    $this->l('Connect to customer account')
                )
            );
        }
    }

and
controller/front/everlogin.php
=> line 31

        // 🔐 Sécurité du token
        if (
            !Tools::getIsset('evertoken')
            || $this->module->encrypt($this->module->name . '/everlogin') !== Tools::getValue('evertoken')
            || !Module::isInstalled($this->module->name)
        ) {
            Tools::redirect('index.php');
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions