存档

‘技术’ 分类的存档

修改Cs-Cart里Our Quantity Discount的样式

2010年3月4日

如何修改Cs-Cart里Our Quantity Discount的样式呢?
之前的默认样式是每个商品购买量/折扣价格按1+、10+、20+的模式,
这样似乎给那些完美主义者一个找茬的借口:1+就包括了10+和20+!
乍一想确实是这样,于是我们需要修改当前的显示样式,
把他变成1-9,10-19,20+这个模式。
修改方法:打开products_qty_discounts.tpl,将第一个foreach循环,修改为:

{assign var=”colum” value=$product.prices|@count}
{foreach from=$product.prices item=”price” name= foo}
{assign var=”iis” value=$smarty.foreach.foo.index+1}
{if $smarty.foreach.foo.index != 0 }
<td>{$pll}-{math equation=”x – y” x=$price.lower_limit y=1}</td>
{/if}
{assign var=”pll” value=”`$price.lower_limit`”}
{if $iis == $colum}
<td>{$price.lower_limit}+&nbsp;</td>
{/if}
{/foreach}

分类: 技术

zend framework下的分页类

2010年1月28日

zf的分页类感觉还不是很好,于是找了个,记录一下。
阅读全文…

分类: 技术

Warning: Missing argument 2 for vmGet()

2010年1月27日

VirtueMart 1.1.3版本中,在Shipper list创建一个Shipper可能会报错。

Warning: Missing argument 2 for vmGet(), called in …/administrator/components/com_virtuemart/classes/ps_shipping.php on line 138 and defined in …/administrator/components/com_virtuemart/classes/request.class.php on line 26

解决的办法也很简单,
打开administrator/components/com_virtuemart/classes/ps_shipping.php,

$fields = array( ’shipping_carrier_name’ => vmGet($d["shipping_carrier_name"]),

替换为

$fields = array( ’shipping_carrier_name’ => vmGet($d, ’shipping_carrier_name’),

问题就解决了。

分类: 技术

zf中controller之间的action跳转执行

2010年1月23日

zf从一个controller的action跳转执行另一个controller action方法怎么操作?

$this->_forward($action, $controller = null, $module = null, array $params = null)

$this->_redirect(‘/controller/action’) 会向浏览器发出一个 “Location: /controller/action” 这样的 header ,致使浏览器再产生一个 URL 为 /controller/action 的 web 请求

$this->_forward() 却不是这样,它不依赖于浏览器,而是在执行完 actionA 后在继续执行一个 actionB,这完全是在服务端完成,中间没有跟浏览器打交道过程。

对用户来说,$this->_forward() 时他会在地址栏上看到一个/controller/actionA,虽然还做了个 /controller/actionB 的动作,这是一个请求,两个动作。而$this->_redirect() 则是两个个请求,两个动作。

显然两种不同的机制会造成两种不同的结果,$this->_redirect() 会将两个action 的结果分别显示在两个页面上,而 $this->_forward()  则会在一个页面同时输出两个动作的结果。

$this->_forward(‘index’,'zipcode’,”,’id’ => ‘10001′)
$this->_forward(‘index’,'zipcode’,'default’,'id’ => ‘10001′)

接收参数页面

$id = (int)$this->_request->getParam(‘id’, 0);

分类: 技术

zf读取在config.ini里的配置信息

2010年1月23日

zend framework如何读取在config.ini里的配置信息?

$this->registy_i = Zend_Registry::getInstance();
$db_a = $this->registy_i->dbarray;
$db = Zend_Db::factory(‘PDO_MYSQL’, $db_a);

分类: 技术