[-] BO: Fix PSFV-177 backoffice order message
This commit is contained in:
@@ -201,6 +201,28 @@
|
|||||||
var product = $(this).attr('rel').split('_');
|
var product = $(this).attr('rel').split('_');
|
||||||
updateProductPrice(product[0], product[1], $(this).val());
|
updateProductPrice(product[0], product[1], $(this).val());
|
||||||
});
|
});
|
||||||
|
$('#order_message').live('change', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
url: "{$link->getAdminLink('AdminCarts')}",
|
||||||
|
async: true,
|
||||||
|
dataType: "json",
|
||||||
|
data : {
|
||||||
|
ajax: "1",
|
||||||
|
token: "{getAdminToken tab='AdminCarts'}",
|
||||||
|
tab: "AdminCarts",
|
||||||
|
action: "updateOrderMessage",
|
||||||
|
id_cart: id_cart,
|
||||||
|
id_customer: id_customer,
|
||||||
|
message: $(this).val()
|
||||||
|
},
|
||||||
|
success : function(res)
|
||||||
|
{
|
||||||
|
displaySummary(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
/*$('.fancybox').live('click', function(e) {
|
/*$('.fancybox').live('click', function(e) {
|
||||||
$(this).fancybox().trigger('click');
|
$(this).fancybox().trigger('click');
|
||||||
return false;
|
return false;
|
||||||
@@ -611,6 +633,7 @@
|
|||||||
$('#id_lang option[value="'+id_lang+'"]').attr('selected', 'selected');
|
$('#id_lang option[value="'+id_lang+'"]').attr('selected', 'selected');
|
||||||
$('#send_email_to_customer').attr('rel', jsonSummary.link_order);
|
$('#send_email_to_customer').attr('rel', jsonSummary.link_order);
|
||||||
$('#go_order_process').attr('href', jsonSummary.link_order);
|
$('#go_order_process').attr('href', jsonSummary.link_order);
|
||||||
|
$('#order_message').val(jsonSummary.order_message);
|
||||||
resetBind();
|
resetBind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ jQuery(document).ready(Customer.init);
|
|||||||
</span>
|
</span>
|
||||||
{if $tax_exclude_taxe_option}
|
{if $tax_exclude_taxe_option}
|
||||||
<span style="margin-left:10px; color:red;">{l s='Taxes are currently disabled'}</span> (<b><a href="{$link->getAdminLink('AdminTaxes')}">{l s='Tax options'}</a></b>)
|
<span style="margin-left:10px; color:red;">{l s='Taxes are currently disabled'}</span> (<b><a href="{$link->getAdminLink('AdminTaxes')}">{l s='Tax options'}</a></b>)
|
||||||
<input type="hidden" value="{$product->id_tax_rules_group}" name="id_tax_rules_group" />
|
<input type="hidden" value="{$product->getIdTaxRulesGroup()}" name="id_tax_rules_group" />
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -302,6 +302,31 @@ class AdminCartsControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function ajaxProcessUpdateOrderMessage()
|
||||||
|
{
|
||||||
|
if ($this->tabAccess['edit'] === '1')
|
||||||
|
{
|
||||||
|
$id_message = false;
|
||||||
|
if ($old_message = Message::getMessageByCartId((int)$this->context->cart->id))
|
||||||
|
$id_message = $old_message['id_message'];
|
||||||
|
$message = new Message((int)$id_message);
|
||||||
|
if ($message_content = Tools::getValue('message'))
|
||||||
|
{
|
||||||
|
if (Validate::isMessage($message_content))
|
||||||
|
{
|
||||||
|
$message->message = htmlentities($message_content, ENT_COMPAT, 'UTF-8');
|
||||||
|
$message->id_cart = (int)$this->context->cart->id;
|
||||||
|
$message->id_customer = (int)$this->context->cart->id_customer;
|
||||||
|
$message->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (Validate::isLoadedObject($message))
|
||||||
|
$message->delete();
|
||||||
|
echo Tools::jsonEncode($this->ajaxReturnVars());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function ajaxProcessUpdateCurrency()
|
public function ajaxProcessUpdateCurrency()
|
||||||
{
|
{
|
||||||
if ($this->tabAccess['edit'] === '1')
|
if ($this->tabAccess['edit'] === '1')
|
||||||
@@ -505,11 +530,17 @@ class AdminCartsControllerCore extends AdminController
|
|||||||
public function ajaxReturnVars()
|
public function ajaxReturnVars()
|
||||||
{
|
{
|
||||||
$id_cart = (int)$this->context->cart->id;
|
$id_cart = (int)$this->context->cart->id;
|
||||||
|
|
||||||
|
$message_content = '';
|
||||||
|
if ($message = Message::getMessageByCartId((int)$this->context->cart->id))
|
||||||
|
$message_content = $message['message'];
|
||||||
|
|
||||||
return array('summary' => $this->getCartSummary(),
|
return array('summary' => $this->getCartSummary(),
|
||||||
'delivery_option_list' => $this->getDeliveryOptionList(),
|
'delivery_option_list' => $this->getDeliveryOptionList(),
|
||||||
'cart' => $this->context->cart,
|
'cart' => $this->context->cart,
|
||||||
'addresses' => $this->context->customer->getAddresses((int)$this->context->cart->id_lang),
|
'addresses' => $this->context->customer->getAddresses((int)$this->context->cart->id_lang),
|
||||||
'id_cart' => $id_cart,
|
'id_cart' => $id_cart,
|
||||||
|
'order_message' => $message_content,
|
||||||
'link_order' => $this->context->link->getPageLink(
|
'link_order' => $this->context->link->getPageLink(
|
||||||
'order', false,
|
'order', false,
|
||||||
(int)$this->context->cart->id_lang,
|
(int)$this->context->cart->id_lang,
|
||||||
|
|||||||
Reference in New Issue
Block a user