Run Magento Code Externally
If you're working with Magento often you'll find sometimes you need to use Magento functions and classes outside of the Magento platform. This can be easily achieved with the following lines of code. ? 1 2 3 4 5 6 7 8 9 10 require_once('app/Mage.php'); //Path to Magento umask(0); Mage::app(); // Now you can r......
Accessing Static Blocks In Magento
Sometimes a client asks to be able to manage certain areas of their Magento ecommerce website that would usually require access to template files. While this is okay, most clients consider HTML a foreign language and would probably do more harm than good. To remedy this, a lot of developers would consider creating a custom module. While this isn't bad, sometimes it can require too much work if the client only wants to change one line of text! A much easier and quicker solution is to use a static block. Static Blocks can be included into your design in three main ways: Inside a ......
addAttributeToFilter Conditionals In Magento
addAttributeToFilter is a function that can be called on a product collection in Magento. In short, it adds a condition to the WHERE part of the MySQL query used to extract a product collection from the database. ? 1 2 3 4 $_products = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect(array('name', 'product_url', 'small_image')) ->addAttributeToF......
Magento Checkout Error: undefined Javascript Alert
This error occurs when the user gets to the final step in the Magento Onepage checkout: the order review. When they click the submit button the page loads for a few seconds and then a Javascript alert box is displayed with the message 'undefined'. Not only does this destroy the trust a customer has in your website, it actually stops them from completing the purchase. This means you are losing money and customers! Unfortunately there is no quick generic fix for this but hopefully, by explaining the cause and a way to identify the error, you will be able to overcome this on your own.......
Magento Cron Jobs
What is Cron? To quote Wikipedia, 'cron is a time-based job scheduler in Unix-like operating systems.' It functions similarly to Windows Task Scheduler in that it allows you to specify actions to be ran after a certain interval. This can be useful for running daily backups or deleting your logs at the end of every month. Where is Cron Used in Magento? By default, cron is used in Magento for various things such as keeping your catalog indexes up to date and refreshing catalog price rules. Cron jobs can also be set up for custom modules, which we will cover shortly. D......
Magento Forms: Prototype Javascript Validation
While Javascript form validation shouldn't be your only form of defense with regards to user input, it definitely improves the usability and efficiency of a site. It can also give your site a web 2.0 feel - which users seem to love. Javascript Validation in Magento By default Magento uses a file called form.js (js/varien/form.js) to provide abstract Javascript functions for forms. The most useful application of this class - in my opinion - is the form validation. To achieve this validation, form.js uses the Validation class which is part of the Prototype Javascript library. It ......
19 个漂亮的 jQuery 画廊和幻灯片插件
http://www.oschina.net/news/18948/19-beautiful-jquery-image-galleryslideshow-tutorials-and-plugins?from=20110619 本文向你介绍 19 个 jQuery 的画廊和幻灯片的插件或者是制作教程。 TN3 Gallery TN3 Gallery 是一个很成熟的基于 HTML 的可定制的图片画廊和幻灯片展示,支持转换和多相簿选项,支持智能手机设备浏览。 Live Demo – Download Supersized 主要特点: 图片大小自动调整,以适应浏览器的尺寸 幻灯片时自动预加载图片 Core version is available for ......
JS的正则表达式
JS的正则表达式 //校验是否全由数字组成 function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)) return false return true } //校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串 Java代码 function isRegisterUserName(s) { var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/; if (!patrn.exec(s)) return false return true } //校验用户姓名:只能输入1-30个以字母开头的字串 Java代码 ......
Magento: Update Product Prices Globaly
There are many ways to mass update product attributes in Magento, each well suited to a different purpose. Magento's built-in mass product attribute updater is great if you want to modify a selection of products or the new attribute value is the same for all products you want to edit. Alternatively, if you wish to alter the attributes in more dynamic ways, updating them programmatic ally via PHP is probably a better way. The downside to both of these methods is speed, with each product update taking a few seconds to complete. While this time can be dramatically reduced by disabling ind......
Magento Database Structure: EAV
The Entity, Attribute and Value (EAV) database architecture is at first, extremely difficult to grasp. Combine this with the lack of documentation on EAV and you find that most people don't truly appreciate just how good EAV is and more importantly, how well suited it is to Magento. In this article I will attempt to shed some light on EAV in the hopes of helping you understand how it works, why it works and how this knowledge can benefit you as a Magento developer. To better understand this article, I recommend opening up a development Magento database using a tool such as phpMyAdmin. ......
- Page:51/146 1451 Blogs
周日 | 周一 | 周二 | 周三 | 周四 | 周五 | 周六 |
文章分类
- 默认(751)
- 日志(47)
- 感悟(15)
- testIT(4)
- PHP_XML(5)
- PHP(78)
- 明星(1)
- 笑话(31)
- 毕业论文(2)
- 生活(60)
- HTML(11)
- CSS(6)
- 考研(3)
- JS(21)
- 简历(6)
- svn(3)
- 音乐(1)
- 学习(7)
- jQuery(9)
- 英语口语(9)
- 书籍(2)
- magento(258)
- apache(12)
- 创意(4)
- 设计(4)
- 休闲(1)
- IT咨询(11)
- 工作(23)
- ubuntu(21)
- bysoft(1)
- zend(1)
- web(2)
- software(1)
- sql(5)
- 娱乐(5)
- photoshop(3)
- zend framework(2)
- nginx(3)
- 小说(1)
- 名言(1)
- 牛人(1)
- Mysql(6)
- vim(2)
- wordpress(8)
- drupal(1)