Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Загрузить контроллер с новыми данными


Recommended Posts

Доброго времени суток. стоит задача: имеется некторый контроллер в нем есть переменная 

$data['payment'] = $this->load->controller('payment/moneta);	

в нее подгружается контроллер менета.php

Сам контроллер вот такой


    class ControllerPaymentPayanywayMoneta extends Controller
        public function index()
            $data['button_confirm'] = $this->language->get('button_confirm');

            $data['continue'] = $this->url->link('checkout/success');
            $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
            $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('config_order_status_id'));
            $mnt_id = $this->config->get('payanyway_mnt_id');
            $order_id = $this->session->data['order_id'];
            $currency = $this->config->get('payanyway_mnt_currency_code');
            $mnt_test_mode = $this->config->get('payanyway_mnt_test_mode');
            $mnt_dataintegrity_code = $this->config->get('payanyway_mnt_dataintegrity_code');
            $amount = $this->currency->format($order_info['total_with_koef'], $currency, '', false);
            $amount = number_format($amount, 2, '.', '');
            $signature = md5("{$mnt_id}{$order_id}{$amount}{$currency}{$mnt_test_mode}{$mnt_dataintegrity_code}");
            $data['action'] = "https://{$this->config->get('payanyway_mnt_server')}/assistant.htm";
            $data['mnt_id'] = $mnt_id;
            $data['order_id'] = $order_id;
            $data['currency'] = $currency;
            $data['amount'] = $amount;
            $data['mnt_signature'] = $signature;
            $data['mnt_test_mode'] = $mnt_test_mode;
            $data['paymentSystemUnitId'] = 1015;
            $data['mnt_success_url'] = $this->url->link('payment/payanyway/success');
            $data['mnt_fail_url'] = $this->url->link('checkout/checkout', '', 'SSL');

            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/payanyway_moneta.tpl')) {
                return $this->load->view($this->config->get('config_template') . '/template/payment/payanyway_moneta.tpl', $data);
            } else {
                return $this->load->view('payment/payanyway_moneta.tpl', $data);



Хочу обратить внимание на строку

  $amount = $this->currency->format($order_info['total_with_koef'], $currency, '', false);

Здесь берутся данные из бд.(это код оплаты заказа). во время заказа "динамически" в бд меняется Цифра ['total_with_koef'] но при вновь выполнении  $data['payment'] = $this->load->controller('payment/moneta);     берутся не обновленные данные а загруженные впервый раз. Как мне получчить обновленные данные?

Link to comment
Share on other sites

Не знаю как это сделать. кстати в  $data['payment'] = я получаю шаблон этой оплаты. когда я выполняю $this->load->controller('payment/moneta); Разве,контроллер не "выполняется?" 

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

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.