magento分类下的博客

Magento model to interact with db table

piaoling  2011-08-05 12:02:12

In this post I will show you how to write a basic magento model to do AMD activities to a db table. Under package “Mypackage” & module “Mymod” we will create model Test so that we can do AMD with table named “test”. 1.Here we first create a table test in db. 1 CREATE TABLE `test` ( 2 `test_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 3 `name` VARCHAR( 25 ) NOT NULL ......

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

magento datetime

piaoling  2011-08-05 10:39:55

Are you using date-time functions (date(), time(),now(), etc) directly inside magento ??? Think twice man !!! Even though time is set properly in you server or you set right timezone in your php.ini file, you might be surprised to see the result of the following code :- 1 //This time will not match your server time 2 $now = time(); 3 echo date('m/d/y h:i:s', time()); This is because wha......

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

magento database

piaoling  2011-08-02 10:16:04

......

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

add product to cart

piaoling  2011-08-01 11:08:27

    /**      * Action list where need check enabled cookie      *      * @var array      */     protected $_cookieCheckActions = array('add');     /**      * Retrieve shopping cart model object      *      * @return Mage_Checkout_Model_Cart      */     protected function _getCart()     {         return Ma......

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

magento api example

piaoling  2011-08-01 10:14:29

public function indexAction()     {         $apiUer = 'aland';         $apiKey = '123456';         $apiPath = 'catalog_product.list';         $null = '';         $catNeedle=0;         $filters = array(            'sku' => array('like'=>'nba'),  &nb......

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

magento db select on limit

piaoling  2011-07-29 10:25:29

$collection = $this->getProductCollection($storeId); $select =  $collection->getSelect(); $select->join(array('cat_index'=>'catalog_category_product_index'),"cat_index.product_id=e.entity_id and cat_index.store_id='$storeId' AND cat_index.category_id in ('10','17')",array('*')); $select->where("cat_index.product_id>35")                ->orWhere("cat_index.product_id<135"); $select->limit(7,2);//first param is the rows num......

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

magento join

piaoling  2011-07-27 14:09:45

$collection = Mage::getModel('catalog/product')->getCollection()->setStoreId($storeId)                       ->addAttributeToSelect("*"); $collection->getSelect()->join(array('cat_index'=>'catalog_category_product_index'),"cat_index.product_id=e.entity_id and cat_index.store_id='$storeId' AND cat_index.category_id in ($catsString)",array('*'));   more details :http://stackoverflow.com/questions/3949470/how-to-select-specific-......

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

Magento folder structure

piaoling  2011-07-26 17:01:04

Here’s short overview: / app - is where the application resides / app / etc - is global configuration den / app / code - is where modules have installed their models and controllers / app / code / core - are core team developed or certified modules / app / code / community - are community contributed modules / app / code / local - are local customizations / app / code / core / Mage - magento default namespace / app / code / core / Mage / {Module} - module root / app / code / core / Mage / {Module} / etc - module configuration / app / code / cor......

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

Magento Architecture

piaoling  2011-07-26 16:57:57

Page request flow   Preliminary core modules dependency diagram     ......

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

Basic Magento Directory Overview

piaoling  2011-07-26 16:55:55

Important Paths / -Directory Root /app - This is where all the php code for the application resides /lib - The external code library. /skin - This is where css and other images reside Thats the quick overview. /app /code - Where all modules reside /design - Contains both layout xml files and template .phtml files /etc - Global configuration Mage.php - Static class Mage, where everything is held together. Before I move on to the other two directories (/lib, /skin) I’ll explain the directories......

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

    文章分类