Fórum OpenCart Brasil

Por um e-commerce livre, confiável e profissional

Suporte geral sobre problemas técnicos para OpenCart v1.x.
#29589
Possuo o OpenCart 1.5.1.3 e constatei na opção "Comprar Vale Presente", que no Campo "Valor" (apesar de constar que "O valor deve ficar entre R$1,00 e R$1.000,00" e a loja estar configurada para separar o decimais com ,) se o cliente colocar 1,99, os 99 centavos são ignorados pelo sistema (é necessário colocar 1.99, com ponto para separar).

Qual a melhor maneira para arrumar isto?

Altero o campo $_['entry_amount'] em catalog/language/portuguese-br/checkout/voucher.php ?

Alguma outra maneira recomendada para contornar esse problema?

E se eu quiser alterar o valor mínimo ou máximo do vale presente, em catalog/controller/checkout/voucher.php, tenho que alterar o trecho em negrito abaixo:

currency->convert($this->request->post['amount'], $this->currency->getCode(), $this->config->get('config_currency')),

$this->data['entry_amount'] = sprintf($this->language->get('entry_amount'), $this->currency->format(1, false, 1), $this->currency->format(1000, false, 1));

if (($this->request->post['amount'] < 1) || ($this->request->post['amount'] > 1000)) {
$this->error['amount'] = sprintf($this->language->get('error_amount'), $this->currency->format(1, false, 1), $this->currency->format(1000, false, 1) . ' ' . $this->currency->getCode());
}

É isto?

Fiz as mudanças mencionadas (alterando o valor mínimo do vale presente de 1 para 10 e alterando o arquivo de linguagem), através de um arquivo xml (vqmod) e irei testar. Mas agradeço sugestões ou recomendações.
#29731
Como não obtive resposta, fiz as mudanças mencionadas (alterando o valor mínimo do vale presente de 1 para 10 e alterando o arquivo de linguagem), através de um arquivo xml (vqmod). Testei-o e está funcionando. Para quem se interessar/precisar, aqui vai o código do meu arquivo xml:


<modification>

<id>Modifica Meus Downloads</id>
<version>1.0.0</version>
<vqmver>2.1.7</vqmver>
<author>Luciano Mairesse Mandler - email: luciano . poa @gmail.com</author>

<file name="catalog/language/portuguese-br/checkout/voucher.php">
<operation error="skip">
<search position="replace"><![CDATA[
$_['entry_amount'] = 'Valor:<br /><span class="help">(O valor deve ficar entre %s e %s)</span>';
]]></search>
<add><![CDATA[
$_['entry_amount'] = 'Valor:<br /><span class="help">(O valor deve ficar entre 10.00 e 1000.00)</span>';
]]></add>
</operation>

</file>

<file name="catalog/controller/checkout/voucher.php">
<operation error="skip">
<search position="replace"><![CDATA[
$this->data['entry_amount'] = sprintf($this->language->get('entry_amount'), $this->currency->format(1, false, 1), $this->currency->format(1000, false, 1));
]]></search>
<add><![CDATA[
$this->data['entry_amount'] = sprintf($this->language->get('entry_amount'), $this->currency->format(10, false, 1), $this->currency->format(1000, false, 1));
]]></add>
</operation>

<operation error="skip">
<search position="replace"><![CDATA[
if (($this->request->post['amount'] < 1) || ($this->request->post['amount'] > 1000))
]]></search>
<add><![CDATA[
if (($this->request->post['amount'] < 10) || ($this->request->post['amount'] > 1000))
]]></add>
</operation>

<operation error="skip">
<search position="replace"><![CDATA[
$this->error['amount'] = sprintf($this->language->get('error_amount'), $this->currency->format(1, false, 1), $this->currency->format(1000, false, 1) . ' ' . $this->currency->getCode());
]]></search>
<add><![CDATA[
$this->error['amount'] = sprintf($this->language->get('error_amount'), $this->currency->format(10, false, 1), $this->currency->format(1000, false, 1));
]]></add>
</operation>

</file>

</modification>