Post by openshop » Tue Jun 16, 2015 4:01 pm

我在product.php加入了
$this->data['date_added'] = $product_info['date_added'];
$this->data['viewed'] = $product_info['viewed'];

product.tpl加入了
<?php echo $date_added; ?>
<?php echo $viewed; ?>

可是都無法顯示,請問這是什麼原因?
Last edited by openshop on Thu Jun 18, 2015 10:00 am, edited 1 time in total.

New member

Posts

Joined
Sat Dec 14, 2013 4:16 pm

Post by raymondization » Thu Jun 18, 2015 9:48 am

我在opencart的file 中找不到date_added.php

這是你自定義的file嗎??

OpenCart®
PHP Developer.
更多中文教學在 OpenCart香港官方網站 !
QQ: 2039574815


New member

Posts

Joined
Wed Sep 26, 2012 11:19 am

Post by openshop » Thu Jun 18, 2015 10:00 am

抱歉!打錯了
應該是product.php

New member

Posts

Joined
Sat Dec 14, 2013 4:16 pm

Post by rocku » Fri Jun 19, 2015 7:39 am

openshop wrote:我在product.php加入了
$this->data['date_added'] = $product_info['date_added'];
$this->data['viewed'] = $product_info['viewed'];

product.tpl加入了
<?php echo $date_added; ?>
<?php echo $viewed; ?>

可是都無法顯示,請問這是什麼原因?
如果你用的是OC v2.x版本,try this:
$data['date_added'] = $product_info['date_added'];
$data['viewed'] = $product_info['viewed'];

localhost本地测试应该没有问题,但是如果你在production server上不能运行,可能需要用到vqmod来修改product.php文件,这个不难,自己研究一下吧。

Newbie

Posts

Joined
Tue Jun 02, 2015 7:06 am

Post by openshop » Fri Jun 19, 2015 10:15 am

抱歉~我的是1.5.6.4

New member

Posts

Joined
Sat Dec 14, 2013 4:16 pm
Who is online

Users browsing this forum: No registered users and 9 guests