Run Magento Code Externally

piaoling  2011-06-23 18:59:51

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......

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

Accessing Static Blocks In Magento

piaoling  2011-06-23 18:58:24

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 ......

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

addAttributeToFilter Conditionals In Magento

piaoling  2011-06-23 18:57:31

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(258)  |  浏览(3603)  |  评论(0)

Magento Checkout Error: undefined Javascript Alert

piaoling  2011-06-23 18:55:23

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(258)  |  浏览(3464)  |  评论(0)

Magento Cron Jobs

piaoling  2011-06-23 18:53:03

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(258)  |  浏览(3800)  |  评论(0)

Magento Forms: Prototype Javascript Validation

piaoling  2011-06-23 18:40:18

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 ......

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

19 个漂亮的 jQuery 画廊和幻灯片插件

piaoling  2011-06-23 18:06:50

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 ......

类别 :  jQuery(9)  |  浏览(6010)  |  评论(0)

JS的正则表达式

piaoling  2011-06-23 13:11:26

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代码 ......

类别 :  JS(21)  |  浏览(5380)  |  评论(0)

Magento: Update Product Prices Globaly

piaoling  2011-06-23 10:42:17

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(258)  |  浏览(3912)  |  评论(1)

Magento Database Structure: EAV

piaoling  2011-06-22 18:28:36

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. ......

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

    文章分类