A sample text widget
Etiam pulvinar consectetur dolor sed malesuada. Ut convallis
euismod dolor nec pretium. Nunc ut tristique massa.
Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan.
Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem,
suscipit in posuere in, interdum non magna.
|
By zk47, on 三月 5th, 2010
Here are the steps for upgrading Magento with a full package or via SVN.
Backup your database Backup all the code you modified yourself, and don’t forget to keep the original installation archive Take care of saving the media directory that contains all the uploaded product/category images Create a backup copy of app/etc/local.xml . . . → Read More: Upgrading Magento with a full package or via SVN
By zk47, on 一月 2nd, 2010
EAV : Entity – Attribute – Value 的缩写,是数据库模型的一种,使用eav建模的好处是可以动态为数据模型增加或移除属性。
1. 问题提出:
假设需要定义一个实体Customer的信息,通常我们只要定义一个表为customer,并定义相应的属性即可。倘若某天需要为customer增加一个新的属性如“毕业学校”,那么就需要更改表的结构。 如果使用EAV模型则不必改变表结构。
2. Magento的EAV模型定义:
在Magento中,EAV模型相关的表定义有:
eav_attribute eav_attribute_group eav_attribute_option eav_attribute_option_value eav_attribute_set eav_entity eav_entity_attribute eav_entity_datetime eav_entity_decimal eav_entity_int eav_entity_store eav_entity_text eav_entity_type eav_entity_varchar
现在让我来观察最重要的三张表 eav_entity_type,eav_entity_attribute,eav_attribute
1) eav_entity_type表用来定义实体的基本信息。
mysql> select * from eav_entity_type where entity_type_id=1; +—————-+——————+——————-+—————–+—————–+ | entity_type_id | entity_type_code | entity_model . . . → Read More: Magento的EAV模型解析 动态自定义属性
By zk47, on 一月 1st, 2010
magento 在09年的最后一天发布了社区1.4版的rc1版本,继12月8日之后发布的magento beta后发布的magento rc1,相信离magento正式版发布的日子不远了。
Improvements Numerous HTML/CSS, accessibility and SEO improvements in design themes, including: – reviewed and fixed some obsolete differences between design themes – col-main moved before sidebar columns – numerous widgets CSS improvements – Added missing logo for print pages for French and German skins Added ability to define arbitrary . . . → Read More: magento 1.4 RC1 发布
By zk47, on 十二月 31st, 2009
There are two unused product list blocks in Magento which can be very useful if you push a few buttons, edit few layouts ..
1. Promotion Block located in app\code\core\Mage\Catalog\Block\Product\List\Promotion.php
This is basically built in featured product functionality. It reacts to “promotion” attribute which needs to be created, so let’s click Catalog->Attributes->Manage Attributes->Create New . . . → Read More: Display Random & Promotion Products in Magento
By zk47, on 十二月 31st, 2009
magento系统默认的add to cart框的数量是空的,其实默认的值为1,但是没有显示出来,可以通过这样的方法让magento add to cart 显示默认数量
修改的文件位于你所使用的magento模板文件夹所在的位置。 一般在template/catalog/product/view/addtocart.phtml 把下面的代码替换成下下面的代码就OK
<input name=”qty” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php echo $this->getMinimalQty($_product) ?>” type=”text” />
and replace it with:
<input name=”qty” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php if($_product->isSaleable()): ?> <?php echo $this->getMinimalQty($_product)== null?1:$this->getMinimalQty($_product) ?> <?php else: ?> <?php echo $this->getMinimalQty($_product)== null?0:$this->getMinimalQty($_product) ?> <?php endif; ?>” type=”text” . . . → Read More: Display default Add to cart quantity in magento
By zk47, on 十二月 14th, 2009
本文介绍的是如何将用户自定义选项批量导入到magento系统中。本文转自blogsbot,由于万能的GFW(再膜拜一下,万岁万万岁),很多人看不到,转一下,分享一下,知识的力量是封杀不住滴!!
Over the past several months I’ve been using Magento on four stores. I’ve run into a few things which have required slight modifications.
Recently I needed to import 200 new products. The products all had between 3 and 4 options. The default Magento import does not allow you to import custom options for products so I customized the import to allow imporing of options.
To add this customization to your magento store first copy app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php
to
app/code/local/Mage/Catalog/Model/Convert/Adapter/Product.php.
This will prevent upgrades from overwriting your changes.
Next you need to add some code to “local” version of Product.php (code/local/Mage/Catalog/Model/Convert/Adapter/Product.php). The line numbers below correspond to version 1.3 they may be a bit different in older versions.
At about line 566 you will see:
foreach ($importData as $field => $value) {
Just above that add:
$custom_options = array();
Continue reading import products with custom options in Magento
By zk47, on 十二月 14th, 2009
Recently, I just finished coding out a website for a client in Magento. You can view the site at www.3graces.com, it was a full switch from some old legacy asp shopping cart to Magento. Im really happy with the way things turned out and the client is too, Magento just has so many wonderful features built-in.
One feature that I found wasn’t built in was a way to display each sub-category with an image, and its name on a landing page. Magento has a nice feature which allows you to assign an image to a category, but doesnt give you a way to make that show up in a listing somewhere.
I setup 6 main categories, with each having multiple sub-categories and I wanted to have a way to show all those sub-categories to the user on a nice page that was pleasing to the eye. Here is an example: Payot Paris by Category.
To achieve this layout, I created a block called sub_navigation.html and placed it in the following directory: app/design/frontend/3graces/default/template/catalog/navigaton/sub_navigation.html
Continue reading Custom Category Images Listing Block Tutorial
By zk47, on 十二月 11th, 2009
文件位置:app/code/core/Mage/Core/Model/Email/Template.php第350行左右
修改后的文件另存到app/code/Local/Mage/Core/Model/Email/Template.php
if($this->isPlain()) { $mail->setBodyText($text); } else { $mail->setBodyHTML($text); }
替换成以下代码
$boundary = ‘–BOUNDARY_TEXT_OF_CHOICE’; $boundary_location = strpos($text, $boundary); $stext = substr($text, 0, strpos($text, $boundary)); $shtml = str_replace($boundary, ”, substr($text, $boundary_location)); $mail->setBodyText($stext); $mail->setBodyHTML($shtml);
需要在html格式的邮件模板html代码开始的地方加入
–BOUNDARY_TEXT_OF_CHOICE 即可解决问题
def xx(x,y): return (x*y)
By zk47, on 十一月 9th, 2009
magento的网站实在是太慢了,想了好多办法,参考了好多资料,做了很多测试,总结一下大概的步骤:
1、压缩js,css代码,如果有必要把所有的css,js分别综合到一个文件中,并压缩,缓存
2、清除magento模板中不必要的注释,为所使用到的图片瘦身
3、优化magento代码,这个步骤工作量大,但可能是效果显著的步骤,不过前提是你非常熟悉magento,彻底删除不用的模块,关闭没用的block,清除无效,无用的xml(解析xml非常昂贵的),在一个页面中尽量不要大量调用magento的image resize功能,非常消耗内存,除非你自己优化代码。
4、mysql配置优化,充分发挥你的硬件资源,下面的数值要根据你的配置调整
key_buffer_size = 512M max_allowed_packet = 64M table_cache = 512 sort_buffer_size = 4M net_buffer_length = 8K read_buffer_size = 4M read_rnd_buffer_size = 2M myisam_sort_buffer_size = 64M tmp_table_size = 128M query_cache_size = 96M query_cache_type = 1 thread_cache_size = 8 max_connections = 400 wait_timeout = 300 5、将magento的var目录挂载到内存中,加快读取速度,如 . . . → Read More: magento站点优化方案(转)
By zk47, on 十一月 8th, 2009
|
|