I have a custom contact form, I send all the fields I need, but I can not translate a field.
Realizou compra: Sim
Pedido: Pedido #100000001 - Total: R$105.00 - Data: 31-07-2017 - Status: pending
Status:
Telefone: 14654165
Assunto: Assunto
Motivo: Reclamação
Comentario: Comentario
I would like to change the status "pending" to Pending and all others, but the table(sales_flat_order) on which I get this data is not translated. I checked and another table (sales_order_status) is translated, but would I have to create another command just to get this table? Would I translate from the table I'm picking up?
controller
public function getOrderByEmail() {
$customer_email = $this->getRequest()->getPost();
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_email', $customer_email) ;
foreach($orders as $order) { $date = $order->getCreatedAt(); $date = date("d-m-Y", strtotime($date));
$neworderjson = array('orderid'=>$order->getIncrementId(), 'status'=>$order->getStatus(), 'total'=>number_format((float)$order->getBaseGrandTotal(), 2, '.', ''), 'created'=>$date);
$orderjson[] = $neworderjson;
}
return $orderjson;
}
Template
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
<div class="page-title">
<h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
</div>
<form enctype="multipart/form-data" action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post" class="scaffold-form">
<div class="fieldset">
<h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
<p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
<ul class="form-list">
<li class="fields">
<div class="field">
<label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
<div class="input-box">
<input style="height:24px;" name="name" id="name" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Name')) ?>" class="input-text required-entry" type="text" />
</div>
</div>
<div class="field">
<label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
<div class="input-box">
<input style="height:24px;" name="email" id="email" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Email')) ?>" class="input-text required-entry validate-email" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" />
</div>
</div>
</li>
<li>
<label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
<div class="input-box">
<input style="height:24px;" name="telephone" id="telephone" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Telephone')) ?>" value="" class="input-text" type="tel" />
</div>
</li>
<div class="select">
<li>
<label for="f_f_assunto_ticket" class="required"><em>*</em>Motivo do contato</label>
<div class="input-box">
<select style="height:25px; padding:3px;" id="f_f_assunto_ticket" name="f_f_assunto_ticket" class="required-entry required-entry">
<option value="" selected="selected">-- Selecione --</option>
<option value="Dúvidas Sobre Entrega">Dúvidas Sobre Entrega</option>
<option value="Dúvidas Sobre Pagamento">Dúvidas Sobre Pagamento</option>
<option value="Dicas de Presente">Dicas de Presente</option>
<option value="Reclamação">Reclamação</option>
<option value="Elogio">Elogio</option>
<option value="Confirmação de Dados">Confirmação de Dados</option>
</select>
</div>
</li>
</div>
<div class="wide" id="pedido_option" style="display: none;">
<li>
<label for="f_compra" class="required"><em>*</em>Já realizou sua compra?</label>
<div class="input-box">
<select style="height:25px; padding:3px;" id="f_compra" name="f_compra" class="required-entry required-entry">
<option value="" selected="selected">-- Selecione --</option>
<option value='Sim'>Sim</option>
<option value='Não'>Não</option>
</select>
</div>
</li>
</div>
<div class="wide" id="pedido_txt" style="display: none;">
<li>
<label for="f_f_compra" class="required"><em>*</em>Já realizou sua compra?</label>
<div class="input-box">
<select style="height:25px; padding:3px;" id="f_f_compra" name="f_f_compra" class="required-entry required-entry select">
<option value="" selected="selected">-- Selecione --</option>
<option value="Sim">Sim</option>
<option value="Não">Não</option>
</select>
</div>
</li>
</div>
<div id="pedido" style="display:none;">
<li>
<label for="pedido" class="required"><em>*</em>Pedido</label>
<div class="input-box">
<select style="height:25px; padding:3px;" name="orders" id="orders"></select>
</div>
</li>
</div>
<div id="pedidon" class="wide" style="display:none;">
<li>
<label for="pedidon" class="required"><em>*</em>Pedido</label>
<div class="input-box">
<input style="width:262px;" name="pedidon" id="pedidon" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('pedidon')) ?>" value="" class="input-box required-entry" type="text" />
</div>
</li>
</div>
<li class="fields">
<div class="field">
<label for="assunto" class="required"><em>*</em>Assunto</label>
<div class="input-box">
<input style="width:262px;" name="assunto" id="assunto" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('assunto')) ?>" value="" class="input-box required-entry" type="text" />
</div>
</div>
<li class="wide">
<label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>
<div class="input-box">
<textarea name="comment" id="comment" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Comment')) ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
</div>
</li>
</ul>
</div>
<li>
<label for="anexos">Anexar Arquivos</label>
<div class="input-box">
<div class="MultiFile-wrap" id="attachment_wrap">
<input name="MAX_FILE_SIZE" type="hidden" value="2000000" />
<input type="file" class="multi MultiFile-applied" name="anexos" id="anexos" value="">
<div class="MultiFile-list" id="attachment_wrap_list"></div>
</div>
</div>
</li>
<div class="buttons-set">
<input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
<button type="submit" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Submit')) ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
<script type="text/javascript">
//Verifica o EMAIL para checar se tem algum PEDIDO cadastrado
$j("#email").focus(function() {}).blur(function() {
email = $j("#email").val();
$j.ajax({url: "http://fol.projeto-gf.com.br/index.php/contato",
type: "post",
data: { type: "json", email: email },
dataType: "json",
success: function(result){
$j("#orders" ).empty();
if (result == null) {
} else {
$j.each(result, function (index, data) {
orderstring = "Pedido #" + result[index]["orderid"] + " - Total: R$" + result[index]["total"] + " - Data: " + result[index]["created"] + " - Status: " + result[index]["status"];
$j('#orders').append($j("<option></option>").attr("value",orderstring).text(orderstring));
})
}
}});
});