magento分类下的博客

display message

piaoling  2011-07-18 11:01:54

$this->_initLayoutMessages('catalog/session'); $this->_initLayoutMessages('checkout/session'); protected function _initLayoutMessages($messagesStorage)     {         if (!is_array($messagesStorage)) {             $messagesStorage = array($messagesStorage);         }         foreach ($messagesStorage as $storageName) {             $stor......

类别 :  magento(258)  |  浏览(4407)  |  评论(0)

get current category

piaoling  2011-07-18 10:55:21

public function getCategoryId()     {         if ($category = Mage::registry('current_category')) {             return $category->getId();         }         return false;     } ......

类别 :  magento(258)  |  浏览(3189)  |  评论(0)

通过产品属性和目录获取产品

piaoling  2011-07-18 10:37:38

public function getProducts()     {         $categories = $this->helper('specific')->getAllCategories();         $hightlightProducts = array();         if($categories)             foreach($categories as $category_id)             {                 $collection = Mage::getMod......

类别 :  magento(258)  |  浏览(3912)  |  评论(0)

Magento Set Session value and Get Session value

piaoling  2011-07-14 19:05:32

Magento Set Session value and Get Session value   Set a Session value into a session Id in magento is little bit different. If you want to follow the Magento process than you must have to write the code given below to set a value and get a value of a particular Session Id. To set Session write <?php Mage::getSingleton('core/session')->setData('session_Id'); ?> To get that session value write <?php Mage::getSingleton('core/session')->getData('session_Id'); ?>   from:https://aniscartujo.com/webproxy/default.aspx?prx=http......

类别 :  magento(258)  |  浏览(3365)  |  评论(0)

get Special price or Regular Price in magento

piaoling  2011-07-14 19:03:44

get Special price or Regular Price in magento   To get Special Price or Regular Price of a product you need to Know the product Id. Then write the code Below to fetch the All Price of a procduct <?php  $product= Mage::getModel('catalog/product')->load(product_id);  $price = $product->getPrice(); $webprice = $product->getwebprice(); $specialprice = $product->getFinalPrice(); if($specialprice==$price) {?> <span class="price">$<?php echo number_format($price,2);?></span> <?php } else { ?> <div class=&qu......

类别 :  magento(258)  |  浏览(3396)  |  评论(0)

How to show add Success message and add Error message in Magento

piaoling  2011-07-14 18:59:26

How to show add Success message and add Error message in Magento   This is one of the easiest way to show Either Error message or Success message in magento for one time.If you are thinking to show an error message or success message one time when a page load then it is the best method to use in mganeto. Show Error Message in frontend $message = $this->__('Email Id Already Exist.'); Mage::getSingleton('core/session')->addError($message); Show Success message in frontend $message = $this->__('You have Register Successfully'); Mage::getSingl......

类别 :  magento(258)  |  浏览(3501)  |  评论(0)

How to Create Custom login Session in magento

piaoling  2011-07-14 18:57:54

How to Create Custom login Session in magento   If you are trying to make a custom login module in magento then Magento have a default functionality to make a Custom login session,Which destroy automattically after some time, if you will be Inactive for a moment. Here I am showing you How to set login session value and How to get login session value. $username=$this->getRequest()->getParam('username'); $password=$this->getRequest()->getParam('password'); $sql='select * from `tablename` where `username`= "'.$username.'" and `pass......

类别 :  magento(258)  |  浏览(3381)  |  评论(0)

How to show/hide template path hints of admin panel/backend in magento

piaoling  2011-07-14 18:45:20

How to show/hide template path hints of admin panel/backend in magento   To show template path hints in admin panel of magento you need to login to your phpmyadmin then run the following sql command INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('default', 0, 'dev/debug/template_hints', 1), ('default', 0, 'dev/debug/template_hints_blocks', 1) To hide template path hints of admin panel or backed just run the top code by changing 1 to 0, then the template path hints will be hide. You also can run the following sql command to ......

类别 :  magento(258)  |  浏览(3245)  |  评论(0)

How to get all products from a particular category id in magento

piaoling  2011-07-14 18:42:38

How to get all products from a particular category id in magento While i was working on magento ,I had one requirement that how to get all product under a particular category id.I got the id of that particular category.Now I wrote the following code to get all product under that category id. My category id is <?php $catid=10 ;?> I go all product by writing the below code <?php $category = new Mage_Catalog_Model_Category(); $category->load($catid); //My cat id is 10 $prodCollection = $category->getProductCollection(); foreach ($prodCollection as $product) { $prdI......

类别 :  magento(258)  |  浏览(3215)  |  评论(0)

How to get all Sub-category list by a main category Id in magento

piaoling  2011-07-14 18:39:39

How to get all Sub-category list by a main category Id in magento   How to see all category and subcategory menu in Magento By default there is a top.phtml file in magento which show all category and subcategory .To modify menu display style it needs to modify in core file whcih will create problem to Update magento in future,So without touching the core file we can access all category and subcategory in magento. For that we will write the code in top.phtml file <?php foreach ($this->getStoreCategories() as $_category): ?> <li> <a href="https://aniscart......

类别 :  magento(258)  |  浏览(3204)  |  评论(0)
  • Page:11/26  258 Blogs
    <<
    >>
    20088
    周日 周一 周二 周三 周四 周五 周六

    文章分类