`
kirenenko04
  • 浏览: 145974 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
public function addToCategory($sku,$categoryId) { $category = Mage::getModel('catalog/category')->load($categoryId); $positions = $category->getProductsPosition(); $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku); $productId = $product->getId(); ...
Link
//get $_product price echo $_product->getPrice(); echo number_format($_product->getPrice(), '2', '.', ','); //get $_product special price echo $_product->getSpecialPrice(); echo number_format($_product->getSpecialPrice(), '2', '.', ','); //get $_product final price echo $_pr ...
bool类型的select框:可选是否的select原件 //决定是否是一个专区 $installer->addAttribute('catalog_category', 'homepage_special_category', array( 'group' => 'Display Settings', 'type' => 'int', 'label' => 'Homepage Special Category', 'input' => 'select', 'source' => 'eav/ent ...

获取热销商品

  $storeId = Mage::app()->getStore()->getId(); $products = Mage::getResourceModel('reports/product_collection') ->addOrderedQty() //->addAttributeToSelect('*') ->addAttributeToSelect(array('name', 'price', 'small_image', 's ...
<reference name="content"> <block type="mycms/homepage_featured" template="mycms/featured.phtml" name="content.featured" id="content.featured"/> </reference>   从上面的block配置的type值可知,需要的block文件是mycms模块下的block目录内的homepage文件 ...
现在应用模块的config.xml里面配置 <helpers> <mycustomer> <class>Bysoft_Mycustomer_Helper</class> </mycustomer> <customer> <rewrite> <data>Bysoft_Mycustomer_Helper_Data</da ...
文件上传后数据库怎么处理比较好?收集文件地址比较好.PS.已经尝试了上传许多文件后,个人认为在数据库中直接放二进制的图片数据会显得很混乱.有可能因为截断问题把图片搞的很不完整.所以存放路径成为比较理想的方案.PS.图像地址存放,这个字段的类型选择BLOB原因是便于存放多个文件地址;加入地址的时候,使用特殊符号分割加入;提取时候就可以获取多个文件地址了;
<?php function is_leapyear($year) { //计算这一年是不是润年 if(($year%4==0 and $year%100!=0)or ($year%400==0)) { return 1; //1代表是润年 } else { return 0;//0代表不是闰年 } } function cnt_year ...
看这样一个关系Customers(cust_id,cust_name,cust_contact)Orders(order_num,cust_id,order_date)如果有这样的检索语句: select cust_name,cust_contact,( select count(*) from Orders where Orders.cust_id=Customers.cust_id group by cust_id) from Customers  其运作步骤为:1.从O ...
Global site tag (gtag.js) - Google Analytics