Jump to content

Edit History

Ali Samie

Ali Samie

Still no clear way...

 

I used this

 

$rawData = Db::getInstance()
            ->getValue('
                SELECT
                    checkout_session_data
                FROM
                    ' . _DB_PREFIX_ . 'cart
                WHERE
                    id_cart = ' . (int) $params['cart']->id
        );
        $data = json_decode($rawData ?? '', true);
        if (!is_array($data)) {
            $data = [];
        }
        
        $steps = $params['checkoutProcess']
            ->restorePersistedData($data)
            ->markCurrentStep()
            ->getSteps();

 

Ali Samie

Ali Samie

Tada!
 

$rawData = Db::getInstance()
            ->getValue('
                SELECT
                    checkout_session_data
                FROM
                    ' . _DB_PREFIX_ . 'cart
                WHERE
                    id_cart = ' . (int) Context::getContext()->cart->id
        );
        $data = json_decode($rawData ?? '', true);
        if (!is_array($data)) {
            $data = [];
        }

        $currentStep = Context::getContext()
            ->controller
            ->getCheckoutProcess()
            ->restorePersistedData($data)
            ->markCurrentStep()
            ->getCurrentStep();

 

Ali Samie

Ali Samie

Tada!
 

Context::getContext()
  ->controller
  ->getCheckoutProcess()
  ->restorePersistedData($data)
  ->markCurrentStep()
  ->getCurrentStep();

 

×
×
  • Create New...