The recent home is very slow, run Magento profile check, found that the first page of a templat run time accounted for half, about 6s.With Magento's own cache, try to cache the code in collection, but don't know why it has failed, and finally decided to turn the entire template into a static page, regenerated every two hours.The code is as follows:PHP$dir= Mage::getbasedir (). DS. ' var '.DS;$fileName=$dir.‘ Real_static_categories.phtml ';if(!file_exi
Call SetData () methodThis class does not, go to his father's class to findClass Mage_dataflow_model_batch extends Mage_core_model_abstractapp\code\core\mage\core\model\abstract.phpFound no, he inherited theAbstract class Mage_core_model_abstract extends Varien_objectFind the corresponding core classlib\varien\object.phpFound it/*** Overwrite data in the object.** $key can be string or array.* If $key is string, the attribute value would be overwritten by $value** If $key is an array, it'll ove
Discuz comes with Ucenter, which is mainly used for communication with other programs. We can download the Discuz ucenter Development Manual for Magento and discuz integration. There are some Ucenter interface functions and parameter descriptions, without this document, the template will not be able to do the following:1, put the API and Uc_client directory in the application directory.2, modify your own configuration file (Application/config/config.i
Magento date and time functionsMagento date-related methods are mainly in two files. One is the core/date model class, and the other is the core assistant class. The methods are as follows.ExampleMage: getSingleton ('core/date ')Mage: getSingleton ('core/date')-> timestamp ($ input)Obtains the timestamp of a specified date. If the parameter is null, the current timestamp is obtained.The Returned time is actually the calculation result
Especially in the local debugging, often in the phpMyAdmin inside the database can not be successfully imported, no matter how small the database, and sometimes really can not import. Then try to import it using the command line method, which will generally succeed.1. After installing the phpMyAdmin client, go through WIN's Start menu--MySQL----MySQL SERVER 5.6---MySQL 5.6 COMMAND line Client2. After entering the password for the connection database, you will see the mysql> prompt3. After the pr
In any fast iteration project, it is a headache to ensure the synchronization of development and production (current network) databases. Magento provides a system for creating resource migration versions, which can help us deal with this problem that is constantly encountered during the development process. Www.2cto.com we created the weblogpost model last time. This time, we execute create table directly. We will not create a Setup Resource for our m
Magento adds the "new" or discount quantity label magentonewlabel. discountlabel to the product. The bottom of the article is. Add a new tag to the new product. Shows the quantity of discounts for discount products. You can add a piece of code to the bottom of the cata article in the template folder.
Add the "new" label to the new product. Shows the quantity of discounts for discount products.
You can add a piece of code to the catalog/product/list.
Step I Add a occupation/title field to the user registration page, almost 54 lines in register.html, add a occupation display code below the email
Code:
This is, if you go to the User registration page, you will see the new fields. Step 2 Also in edit.phtml, add occupation display block
Code:
Step 3, open model/entity/setup.php almost 93 lines, below the email, add the relevant code of
Use only $collection->addfieldtofilter (), do not use Addattributetofilter () or zend_db_expr (can be used for more complex where statements) such as: collection- >getselect ()->where (New zend_db_expr ("E.created_at > ' 2013-01-01 00:00:00 ' OR e.created_at $_collection Array $weight )) (array$weight));OR relationship------------------------------------------------------min_weight > $weight or$weight > Max_weight$_collection-addfieldtofilter (array(' min_weight ', ' max_weight '), array (
Cause analysisThe order price of Magento is calculated by executing the set pricing model under the global/sales/quote/totals node configured in config in sequence, the execution sequence is controlled by the after and before nodes of each model. For example, we can see the following code in the native app/code/core/Mage/Tax/etc/config. xml configuration file:.........We can note that the before node of the tax model specifies grand_total, which means
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.