Jump to content

Выгрузка фида currency id - OpenCart3x


chixx
 Share

Go to solution Solved by chixx,

Recommended Posts

У меня такая проблема.

Выгружается вместо 

<currency id="RUB" rate="1"/>

 

Вот так

<currency id="1.00000000" rate="1"/>

 

Подскажите, куда смотреть? Если знает кто.

 

В startup.php все есть

// Currency
        $code = '';
        
        $this->load->model('localisation/currency');
        
        $currencies = $this->model_localisation_currency->getCurrencies();
        
        if (isset($this->session->data['currency'])) {
            $code = $this->session->data['currency'];
        }
        
        if (isset($this->request->cookie['currency']) && !array_key_exists($code, $currencies)) {
            $code = $this->request->cookie['currency'];
        }
        
        if (!array_key_exists($code, $currencies)) {
            $code = $this->config->get('config_currency');
        }
        
        if (!isset($this->session->data['currency']) || $this->session->data['currency'] != $code) {
            $this->session->data['currency'] = $code;
        }
        
        if (!isset($this->request->cookie['currency']) || $this->request->cookie['currency'] != $code) {
            setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
        }        
        
        $this->registry->set('currency', new Cart\Currency($this->registry));
        $this->session->data['currency'] = 'RUB';

 

 

Модуль берет видимо этой строкой 

$xml .= '<currency id="' . $startup['currency'] . '" rate="1"/>';

 

Не пойму, что не так

Link to comment
Share on other sites

  • Solution
В 09.04.2023 в 23:59, chixx сказал:

У меня такая проблема.

Выгружается вместо 

<currency id="RUB" rate="1"/>

 

Вот так

<currency id="1.00000000" rate="1"/>

 

Подскажите, куда смотреть? Если знает кто.

 

В startup.php все есть

// Currency
        $code = '';
        
        $this->load->model('localisation/currency');
        
        $currencies = $this->model_localisation_currency->getCurrencies();
        
        if (isset($this->session->data['currency'])) {
            $code = $this->session->data['currency'];
        }
        
        if (isset($this->request->cookie['currency']) && !array_key_exists($code, $currencies)) {
            $code = $this->request->cookie['currency'];
        }
        
        if (!array_key_exists($code, $currencies)) {
            $code = $this->config->get('config_currency');
        }
        
        if (!isset($this->session->data['currency']) || $this->session->data['currency'] != $code) {
            $this->session->data['currency'] = $code;
        }
        
        if (!isset($this->request->cookie['currency']) || $this->request->cookie['currency'] != $code) {
            setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
        }        
        
        $this->registry->set('currency', new Cart\Currency($this->registry));
        $this->session->data['currency'] = 'RUB';

 

 

Модуль берет видимо этой строкой 

$xml .= '<currency id="' . $startup['currency'] . '" rate="1"/>';

 

Не пойму, что не так

 

Спасибо, сам догадался.

Надо вот так

Цитата

$xml .= '<currency id="' . $startup['currency_xml'] . '" rate="1"/>';

и все ок

Edited by chixx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...