修复模板加价购和赠品模板请求接口返回的bug,需要返回模板的html代码,不能渲染
Code Review By Rock Zhang
Showing
2 changed files
with
4 additions
and
4 deletions
1 | -{{> cart/chose-panel}} |
@@ -193,11 +193,12 @@ class IndexController extends AbstractAction | @@ -193,11 +193,12 @@ class IndexController extends AbstractAction | ||
193 | 193 | ||
194 | /* | 194 | /* |
195 | * 获取购物车加价购商品数据模板 | 195 | * 获取购物车加价购商品数据模板 |
196 | + * 需要返回模板的html代码,不能渲染 | ||
196 | */ | 197 | */ |
197 | public function giftinfoTplAction() | 198 | public function giftinfoTplAction() |
198 | { | 199 | { |
199 | if ($this->isAjax()) { | 200 | if ($this->isAjax()) { |
200 | - $this->_view->display('gift-tpl'); | 201 | + echo file_get_contents($this->_view->getScriptPath() . '/../partials/cart/chose-panel.phtml'); |
201 | } | 202 | } |
202 | } | 203 | } |
203 | 204 | ||
@@ -208,11 +209,11 @@ class IndexController extends AbstractAction | @@ -208,11 +209,11 @@ class IndexController extends AbstractAction | ||
208 | { | 209 | { |
209 | $result = array(); | 210 | $result = array(); |
210 | 211 | ||
211 | -// if ($this->isAjax()) { | 212 | + if ($this->isAjax()) { |
212 | $skn = $this->get('skn', null); | 213 | $skn = $this->get('skn', null); |
213 | $promotionId = $this->get('promotionId', null); | 214 | $promotionId = $this->get('promotionId', null); |
214 | $result = CartModel::giftProductData($skn, $promotionId); | 215 | $result = CartModel::giftProductData($skn, $promotionId); |
215 | -// } | 216 | + } |
216 | 217 | ||
217 | if (empty($result)) { | 218 | if (empty($result)) { |
218 | echo ' '; | 219 | echo ' '; |
-
Please register or login to post a comment