Magento 1.9订单注释添加做后端信息



我正在尝试添加一个框,供客户对他们的订单发表评论。 我已将其添加到我的

/

checkout/cart/cart.phtml

你可以看到我在这里添加了它

<div class="cart-collaterals">
<div class="row">
<th><?php echo $this->__('Comments') ?></th>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6">
<?php echo "Any special requirements regarding this order?"; ?>
<!-- COmments box -->
<td class="a-center">
<textarea name="cart[<?php echo $_item->getId() ?>][comments]" rows="3" cols="20"><?php echo $_item->getItemcomment() ?></textarea>
</td>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4">
<?php echo $this->getChildHtml('coupon') ?>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<?php echo $this->getChildHtml('checkout.cart.extra') ?>
<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="cart-totals">
<span id='ajax_loadertotals' style='display:none'><!--<img src='<?php //echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/>--><div class="loaderTotals">Loading...</div></span>
<div class="totals">
<?php echo $this->getChildHtml('totals'); ?>
<?php if(!$this->hasError()): ?>
<ul class="checkout-types">
<?php foreach ($this->getMethods('methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
<div id="shipping-info-link">
<a href="/checkout-shipping-details/" class="link-quickview" id="delivery-shipping-info">Delivery & Shipping Information</a>
</div>
</div>
</div>
<?php
echo $this->getLayout()->createBlock('giftcard/checkout_cart_giftcard')->setTemplate('mt/giftcard/checkout/cart/giftcard.phtml')->toHtml();
?>
<?php echo $this->getChildHtml('crosssell') ?>

</div>

现在我的问题包括在这里: 我怎样才能做到,以便我(销售人员(可以在订单通过时在后端看到它?

我不介意将其更改为结帐页面,如果它更容易。如果你能给我一些帮助,我将不胜感激。我环顾四周,但没有找到任何有用的东西

谢谢

1(使用安装脚本在表中sales_flat_order添加自定义字段/属性,示例如下

$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn(
$installer->getTable('sales/order'), 'cutom_comment', 'VARCHAR(150) NOT NULL'
);
$installer->endSetup();

2( 将字段添加到结帐页面

3(您可以使用事件">checkout_type_onepage_save_order">

4(您可以使用Mage::app()->getRequest()->getPost('custom_comment')获取值

5( 使用$order = $observer->getEvent()->getOrder();获取订单详细信息

6( 保存订单

$order->setCustomComment($comment);

7( 为管理员添加自定义布局 对于那个参考

8 ( 通过$order = $this->getOrder()获取订单详细信息

9(通过$customComment = "$order->getCustomComment();"获取价值

最新更新