tag:blogger.com,1999:blog-70761497934898244892024-03-13T10:13:10.681-07:00Magento Programmer<p>Learn and share useful trick and tips for magento customization and ecommerce website development.Here you can find free Magento themes and new Magento templates with ecommerce website development solutions.</p>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.comBlogger101125tag:blogger.com,1999:blog-7076149793489824489.post-81828452653582761942012-07-09T10:42:00.000-07:002013-04-23T06:20:12.962-07:00Responsive Magento Theme - A new approach to ecommerce website<div dir="ltr" style="text-align: left;" trbidi="on">
Responsive web design is a new approach of web designing in which website break down its whole layout in such a way that it looks nice and more readable on all mobile devices and all web browser of any resolutions. In the world of iPhone and iPad, mobile plays an important role for online product selling website. A recent survey on mobile usage shows that if store owner does not adopt new technologies of keeping their website mobile friendly, they will loose a giant segment of their product consumers.<br />
<br />
Almost 79%of smart phone users use their mobile for online shopping. they either prefer iPhone apps for purchasing their items of browse mobile friendly website for placing their order. so as a being a store owner, you have two choice to make your store mobile friendly. Either <a href="http://www.trafacs.com/hire-developer/iphone-apps-developer/" target="_blank">hire iPhone application developer from India</a> and develop iPhone apps for your products or convert your current website into responsive.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKdTne3ImkuDjLq-lrwyeP4IYkotcP4ITBbypp2_RzaqbnO1ofROFn0Tp5Gqso7j3ACwgNeLnev6TIZ7g4Z84HJLPInDMmUb1jrEAETxQGf4TyUfggOkYo8WUfKoa_yZVZ97a85TnwZvc/s1600/portfolio_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKdTne3ImkuDjLq-lrwyeP4IYkotcP4ITBbypp2_RzaqbnO1ofROFn0Tp5Gqso7j3ACwgNeLnev6TIZ7g4Z84HJLPInDMmUb1jrEAETxQGf4TyUfggOkYo8WUfKoa_yZVZ97a85TnwZvc/s1600/portfolio_1.png" /></a></div>
<br />
Compare to developing mobile apps for each technologies like iPhone, android, windows or blackberry, responsive web design is far better solutions. It will be more cheaper and device independent solutions compare to developing apps for each type of smartphone.<br />
<br />
As magento is a leading open source for ecommerce store, its easy to get developed responsive theme for your magento store. There are so many <a href="http://www.creativeglance.com/magento-customization.html" target="_blank">responsive magento theme designing company</a> available which can helps you to convert your existing website into mobile compatible version. There are also many ready made <a href="http://www.magentocommerce.com/magento-connect/mobile-shoppe-a-responsive-magento-theme-1032.html" target="_blank">free responsive magento theme</a> and commercial theme are now available in market place with easy plug and play installation. There are so many advantage of using responsive design compare to traditional design<br />
<br />
<ul style="text-align: left;">
<li>You can get advantage of your mobile user as your website looks more user friendly compare to desktop website on mobile device.</li>
<li>Readability of your website on mobile device is better then non-responsive website.</li>
<li>As responsive design adjust their layout as per mobile screen and web browser, it looks great in almost all type of smartphone. its a device independent solutions.</li>
<li>In terms of search engine, Its a prefered solution of developing mobile compatible website as you do not have to maintain multiple urls for same product. </li>
<li>It gives charming look and credits to your business when user find nice website on their mobile. </li>
</ul>
<div>
Creative glance is leading magento theme designing company who has robust experience of developing responsive magento theme for your ecommerce store. hire php programmer for ongoing magento theme designing and customization work. </div>
</div>
Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com3tag:blogger.com,1999:blog-7076149793489824489.post-53776936442544592482011-01-10T02:38:00.000-08:002013-04-23T06:14:33.086-07:00Important tips about Magento Template Development and Magento web solutions<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
Creative glance technologies offers effective web solutions with expert web developers. You can get perfect web services and solutions like design, develop, integrate and maintain web applications that enable enterprises to solve complex and critical business problems.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In a very short span of time, <b>Creative glance technologies</b> has the opportunity to work with a diverse range of industries and clients. Company implements modern web development approach to designs and developer a useful website. If you are looking for ecommerce solutions with Magento template development then you can find correct solutions related to your requirement from creative glance technologies.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the field of website development, many new open source tools are creating by expert web developer and companies and people use them through online. <b>Magento theme customization</b> and template design is new systems, which is used to build ecommerce website applications based on Magento platform. Magento programmers provide resource hiring facility to complete your Magento Integration including theme design, programming, payment gateway integration and customization of Magento ecommerce platform.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Creative glance technologies</b> believe in offering quality service and developing long lasting relationship with clients, at the end of the day, relationship and quality services are the backbone of any company. Company has team of experts website developers to get perfect solutions for their clients. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Within the era of ecommerce development, Magento may bring about a whole lot inside a internet site simply by improving the rate associated with traffic. This <b>open sources technologies</b> helps to clients to understand internet portal systems for online services provider website .Being a strong free software, Magento has brought robust origins across the internet.<br />
<br />
Visit <a href="http://www.creativeglance.com/magento-customization.html">Creative Glance</a> for details of magento template and theme development services.</div>
</div>
Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com1tag:blogger.com,1999:blog-7076149793489824489.post-26992784888127229982011-01-01T05:02:00.000-08:002013-11-08T03:10:14.048-08:00Why Magento website development is useful for Ecommerce websites?<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
Ecommerce website development is very popular and important part for any company, business that based on online services. Website developers use open source technology to customize website projects for clients. Mainly <a href="http://hire-magento-programmer.com/" target="_blank">outsourcing magento development company in India</a> implements <b>Magento website development</b> to develop ecommerce web projects.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Magento is an open source technology, which is used to create ecommerce platform for businessperson. If you are providing online trading facilities for your customers, clients then you can use Magento templates to develop flexible website solutions for business.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
With the help of Magento you can develop your e-Commerce store and can display your services through internet. Magento is very much flexible over other components, which helps to build a good, customized easy to use and very demanding ecommerce store. Magento platform also gives flexible solutions to users to get information, tips from ecommerce platform. This platform helps you to manage product browsing, payments, and managing catalog.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Magento website development add system that is more useful your ecommerce store. If you want to change your existing ecommerce store then with Magento theme you can easily get <b>ecommerce customization solutions</b> to add more services with your website/ecommerce stores.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
When you give any web development task to any website developer then you can get information about the special tips from web programmer to make user-friendly website and more attractive. Website with dynamic pages should be handling careful because sometimes the problem occurs about website development.</div>
<div style="text-align: justify;">
You can also <b>hire Magento programmer</b> for getting a professional outputs from your ecommerce website. Magento experts provide modern web services and solutions based on web2.0 properties to your business.</div>
</div>
Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com2tag:blogger.com,1999:blog-7076149793489824489.post-47669158427741074432010-12-22T03:39:00.000-08:002013-11-08T03:12:20.024-08:00Special tips about Magento Customization and Magento Theme Development<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
This post is all about Magento customization and <b>Magento theme development</b> with website applications development. Today web services are growing very fast and many new programming language and framework used to create dynamic websites.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Many business persons use ecommerce website to provide unique web solutions to their customers. People can buy or sell product online through ecommerce web site and get response through the website. <b>Website developer</b> use Magento software to develop ecommerce website.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Magento is an open source web applications software used to develop ecommerce projects and shopping cart solution. Website programmers develop themes for the Magento ecommerce platform, which provide flexible web solutions to create new projects.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you want to <a href="http://www.webpixsolutions.com/">develop ecommerce magento based website</a> and want to boost your business returns, then it is mandatory to build up an e-commerce website. Magento e-Commerce is the new technology arrives for <b>ecommerce development</b> and shopping cart solution, and the latest technology available. Magento will help you to create online store, online shopping cart with Magento CMS and customization.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Magento theme development used to get complete ecommerce solutions for online shopping cart web services. You can easily understand functionality of an Online Store with <b>Magento development</b>. The Magento Commerce Platform combines the flexibility of open-source technology with industry leading features to provide merchants unprecedented control over online store operations and get the online sales booming<br />
<br /></div>
</div>
Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-14723987844268620802010-12-14T20:59:00.000-08:002013-11-08T03:13:25.413-08:00Hire PHP Programmer – Web Development – Website Design Company<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
PHP is one of the fastest growing web scripting languages on the Internet today, and for this reason this languages is globally used to develop website.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Web Development</b> in PHP is becoming increasingly popular in website development industry because of PHP is open source language. Open source technology is used to make CMS web development and e-commerce website solutions. PHP web programming is easily under-stable and easy to run on any OS platform.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In this time, many business services are based on ecommerce system and they need to build a online sells management system and this systems can be easily developed in PHP. Magento, Joomla, Wordpress, OsCommerce etc. are most popular CMS platforms, which are totally based on PHP.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you have business, which is related to online services, then you need to hire PHP programmer to build your ecommerce website. In India many website design company provide web development services but you have to select perfect web Development Company that make accurate website for your business.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><a href="http://www.ukwebsitedevelopment.com/" target="_blank">PHP web development company in India</a></b> offer several web applications services like web design, web development PSD conversion and search engine optimization services to help your business. <b>Web Applications Development </b>Company associated with dedicated PHP developer, web designer and SEO experts to perform unique web solutions according to clients’ requirement.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Online selling web portal need well web applications systems, which makes flexible environment on internet for user. PHP has all major parameters, which are used to develop data driven web applications, and due to this reason, PHP is highly popular in the world. If you are going to make new <b>ecommerce web applications</b> they you can make it easily with PHP.</div>
</div>
Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com1tag:blogger.com,1999:blog-7076149793489824489.post-70279875243922538452010-07-01T07:57:00.000-07:002010-07-01T07:58:09.792-07:00How to add new layout template for MagentoMany times we need to add new layout skeleton rather then 2colums-left, 2columns-right, 1column and 3columns. Here is the way how we can add more layout structures.<br />
<br />
<br />
You can make modification directly in app/code/core/Page/etc/config.xml but if you don’t want to touch core file, I recommend you to follow these steps:<br />
<br />
Create config.xml under <code style="color: #b45f06;">app/code/local/Magestore/Page/etc</code><br />
<br />
<div style="background-color: #b45f06; color: white; padding: 15px; width: 500px;"><pre><code><?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<Magestore_Page>
<version>0.1.0</version>
</Magestore_Page>
</modules>
<global>
<page>
<layouts>
<three_columns_cms module="page" translate="label">
<label>3 columns for cms page</label>
<template>page/3columns-cms.phtml</template>
<layout_handle>page_three_columns_cms</layout_handle>
</three_columns_cms>
</layouts>
</page>
</global>
</config></code></pre></div><br />
Now, open app/etc/modules and create file Magestore_Page.xml<br />
<br />
<div style="background-color: #b45f06; color: white; padding: 15px; width: 500px;"><pre><code><?xml version="1.0"?>
<config>
<modules>
<Magestore_Page>
<active>true</active>
<codePool>local</codePool>
</Magestore_Page>
</modules>
</config></code></pre><pre><code> </code></pre></div><br />
You have to create a file named '3columns-cms.phtml' under <code style="color: #b45f06;">app/design/frontend/[YOUR_PACKAGE]/[YOUR_THEME]/template/page</code>.<br />
<br />
Now, log in your admin, go to Cms -> Manage pages, click Add new page. In Custom Design tab, you can find new layout you just created:Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com3tag:blogger.com,1999:blog-7076149793489824489.post-81735647093968044502010-06-19T23:29:00.001-07:002010-06-19T23:29:30.406-07:00Whats New in Magento 1.4.1.0<h3>Improvements</h3><ul class="list"><li>Added ability to use static URLs for media in WYSIWYG or image browser. Added ability to enable parsing store, skin and media directives on catalog frontend.</li>
<li>URL rewrites history: ability to auto-generate custom rewrite with redirect from old to new URL when changing product URL-key</li>
<li>Added ability to exclude a category from navigation menu</li>
<li>Various improvements in system configuration UI. Introduced ability to make actual configuration structure to be independent on the system.xml structure</li>
<li>Added "Only X left" inventory feature</li>
<li>Implemented Centinel functionality in iphone theme</li>
<li>Upgraded TinyMCE to v.3.3.2</li>
<li>Improved PayPal integration, includes:<br />
* Recurring payment profiles entity and purchasing of "subscription" products. In checkout they are treated as "nominal" items.<br />
* Billing agreements<br />
* "Pending Review" order state, "Pending Review" and "Suspected Fraud" order statuses and logic related with this. Triggers by PayPal IPR, FMF and Unilateral payments.<br />
* Functionality of transactions listing/searching and fetching from gateway<br />
* Fetching PayPal settlement reports via SFTP<br />
* Various improvements of PayPal integration on the frontend and admin UI</li>
<li>Added notice about creating offline creditmemo from order view page.</li>
<li>Added getter for recurring payment methods in payment helper.</li>
<li>Implemented abstract block ability to have arbitrary groups of child blocks and a method that returns such a group. Implemented a method that fetches data from child block by specified alias.</li>
<li>Implemented ability to specify "sort_order" instead of "before" and "after" in the totals declaration. All nominal totals declaration utilize "sort_order"</li>
<li>Added getter for specified object data by key in core/template block: method getObjectData()</li>
<li>Defined payment methods grouping, implemented getter for payment method list (with option to group them). Added ability to render grouped options in the "select" grid filter.</li>
<li>Moneybookers: utilized the payment methods grouping for all its methods; removed redundant "translate" attribute in the methods definition in config.</li>
<li>Utilized payment methods grouping for PayPal peyment methods.</li>
<li>Added more verbosity to PayPal NVP and IPN debugging</li>
</ul><br />
<h3>Changes</h3><ul class="list"><li>Sales module database structure changed from EAV into flat tables</li>
<li>Product custom URL rewrites redirect to SEF URL, rather than to catalog/product/view/id/</li>
<li>Reimplemented frontend top menu rendering logic (cross-browser and usability improvements)</li>
<li>Reviewed logic of the sales reports: Orders, Tax, Invoiced, Shipping, Refunds, Coupons</li>
<li>Reimplemented bestsellers report</li>
<li>Implemented 3D Secure validation for Maestro International and JCB cards</li>
<li>Changed Shopping cart methods output (top + bottom): removed </li>
<li>Moved the Payflow Pro payment method to PayPal module</li>
<li>Refactored sales/service_quote model: instead of submit() method the submitAll() should be used. It can submit nominal items separately from the order. The methods for submitting nominal items and order separately - are available as well.</li>
<li>Refactored onepage checkout model to use the new method sales/service_quote::submitAll(), added recurring profiles and billing agreements passing through the process until the success page</li>
<li>Utilized child blocks grouping to improve flexibility of rendering additional information in catalog/product/view template. The group is called "detailed_info"; any block from layout may insert itself to this group.</li>
Removed redundant wrappers hard-coded into some catalog templates. Template of parent block is responsible for wrapping.</li>
<li>Refactored onepage checkout success block and template: simplified fetching related checkout information, added ability to render billing agreement and recurring profiles that might be created with the payment placement.</li>
</ul>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com2tag:blogger.com,1999:blog-7076149793489824489.post-19362459623974337822010-06-05T02:26:00.000-07:002010-07-01T07:56:01.865-07:00Google Analytics code bug in Magento 1.4.0.1<div class="entry-content">We just released a site based on the latest community release of Magento 1.4.0.1. All went well until the point when we enabled Google Analytics for the site.<br />
<br />
Firebug was showing an error: <code style="color: #b45f06;">_gaq is not defined</code><br />
<br />
<img alt="google analytics error in magento 1.4.0.1" class="alignnone size-full wp-image-287" height="96" src="http://magebase.com/wp-content/uploads/2010/05/ga-error.png" title="google analytics error in magento 1.4.0.1" width="223" /><br />
<br />
So there was a variable issue with the extra javascript analytics code inserted by Magento. A quick google search revealed that this issue was already reported in the Magento bug tracker and a solution/workaround provided.<br />
<br />
The problem is in file: <code style="color: #b45f06;">app/code/core/Mage/GoogleAnalytics/Block/Ga.php</code><span style="color: #b45f06;"> around line 170. Adding: </span><code style="color: #b45f06;">var _gaq = _gaq || [];</code> fixes the issue.<br />
<br />
Easy fix, however, this sort of bug is something that shouldn’t have slipped through testing and quality control. </div>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com1tag:blogger.com,1999:blog-7076149793489824489.post-92076348715452368672010-05-28T23:40:00.000-07:002010-05-28T23:40:08.888-07:00CSS In Magento<div class="post"> The first thing that you need to do with Magento is famililarise yourself with the CSS files, as you will be using these an awful lot. There are 7 different files in total, so you need to know what is located where and the things you will need to edit.<br />
<br />
Most of the editing is done in the "boxes.css" file. All of the css files are located in <b>".../skin/frontend/YOUR_THEME/YOUR_THEME/css".</b> If you have not changed the name of the theme or created a new one then it will be called "default" <b>(".../skin/frontend/default/default/css")</b> If you wish to change the colours or settings of any forms, tables, menus, buttons, error messages; then this is the place to be. <br />
</div>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-45157339072606947862010-05-28T04:19:00.000-07:002010-05-28T04:23:16.163-07:00Ten Tips for Keeping your Magento Store SecureAre you worried about the security of your Magento store? Magento has a number of built-in security features aimed at keeping you safe, but there are some steps you can take to make your site even more secure. Follow this ten-point security policy to protect your site from hackers and security breaches.<br />
<br />
1. Choose a secure password<br />
<br />
When you're choosing your Magento site's administrator passwords, choose wisely. Depending on your configuration and permissions, this password may give access to customer information and credit card data. This is probably review for most readers, but here are some guidelines for creating a really secure password:<br />
<br />
Bigger is better. Use at least 10 characters.<br />
Mix upper and lower case, punctuation, and numbers.<br />
Making your password phonetic can make it easier to remember and type quickly.<br />
<br />
2. Require HTTPS/SSL for all pages with logins<br />
<br />
Each time you send data over an unencrypted connection you run a risk of this data being intercepted by an unwanted third-party. Login credentials are no exception. To minimize the risk of your username and password landing in unscrupulous hands, always send it over a secure connection. By always sending your login information over an encrypted connection, hackers are limited to expensive and extremely difficult brute-force attacks.<br />
<br />
How to require HTTPS/SLL in Magento<br />
In Magento you can require secure logins by selecting "yes" for both "Use Secure URLs in Frontend" and "Use Secure URLs in Admin" by going to the "Secure" section of the "Web" tab in the system configuration. In order to access the system configuration, go to the "System" menu and select "Configuration."<br />
<br />
<img alt="Magento Web Configuration Screenshot" height="326" src="http://addoa.com/files/blog/magento-security/web-secure.jpg" width="510" /><br />
Set "Use Secure URLs" to "yes" for both the frontend and admin<br />
<br />
3. Don't use your Magento password for anything else<br />
<br />
Do not use your Magento password with any other web services (such as email) or any other sites (such as Twitter, Facebook, Flickr, etc.). Third-party sites may not require or even support HTTPS/SSL to login, breaking rule number two. In the event that a third-party website is hacked, your password may be vulnerable.<br />
<br />
4. Use a custom admin path<br />
<br />
By default, you access your Magento admin panel by going to your-site.com/admin. Having the path to your admin panel path easily guessable means that someone or something (i.e. a password-guessing robot) can snoop around and try to guess your password. By having your admin path be a secret code word instead of the default /admin, you can prevent users from guessing your password or using it if they do somehow get a hold of your password.<br />
<br />
How NOT to change your Magento admin path<br />
Tucked in the "admin" section of the system configuration, the "Admin Base URL" setting looks like it offers the ability to set a custom admin URL and choose whether to use that custom URL or not. But BEWARE: this setting will break Magento by preventing you from accessing the admin panel (I've tested this and found this to be true as of Magento 1.4.0.1 and earlier).<br />
<br />
<img alt="Magento Web Configuration Screenshot" height="139" src="http://addoa.com/files/blog/magento-security/admin-base-url.jpg" width="512" /><br />
<br />
BEWARE: Do not use the admin base URL settings; it will break your site.<br />
<br />
How to change your Magento admin path<br />
Although the setting does not work, there is an easy way to change your Magento admin path.<br />
<br />
Locate /app/etc/local.xml<br />
Find <![CDATA[admin]]> and replace 'admin' with the path you would like to use<br />
<br />
So if your local.xml file says <![CDATA[drawbridge]]>, your admin path will be /drawbridge.<br />
<br />
5. Close email loopholes<br />
<br />
Magento has a really convenient feature that allows administrators to reset their password if forgotten. In order to reset your password, you need to know the email account associated with the account. Then you need access to that email account to retrieve the new password. First, choose an email address that is not publicly known. Second, make sure the password for your email account is secure. Third, make sure that if your email account has a security question that allows you to reset your password, you choose a question and answer that is so obscure that it would be impossible to guess.<br />
<br />
6. Use secure FTP<br />
<br />
Guessing or intercepting FTP passwords is probably one of the number one ways sites get "hacked." In order to prevent unauthorized access to your sites FTP, use secure passwords and use SFTP (SSH File Transfer Protocol) or FTP-SSL (Explicit AUTH TLS). With SFTP, you can use Public Key Authentication to increase security even more by requiring a private key file and an optional de-encryption password to authenticate the FTP access.<br />
<br />
7. Limit unsecured FTP access<br />
<br />
If you do have to connect through regular (non-secure) FTP for some accounts (i.e. to upload photos), limit access for these accounts to a narrow set of directories. You can then use .htaccess and httpd.conf files to prevent scripts from running in these directories that can change other files and directories on the server that should not not be accessible through that FTP account.<br />
<br />
If you have access to the httpd.conf file on your server, this is the best method to preventing scripts from running in a specific directory. Place this code in your httpd.conf file:<br />
<br />
<span style="color: #b45f06;"><directory path-to-directory-you-want-to-restrict=""></span><br />
<span style="color: #b45f06;"></span> <span style="color: #b45f06;">AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi</span><br />
<span style="color: #b45f06;"> Options -ExecCGI</span><br />
<span style="color: #b45f06;"></directory> </span><br />
<br />
If you don't have access to httpd.conf, you'll have to use.htaccess. Include the following code in the .htaccess file of the directory you want to restrict:<br />
<br />
<div style="color: #b45f06;">AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi</div><div style="color: #b45f06;">Options -ExecCGI</div><br />
Because .htaccess does not support the <directory> tags, the .htaccess file must be placed in the directory you want to effect. Because of this, you need to set the permissions of the .htaccess file to 444 (read-only) to prevent modifications to the .htaccess file. You may also want to chown the file so the permissions cannot be changed. This method isn't fool-proof, but it's a good start to preventing naughty scripts from wreaking havoc.<br />
</directory><br />
<directory>Important: placing this code in a directory's .htaccess file will prevent scripts from running in that directory and all sub-directories.<br />
<br />
8. Don't save passwords on your computer<br />
</directory><br />
<directory>Most modern computers and browsers offer the option to save passwords as a convenience so you don't have to enter your password every time. This is great most of the time, but can be a security problem because often saved passwords can be easily revealed in plain text. Anybody with access to the computer has access to the sensitive data. Even worse, someone could steal the computer and then use the saved passwords to access the sensitive data. To avoid unintended access to your Magento password or data, simply set your computer or browser to never save it— this might be a bit inconvenient, but it's a great security policy.<br />
<br />
9. Keep up-to-date anti-virus software<br />
</directory><br />
<directory>Computer viruses and trojans can steal your data and log your key strokes. To minimize the risk of this happening, be sure to invest in reputable anti-virus software. Free anti-virus software like AVG may be great for home and personal use, but if you want indemnification or a warranty, you may want to look at commercial anti-virus software.<br />
<br />
10. Restrict admin access to only approved IP addresses<br />
</directory><br />
<directory>You can use .htaccess to limit access to your admin area. In the .htaccess file for your admin directory, place the following code in order to block access to all IP addresses except those specifically listed:<br />
<br />
<span style="color: #b45f06;">AuthName "Protected Area"</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> AuthType Basic</span><limit get="" post=""><br style="color: #b45f06;" /><span style="color: #b45f06;"> order deny,allow</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> deny from all</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> allow from 11.111.111.11</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> allow from 22.2</span><br />
</limit><span style="color: #b45f06;"></limit></span></directory><br />
<directory><br />
"allow from 11.111.111.11" blocks the specific IP address 11.111.111.11<br />
"allow from 22.2" blocks a range of IP addresses beginning with 22.2<br />
<br />
There is a downside to restricting access based on IP: if you travel a lot you may find this method very inconvenient as you'd have to manually add each new IP address or IP range to the .htaccess file in order to gain access.</directory>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com3tag:blogger.com,1999:blog-7076149793489824489.post-25142094315790976872010-05-21T02:39:00.000-07:002010-05-21T02:39:43.282-07:00How to remove index.php from Magento URLsHi, if you are using Magento and your store urls are looking this way,<br />
http://www.soamjena.com/index.php/flavoured-condoms/moods-for-men.html<br />
<br />
So, you must be looking , how to remove that index.php from the middle, as thats not good for Search Engine Indexing at all. So, here is the trick.<br />
<br />
1. Goto your site root folder and you can find the .htaccess file. Just edit that. Open it on a text editor and find this line, #Rewrite Base /magento/ . Just replace it with Rewrite Base / .<br />
<br />
2. Then goto your Admin Panel and enable the Web Server Rewrites. You can find it at System > Configuration > Web > Search Engine Optimization.<br />
<br />
3. Then goto your Cache Management page ( System > Cache Management) and refresh your Cache and also refresh the Web Redirects.<br />
Thats all. Test at Frontend now..Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-48895800822748110912010-05-20T00:35:00.000-07:002010-05-20T00:36:26.789-07:00Magento-Moving Upselling products from content to right column<code>A simple solution to display upselling products in right column rather than at content part by default. Follow this steps.<b> </b></code><br />
<br />
<code><b>step 1</b>:</code><br />
<br />
<code>go to catalog.xml</code><br />
<br />
Hide this block as<br />
<br />
<!–<block type=”catalog/product_list_upsell” name=”product.info.upsell” as=”upsell_products” template=”catalog/product/list/upsell.phtml”><br />
<action method=”setColumnCount”><columns>4</columns></action><br />
<action method=”setItemLimit”><type>upsell</type><limit>4</limit></action><br />
</block>–><br />
<br />
<b> step 2</b>:<br />
<br />
Add the following code<br />
<br />
<block type=”catalog/product_list_upsell” name=”product.info.upsell” before=”-” template=”catalog/product/list/upsellright.phtml” /><br />
<br />
after this code<br />
<br />
<block type=”catalog/product_list_related” name=”catalog.product.related” before=”-” template=”catalog/product/list/related.phtml”/><br />
<br />
<b> step 3</b>:<br />
<br />
go to catalog/product/view.phtml<br />
<br />
then remove the following line or commend it<br />
<?php echo $this->getChildHtml(‘upsell_products’) ?><br />
like this <?php //echo $this->getChildHtml(‘upsell_products’) ?><br />
<br />
<b> step 4</b>:<br />
<br />
create upsellright.phtml in catalog/product/list folder<br />
and paste the following code fully<br />
<br />
<?php if(count($this->getItemCollection()->getItems())): ?><br />
<div class=”box base-mini mini-related-items”><br />
<div class=”head”><br />
<h4><?php echo $this->__(‘Upselling Products’) ?></h4><br />
</div><br />
<div class=”content”><br />
<br />
<ol><br />
<?php foreach($this->getItems() as $_item): ?><br />
<li<?php if($_item->isComposite() || !$_item->isSaleable()): ?> class=”super-products”<?php endif; ?>><br />
<div class=”product-images”><br />
<a href=”<?php echo $_item->getProductUrl()?>” style=”margin-left:0px;”><img src=”<?php echo $this->helper(‘catalog/image’)->init($_item, ‘thumbnail’)->resize(50) ?>” alt=”<?php echo $this->htmlEscape($_item->getName()) ?>” width=”50″ height=”50″ /></a><br />
</div><br />
<div class=”product-details” style=”margin-left:70px;”><br />
<a href=”<?php echo $_item->getProductUrl() ?>”><?php echo $this->htmlEscape($_item->getName()) ?></a><br />
<?php echo $this->getPriceHtml($_item, true) ?><br />
<?php if ($this->helper(‘wishlist’)->isAllow()) : ?><br />
<a href=”<?php echo $this->getAddToWishlistUrl($_item) ?>” class=”link-cart”><?php echo $this->__(‘Add to Wishlist’) ?></a><br />
<?php endif; ?><br />
</div><br />
</li><br />
<?php endforeach ?><br />
</ol><br />
</div><br />
</div><br />
<?php endif ?>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-3410244178244142552010-05-19T02:22:00.000-07:002010-05-19T02:25:05.302-07:00Analysis & Usage of Collections in MagentoAs a Magento Programmer I am fascinated by the use & simplicity of collection used in Magento. Simplicity, does not really mean being simple (it is rather complex structured) but easy to use. With the help of one of my colleague, I got down to understand how collection really represents the “collection” of data we are actually trying to get from database. Here is what I found drilling down into the Magento’s Core. I may be “not quite right” with the analysis, you can always comment.<br />
<br />
Almost all the collections found inside app/code/codepool/Namespace/Module/Model/Mysql4/model/Collection.php are the child of parent Class Mage_Core_Model_Mysql4_Collection_Abstract. Primary thing done in the class constructor is initializing its resource and Model. If you look into one of the Collection class you can see in its constructor.<br />
<br />
<span style="color: #b45f06;">/**</span><br />
<span style="color: #b45f06;"> * @class Mage_Checkout_Model_Mysql4_Agreement_Collection</span><br />
<span style="color: #b45f06;"> * Initialize resource</span><br />
<span style="color: #b45f06;"> *</span><br />
<span style="color: #b45f06;"> */</span><br />
<span style="color: #b45f06;"> protected function _construct()</span><br />
<span style="color: #b45f06;"> {</span><br />
<span style="color: #b45f06;"> $this->_init('checkout/agreement');</span><br />
<span style="color: #b45f06;"> }</span> <br />
<br />
And this _init function has been implemented in its parent class as<br />
<br />
<span style="color: #b45f06;">/**</span><br />
<span style="color: #b45f06;"> * Standard resource collection initalization</span><br />
<span style="color: #b45f06;"> *</span><br />
<span style="color: #b45f06;"> * @param string $model</span><br />
<span style="color: #b45f06;"> * @return Mage_Core_Model_Mysql4_Collection_Abstract</span><br />
<span style="color: #b45f06;"> */</span><br />
<span style="color: #b45f06;"> protected function _init($model, $resourceModel=null)</span><br />
<span style="color: #b45f06;"> {</span><br />
<span style="color: #b45f06;"> $this->setModel($model);</span><br />
<span style="color: #b45f06;"> if (is_null($resourceModel)) {</span><br />
<span style="color: #b45f06;"> $resourceModel = $model;</span><br />
<span style="color: #b45f06;"> }</span><br />
<span style="color: #b45f06;"> $this->setResourceModel($resourceModel);</span><br />
<span style="color: #b45f06;"> return $this;</span><br />
<span style="color: #b45f06;"> }</span> <br />
<br />
The resource class can be found in app/code/codepool/Namespace/Module/Model/Mysql4/model.php. And this resource class in turn initializes the database table to be used in the Module along with the table’s primary key.<br />
<br />
<span style="color: #b45f06;">class Mage_Checkout_Model_Mysql4_Agreement extends Mage_Core_Model_Mysql4_Abstract</span><br />
<span style="color: #b45f06;"> {</span><br />
<span style="color: #b45f06;"> </span><br />
<span style="color: #b45f06;"> protected function _construct()</span><br />
<span style="color: #b45f06;"> {</span><br />
<span style="color: #b45f06;"> $this->_init('checkout/agreement', 'agreement_id');</span><br />
<span style="color: #b45f06;"> }</span><br />
<span style="color: #b45f06;"> ......</span><br />
<span style="color: #b45f06;"> }</span> <br />
<br />
It is this resource class that actually works out the database connections, read/write adapters and performs transactions. So this is the basic deduction about the link of collection with the database and its tables. But how are those collection formed still remains a mystery, not anymore! In this section of the post I will try to explain how are the collections really formed.<br />
<br />
If I can, “collection” can be defined as collection or array of its resource. And in Magento case, most of the resources are database’s query results. Simply you can visualize “collection” to be array of your model’s resource. If a “query” in Magento returns a collection of all the products then it would mean that the very collection is an array of all the individual product’s object. But one question still remains how will the database query’s result transform into a Magento “collection“. To understand that we need to understand the collection class and its parents.<br />
<br />
The class Structure for Mage_Core_Model_Mysql4_Collection_Abstract is like this.<br />
<br />
Mage_Core_Model_Mysql4_Collection_Abstract<br />
<div style="padding-left: 30px;">|__ Varien_Data_Collection_Db (C)</div><div style="padding-left: 60px;">|__ Varien_Data_Collection (C)</div><div style="padding-left: 90px;">|__ IteratorAggregate (I)</div><div style="padding-left: 90px;">|__ Countable (I)</div><div style="padding-left: 90px;"><br />
</div>You can see that all collection implements two Interfaces IteratorAggregate & Countable.<br />
<br />
IteratorAggregate is predefined in Standard PHP Library that extends Abstract Base Class Traversable. On using this Interface you can then Iterate Through Object using “foreach” construct. Countable returns the size of the Collection Object.<br />
<br />
Among the two Interfaces, IteratorAggregate is particularly important. As you can see in Class Hierarchy both the interfaces are implemented by Varien_Data_Collection concrete class. IteratorAggregate has abstract public method getIterator() which returns the Iterator interface and the concrete Class has to implement the method on its own. It is this Iterator that provides the real iteration functionality.<br />
<br />
So if you look into the Varien_Data_Collection you will find the getIterator() implemented like this.<br />
<br />
<span style="color: #b45f06;">/**</span><br />
<span style="color: #b45f06;"> * @class Varien_Data_Collection</span><br />
<span style="color: #b45f06;"> * Implementation of IteratorAggregate::getIterator()</span><br />
<span style="color: #b45f06;"> */</span><br />
<span style="color: #b45f06;"> public function getIterator()</span><br />
<span style="color: #b45f06;"> {</span><br />
<span style="color: #b45f06;"> $this->load();</span><br />
<span style="color: #b45f06;"> return new ArrayIterator($this->_items);</span><br />
<span style="color: #b45f06;"> }</span> <br />
<br />
As you can see that it first loads the “items” (I will get back to this Items) and instanciates the value to an internal Class ArrayIterator. And the Iterator returned by this function can then be iterated using foreach construct.<br />
<br />
Looks like it is going to be a looonnnnng post, let be summarize what I’ve tried to point out until now. I’ve tried to show the link between the collection class or rather object with the database table and explain the iteration behavior of the collection object. But one question still remains how will the database query’s result transform into a Magento’s “collection“. This is where the “items” explanation need to be done.<br />
<br />
“Items” are actually array if individual object (item) of the collection which represents the array of tuple of the database query result. As you see in the snippet above the ArrayIterator takes $this->_items are parameter. But $this->_items are not populated here on Varien_Data_Collection but rather on is child class Varien_Data_Collection_Db. Here’s the snippet from Varien_Data_Collection_Db.<br />
<br />
<div style="color: #b45f06;">/**<br />
* Load data<br />
* @class Varien_Data_Collection_Db<br />
* @return Varien_Data_Collection_Db<br />
*/<br />
public function load($printQuery = false, $logQuery = false)<br />
{<br />
if ($this->isLoaded()) {<br />
return $this;<br />
}<br />
<br />
$this->_renderFilters()<br />
->_renderOrders()<br />
->_renderLimit();<br />
<br />
$this->printLogQuery($printQuery, $logQuery);<br />
<br />
// Getting Data from DB<br />
$data = $this->getData();<br />
<br />
$this->resetData();<br />
<br />
if (is_array($data)) {<br />
<br />
// Looping on each result row<br />
foreach ($data as $row) {<br />
// Creating Empty "item" Varien_Object's object<br />
$item = $this->getNewEmptyItem();<br />
<br />
if ($this->getIdFieldName()) {<br />
$item->setIdFieldName($this->getIdFieldName());<br />
}<br />
<br />
// Setting Varien_Object's values to that of the row<br />
$item->addData($row);<br />
<br />
/**<br />
* Adding the "item" to the collection @class Varien_Data_Collection<br />
* So while referring to $this->_items @class Varien_Data_Collection it will return array of this "item"<br />
*/<br />
$this->addItem($item);<br />
}<br />
<br />
}<br />
<br />
$this->_setIsLoaded();<br />
$this->_afterLoad();<br />
return $this;<br />
}<br />
<br />
/**<br />
* Get all data array for collection<br />
* @class Varien_Data_Collection_Db<br />
* @return array<br />
*/<br />
public function getData()<br />
{<br />
if ($this->_data === null) {<br />
$this->_renderFilters()<br />
->_renderOrders()<br />
->_renderLimit();<br />
<br />
// Fetching all the row with the Select query set<br />
$this->_data = $this->_fetchAll($this->_select);<br />
$this->_afterLoadData();<br />
}<br />
return $this->_data;<br />
} </div><div style="color: #b45f06;"><br />
<div style="color: black;">You can go through the inline comments I’ve added. This is it, I’ve finally worked out the explanation of structure & creation of Magento’s Collection and its iterative behavior. I’ve tried to show pictorially (below) what I have just described. Confused! Plz comment and of course please do comment if I am wrong, because there are “times” when you try to understand things even though they actually aren’t just like you think. I’d like to quote Paulo :“I see the world in terms of what I would like to see happen, not what actually does”!<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGtExYESbw9Ndz-BcozGWSSM0Q-6D4s3Q3yQt84nCYprTmXzXoYrBHz02zRPpjrZ5iQyDyWW6eDK-rRLFzQGjkxzE_lV_5jnHerv0CmHK7jd0TXpAWZP49DGU97RSLBkt4g3vO30ff6PA/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGtExYESbw9Ndz-BcozGWSSM0Q-6D4s3Q3yQt84nCYprTmXzXoYrBHz02zRPpjrZ5iQyDyWW6eDK-rRLFzQGjkxzE_lV_5jnHerv0CmHK7jd0TXpAWZP49DGU97RSLBkt4g3vO30ff6PA/s400/2.jpg" width="333" /></a></div></div><table><tbody>
<tr><td class="number"><br />
</td><td class="content"><br />
</td><td class="content"><br />
</td><td class="content"><br />
</td></tr>
</tbody></table></div>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-75348514103439283222010-05-18T00:56:00.000-07:002010-05-18T00:56:48.181-07:00How To Setup Conversion Tracking In Magento3rd Party Conversion Tracking<br />
<br />
Magento Commerce has the ability to track eCommerce sale with Google Analytics out of the box (more on that in a future post). Something that a lot of merchants struggle with is how to set up conversion tracking for other tracking software or comparison shopping engines.<br />
<br />
How To<br />
<br />
Here is an easy hack to track conversions for Shopzilla, PriceGrabber and the likes:<br />
<br />
Open the file: app\design\frontend\XXXX\XXXX\template\checkout\success.phtml<br />
<br />
At the end of the file, add the following code, this will create two variables with the order number and the order total:<br />
<br />
<span style="color: #b45f06;">1 <?php</span><br />
<span style="color: #b45f06;">2 //Get Order Number & Order Total</span><br />
<span style="color: #b45f06;">3 $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());</span><br />
<span style="color: #b45f06;">4 $amount = number_format($order->getGrandTotal(),2);</span><br />
<span style="color: #b45f06;">5 ?></span><br />
<br />
After the above code snippet, copy and paste the tracking code from the third party analytics software of comparison shopping engine. Insert the following variable where they suggest placing the order ID and the order total:<br />
<br />
<span style="color: #b45f06;">1 <?php echo $amount; ?> // Order Total</span><br />
<span style="color: #b45f06;">2 <?php echo $this->getOrderId() ?> // Order Number</span><br />
<br />
Here is a code example for the Shopzilla conversion tracking tool:<br />
<br />
<span style="color: #b45f06;">1 <script language="javascript"></span><br />
<span style="color: #b45f06;">2 var mid = 'XXXXX'; // Your Shopzilla Merchant ID</span><br />
<span style="color: #b45f06;">3 var cust_type = '';</span><br />
<span style="color: #b45f06;">4 var order_value = '<?php echo $amount; ?>'; // Order Amount</span><br />
<span style="color: #b45f06;">5 var order_id = '<?php echo $this->getOrderId() ?>'; //Order Number</span><br />
<span style="color: #b45f06;">6 var units_ordered = '';</span><br />
<span style="color: #b45f06;">7 </script></span><br />
<span style="color: #b45f06;">8 <script language="javascript" src="https://www.shopzilla.com/css/roi_tracker.js"></script></span><br />
<span style="color: #b45f06;">9 <script language="JavaScript" src="https://eval.bizrate.com/js/pos_193511.js" type="text/javascript"></script></span>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com2tag:blogger.com,1999:blog-7076149793489824489.post-64444436124571840002010-05-17T02:24:00.000-07:002010-05-17T02:27:53.676-07:00How to Add Video to Products in MagentoAdding a video to a product greatly enhances the online shopping experience. The out-of-the-box Magento package doesn’t support video. This How-To shows just how to do that. We’ll be able to either (1) drop in HTML embed code from sites like YouTube, or (2) use an FLV file that we provide. <br />
<br />
This article assumes you have the jQuery Javascript library installed and have “jQuery.noConflict()”‘ set up. If you don’t have jQuery.noConflict(), then simply replace instances of “jQuery” with “$”. If you don’t have this library, download jQuery here.<br />
<br />
Here’s the sequence of steps we’re going to take:<br />
<ol><li>Create a product attribute for the video code</li>
<li>Assign the newly created attribute to an attribute set</li>
<li>Modify the template files</li>
<li>Obtain and upload a copy of the free JWPlayer</li>
<li>Add video to a product using HTML embed code or using an FLV file</li>
</ol><b>1. Create a product attribute for the video code.</b><br />
<br />
Log in to your Magento Admin Panel. Navigate to Catalog > Attributes > Manage Attributes. Click on the “Add New Attribute” button found close to the top-right hand corner of the screen. The first tab that’s open is the *Properties* tab. You are presented with lots of textboxes and dropdowns. Here’s what to fill them in with :<br />
<br />
<img alt="" class="alignnone" height="200" src="http://redstage.com/magento/blog/article-images/step-1-create-attribute-thumb.jpg" width="92" /><br />
<br />
Attribute Properties<br />
<br />
- Attribute Code: video<br />
- Scope: Global<br />
- Catalog Input Type of Store Owner: Text Area<br />
- Default Value: [leave blank]<br />
- Unique Value: No<br />
- Values Required: No<br />
- Input Validation for Store Owner: None<br />
- Apply To: All Product Types<br />
<br />
Frontend Properties<br />
<br />
- Use in quick search: No<br />
- Use in advanced search: No<br />
- Comparable on Front-end: No<br />
- Use in Layered Navigation: No<br />
- Use in Search Results Layered Navigation: No<br />
- Use for Price Rule Conditions: No<br />
- Position: 0<br />
- Allow HTML-tags on Front-end: Yes<br />
- Visible on Product View Page on Front-end: No<br />
- Used in product listing: No<br />
- Used for sorting in product listing: No<br />
<br />
Then navigate to the *Manage Label / Options* tab. You only have to fill in the “Admin” value, and for this use “<b>Video</b>“. This can be changed later if you need to.<br />
<br />
Click the “Save Attribute” button to save the attribute.<br />
<br />
<b>2. Assign the newly created attribute to an attribute set (likely Default)</b><br />
While still in the Admin Panel, navigate to Catalog > Attributes > Manage Attribute Sets. From the right-hand column, labeled “Unassigned Attributes”, drag our new video attribute to the “General” group found in the middle column.<br />
<br />
Click “Save Attribute Set” button to save the attribute set.<br />
<br />
<b>3. Modify the template files</b><br />
You’ll need to use a text-editor and FTP client.<br />
<br />
<b>3a. video.phtml</b><br />
Create a file with these contents:<br />
<div class="wp_syntax"><div class="code"><pre class="javascript" style="color: #b45f06; font-family: monospace;"><?php
$_product = $this->getProduct();
?>
<?php <span style="font-weight: bold;">if</span>( $video = $_product->getVideo() ){ ?>
<h2>Product Video</h2>
<div <span style="font-weight: bold;">class</span>="products">
<?php <span style="font-weight: bold;">if</span>( file_exists( getcwd() .'/skin/frontend/[your-package]/[your-theme]/videos/'. $video ) ){ ?>
<div id="mediaspace">&nbsp;</div>
<script>
jQuery( document ).ready( <span style="font-weight: bold;">function</span>(){
jQuery.getScript( '<?php echo $this->getSkinUrl('videos/mediaplayer/swfobject.js'); ?>', <span style="font-weight: bold;">function</span>(){
<span style="font-weight: bold;">var</span> so = <span style="font-weight: bold;">new</span> SWFObject('/skin/frontend/[your-package]/[your-theme]/videos/mediaplayer/player.swf','ply','470','320','9','#ffffff');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','<?php echo Mage::getBaseUrl(); ?>/skin/frontend/[your-package]/[your-theme]/videos/<?php echo $video; ?>');
so.<span style="font-weight: bold;">write</span>('mediaspace');
} );
} );
</script>
<?php } <span style="font-weight: bold;">else</span> { ?>
<?php echo $video; ?>
<?php } ?>
</div>
<?php } ?></pre></div></div>And save the file as /app/design/frontend/[your-package]/[your-theme]/template/catalog/product/view/video.phtml<br />
<br />
<b>3b. catalog.xml</b><br />
<br />
Open up /app/design/frontend/[your-package]/[your-theme]/layout/catalog.xml and add this line:<br />
<div class="wp_syntax"><div class="code"><pre class="xml" style="color: #b45f06; font-family: monospace;"><span style="font-weight: bold;"><block</span> type="catalog/product_view" name="product_video" as="product_video" template="catalog/product/view/video.phtml"<span style="font-weight: bold;">/></span></pre></div></div>as a child anywhere inside this node:<br />
<div class="wp_syntax"><div class="code"><pre class="xml" style="color: #b45f06; font-family: monospace;"><span style="font-weight: bold;"><block</span> type="catalog/product_view" name="product.info" template="catalog/product/view.phtml"<span style="font-weight: bold;">></span></pre></div></div><br />
… and save the file.<br />
<br />
<b>3c. catalog/product/view.phtml</b><br />
<br />
Open up /app/design/frontend/[your-package]/[your-theme]/catalog/product/view.phtml and add this line:<br />
<div class="wp_syntax"><div class="code"><pre class="php" style="color: #b45f06; font-family: monospace;"><span style="font-weight: bold;"><?php</span> echo $this->getChildHtml('product_video'); <span style="font-weight: bold;">?></span> </pre><pre class="php" style="color: black; font-family: monospace;">wherever you want the video to appear on the page. Save the file.</pre></div></div><br />
<b>4. Obtain and upload a copy of the free JWPlayer</b><br />
<br />
Download the player<a href="http://www.longtailvideo.com/players/jw-flv-player/" title="JWPlayer"></a><br />
After you download the ZIP file, extract and upload the files using an FTP client to: /skin/frontend/[your-package]/[your-theme]/videos/*<br />
With the FTP client, rename the “mediaplayer-viral” folder to “mediaplayer”<br />
<br />
<b>5. Add video to a product</b><br />
<br />
In the Magento Admin Panel, navigate to Catalog > Manage Products and click on the product you’d like to add video to. You should see a textarea labeled “Video”.<br />
<br />
<b>5a. Use HTML embed code</b><br />
<br />
In the “Video” textarea, simply drop in the HTML code you’ve received (such as from YouTube) and click “Save” to save the product.<br />
<br />
<b>5b. OR use an FLV file</b><br />
<br />
- Upload your FLV file to /skin/frontend/[your-package]/[your-theme]/videos/<br />
<br />
- In the “Video” textarea, specify the filename of the FLV you’ve just uploaded.<br />
<br />
Repeat Step 5 for all of the products you want to add video to.<b> </b><br />
<br />
<b>Congratulations, you’ve added video to your products.</b><br />
<br />
* This method is tested and working for Magento v 1.3.2.4Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com5tag:blogger.com,1999:blog-7076149793489824489.post-36043003319778615632010-05-14T02:15:00.000-07:002010-05-14T02:15:26.990-07:00Magento Admin Grid: how to change number of rowsWe had a request from our client, that we change default number of items in Magento admin grid. Now, this is very simple, when we know how to change it. Below you can see an example which uses magento observer model and event hocking “core_block_abstract_prepare_layout_before”.<br />
<br />
<span id="more-643"></span><img alt="Magento Admin Grid: how to change number of rows" src="http://inchoo.net/wp-content/uploads/2010/03/magento_grid1.jpg" width="620" /><br />
<br />
<strong>First of all, make backup copies of your files.</strong><br />
<br />
<strong>Step 1.</strong><br />
This is example of event hocking, put it in <strong>config.xml</strong><br />
<div> <div> <div><br />
<a href="http://inchoo.net/ecommerce/magento/magento-admin-grid-how-to-change-number-of-rows/#about" target="_blank" title="?"></a></div></div><div> <div><code>01.</code><code><adminhtml></code></div><div><code>02.</code><code> </code><code><events></code></div><div><code>03.</code><code> </code><code><core_block_abstract_prepare_layout_before></code></div><div><code>04.</code><code> </code><code><observers></code></div><div><code>05.</code><code> </code><code><reward></code></div><div><code>06.</code><code> </code><code><</code><code>class</code><code>>grid/observer</</code><code>class</code><code>></code></div><div><code>07.</code><code> </code><code><method>applyLimitToGrid</method></code></div><div><code>08.</code><code> </code><code></reward></code></div><div><code>09.</code><code> </code><code></observers></code></div><div><code>10.</code><code> </code><code></core_block_abstract_prepare_layout_before></code></div><div><code>11.</code></div><div><code>12.</code><code> </code><code></events></code></div><div><code>13.</code><code> </code><code></adminhtml></code></div></div></div><br />
<strong>Step 2.</strong><br />
Create model class observer.php<br />
<div> <div> <div><br />
<a href="http://inchoo.net/ecommerce/magento/magento-admin-grid-how-to-change-number-of-rows/#about" target="_blank" title="?"></a></div></div><div> <div><code>01.</code><code>class</code> <code>Inchoo_Grid_Model_Observer</code></div><div><code>02.</code><code>{</code></div><div><code>03.</code></div><div><code>04.</code><code> </code><code>public</code> <code>function</code> <code>applyLimitToGrid(Varien_Event_Observer </code><code>$observer</code><code>)</code></div><div><code>05.</code><code> </code><code>{</code></div><div><code>06.</code><code> </code><code>$block</code> <code>= </code><code>$observer</code><code>->getEvent()->getBlock();</code></div><div><code>07.</code><code> </code><code>if</code><code>((</code><code>$block</code> <code>instanceof Mage_Adminhtml_Block_Widget_Grid) &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; !(</code><code>$block</code> <code>instanceof Mage_Adminhtml_Block_Dashboard_Grid))</code></div><div><code>08.</code><code> </code><code>$block</code><code>->setDefaultLimit(200);</code></div><div><code>09.</code></div><div><code>10.</code><code> </code><code>}</code></div><div><code>11.</code></div><div><code>12.</code><code>}</code></div></div></div><br />
It would be good that you make your own module and all put in it. I hope that you know how to make magento module.Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-46272860385675650162010-05-13T00:26:00.000-07:002010-05-13T00:26:57.687-07:00Magento Layout / Structural Block How to?1. Layout your Structural Blocks<br />
<br />
When you begin the implementation process, first ask yourself this question: What are the layout needs of my store?<br />
<br />
What this simply means is: “Will my store always have a left column? Or will some pages have a left, main and a right column? Or perhaps some of the pages will just one column?”. These questions are imperative because the variations of page structure will directly determine the number of skeleton templates you will need to create – For instance, if you have a one column and a 3 column layout, you will need to create two skeleton template accordingly. But before we go further, let’s first look at what a skeleton template looks like.<br />
<br />
<span style="color: #b45f06;"><div class="header">getChildHtml('header')?&gt;</div></span><br />
<span style="color: #b45f06;"><div class="middle"></span><br />
<span style="color: #b45f06;"><div class="col-left">getChildHtml('left')?&gt;</div></span><br />
<span style="color: #b45f06;"><div class="col-main">getChildHtml('content')?&gt;</div></span><br />
<span style="color: #b45f06;"></div></span><br />
<span style="color: #b45f06;"><div class="footer">getChildHtml('footer')?&gt;</div></span><br />
<br />
Pretty straight forward. This type of templates are what we call “skeleton templates” because it exists for the purpose of positioning structural blocks within a page. Such templates are located in app/design/frontend/default/default/template/page/, and you can name it anything you want – mycolumns.phtml, 2columns-left.phtml, whatever suits your fancy. “Wait a minute!!! What is all this getChildHtml(”)?> business?” you say. Ok, let’s move along.<br />
<br />
If you examine the method getChildHtml(’header’)?>, you will see that there’s an identifier called “header” being assigned to the area encased by the XHTML<br />
. What getChildHtml does, is it grabs all the content blocks(see step 2 below) that is assigned to “header” via something called a layout (see step 3 below), and places it inside<br />
2. Distribute your Content Blocks (aka Let’s cut up some real meat of the page)<br />
Content blocks are the ones that actually parse your store’s data into visually appealing format using XHTML. Unlike other eCommerce solutions you may be used to, Magento supplies separate content blocks per separate functionalities. What this means is, your col_left.tpl (or whatever else you may be used to working with), no longer contains ALL the XHTML to be shown in the left column but rather, the functionality used in the left column will recruit its own template for use. Let’s take the demo Magento as an example. If you open a category page on your browser, you will see in the right column the following functionalities: mini-cart, compare products, newsletter and community poll. Each of these content blocks comes with its own template file. Because mini-cart is a separate functionality, as is the compare products, newsletter…etc, mini-cart has it’s own template file, compare products has its own template file, and newsletter has its own template file. The XHTMLyou create should be cut up accordingly on per functionality basis.<br />
<br />
3. Let’s recap and comprehend<br />
In this step, let’s take a breather and do a quick recap.<br />
When working in the visual aspect of a store running on Magento, there’re three things you will use to visually parse your store data.<br />
<br />
Structural Blocks<br />
Structural blocks are the visual skeleton of a store page. These blocks exist for the sole reason of creating visual structure. Example structural blocks are header, left column, main column, footer…etc.<br />
<br />
Content Blocks<br />
Content blocks are the blocks that constructs the makeup of a structural block. Each content block represents distinct functionalities such as Mini-cart, mini-wishlist, compare products, newsletter signup…etc, and they comes with it’s own template.<br />
<br />
Layouts<br />
Located in app/design/frontend/your_package/your_theme/layout, layout is the one that puts all the pieces together. When a page loads in your store, the following things happen:<br />
a. The layout first grabs the base skeleton template of the site.<br />
b. It grabs all the content blocks that are assigned to the structural blocks of a page, and loads them.<br />
Basically the layout says “Grab these content blocks and nest them inside these structural blocks.” The layout can be updated on a per page basis, so you can conveniently change the functionalities being loaded into each page of you store with just one file.<br />
<br />
This is the absolute quick idea of how the templates work in Magento. We’re working on a full documentation and it will be released with the stable version of Magento. In the mean time, the best thing to do is read through the threads of the forum, stay active in the community and ask a lot of questions! I hope this reply gave you some understanding of how things work in Magento.Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-49353959465545390122010-05-12T05:18:00.000-07:002010-05-12T05:18:40.410-07:00Quick script to batch create Magento categoriesA site we administer with a reasonable amount of SKUs (far in excess of 100,000), needed some quick category manipulation for a series of new data to be dropped in. The new information had a desired category tree that had to be built up quick, but with over 600 categories to be created, human effort wouldn’t be suitable.<br />
<br />
So, using the Magento category ID export script to help manipulate the CSV – we were able to quickly make a script to batch create our categories.<br />
<br />
First off, create your CSV with 2 columns, the parent ID for the category and the category name – you could easily add more columns for extra options, but it wasn’t necessary for us.<br />
<br />
The CSV file should be something like this:<br />
<br />
<span style="color: #b45f06;">3,subcat</span><br style="color: #b45f06;" /><span style="color: #b45f06;">4,subcat2</span><br style="color: #b45f06;" /><span style="color: #b45f06;">6,subcat3</span><br />
<br />
Then it should be saved in ./var/import/importCats.csv<br />
<br />
Then save the following in ./quickCatCreate.php<br />
<br />
<span style="color: #b45f06;"><?php</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> define('MAGENTO', realpath(dirname(__FILE__)));</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> require_once MAGENTO . '/app/Mage.php';</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> umask(0);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $count = 0;</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $file = fopen('./var/import/importCats.csv', 'r');</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> while (($line = fgetcsv($file)) !== FALSE) { $count++;</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> //$line is an array of the csv elements</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if (!empty($line[0]) && !empty($line[1])) { </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['path'] = $line[0];</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['name'] = $line[1];</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['meta_title'] = "";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['meta_description'] = "";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['is_active'] = "";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['url_key'] = "";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['display_mode'] = "PRODUCTS";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['general']['is_anchor'] = 0;</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $data['category']['parent'] = $line[0]; // 3 top level</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $storeId = 0;</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> createCategory($data,$storeId);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> sleep(0.5);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> unset($data);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> } </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> function createCategory($data,$storeId) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> echo "Starting {$data['general']['name']} [{$data['category']['parent']}] ...";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category = Mage::getModel('catalog/category');</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->setStoreId($storeId);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> # Fix must be applied to run script</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> #http://www.magentocommerce.com/boards/appserv/main.php/viewreply/157328/</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if (is_array($data)) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->addData($data['general']);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if (!$category->getId()) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $parentId = $data['category']['parent'];</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if (!$parentId) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if ($storeId) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $parentId = Mage::app()->getStore($storeId)->getRootCategoryId();</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> else {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $parentId = Mage_Catalog_Model_Category::TREE_ROOT_ID;</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $parentCategory = Mage::getModel('catalog/category')->load($parentId);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->setPath($parentCategory->getPath());</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> /**</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> * Check "Use Default Value" checkboxes values</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> */</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if ($useDefaults = $data['use_default']) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> foreach ($useDefaults as $attributeCode) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->setData($attributeCode, null);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> } </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->setAttributeSetId($category->getDefaultAttributeSetId());</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> if (isset($data['category_products']) &&</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> !$category->getProductsReadonly()) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $products = array();</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> parse_str($data['category_products'], $products);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->setPostedProducts($products);</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> try {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $category->save();</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> echo "Suceeded <br /> ";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> catch (Exception $e){</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> echo "Failed <br />";</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> } </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> </span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span><br />
<br />
Then it is just a matter of visiting the link in your browser to create the categories – customise to your hearts content, any further expansion should be very easy (such as product association etc.)<br />
<br />
Uh oh – I’m getting errors after the first record!<br />
<br />
<span style="color: #b45f06;">Fatal error: Call to a member function getPath() on a non-object in app\code\core\Mage\Catalog\Model\Resource\Eav\Mysql4\Category.php on line 385</span><br />
<br />
There is a small NB though, there is a bug with Magento’s original code that will cause a problem with the above script, a quick fix is outlined here. It is just a matter of commenting out 2 lines to force the variable to be re-set.<br />
<br />
In ./app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category.php line #110<br />
<br />
<span style="color: #b45f06;">protected function _getTree()</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> //if (!$this->_tree) {</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> $this->_tree = Mage::getResourceModel('catalog/category_tree')</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> ->load();</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> //}</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> return $this->_tree;</span><br style="color: #b45f06;" /><span style="color: #b45f06;"> }</span>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-63307614092243857682010-05-11T04:40:00.000-07:002010-05-11T04:40:42.603-07:00Magento - Yahoo Analytics Conversion CodeUnlike other tracking codes, we need to put Yahoo Analytics Conversion code between <HEAD> and </HEAD> tags.<br />
<br />
Yahoo’s Instructions for the following code are:<br />
<br />
<span style="color: #b45f06;">Copy the HTML code below and insert it between the <HEAD> and </HEAD> tags on your site’s conversion page(s). To pass a dynamic revenue value in the tag, you must modify your web pages accordingly.</span><br />
<br />
To add the Yahoo conversion tracking code in the Head tags, we need to look at the checkout layout configuration file:<br />
/app/design/frontend/your_interface/your_theme/layout/checkout.xml<br />
<br />
Find out which page layout it uses when an order is completed.<br />
<br />
i.e.) For one page checkout, look for this code:<br />
<br />
<span style="color: #b45f06;"><checkout_onepage_success></span><br style="color: #b45f06;" /><span style="color: #b45f06;"><reference name="root"></span><br style="color: #b45f06;" /><span style="color: #b45f06;"><action method="setTemplate"><template>page/2columns-right.phtml</template></action></span><br style="color: #b45f06;" /><span style="color: #b45f06;"></reference></span><br />
<br />
You can edit the Head section of ‘2columns-right.phtml’ to add the Yahoo tracking code. But if this template, 2columns-right.phtml is being used for other pages, I would make a copy of it and name it ‘2columns-right-success.phtml’ and add the tracking code there. This way, it will track it only when there is a successful conversion.<br />
<br />
<span style="color: #b45f06;"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>"></span><br style="color: #b45f06;" /><span style="color: #b45f06;"><head></span><br style="color: #b45f06;" /><span style="color: #b45f06;"><?php echo $this->getChildHtml('head') ?><SCRIPT language=”JavaScript” type=”text/javascript”></span><br style="color: #b45f06;" /><span style="color: #b45f06;"><!– Yahoo! Inc.</span><br style="color: #b45f06;" /><span style="color: #b45f06;">window.ysm_customData = new Object();</span><br style="color: #b45f06;" /><span style="color: #b45f06;">window.ysm_customData.conversion = “transId=,currency=,amount=”;</span><br style="color: #b45f06;" /><span style="color: #b45f06;">var ysm_accountid = “—–YAHOO_ACCOUNT_ID—–”;</span><br style="color: #b45f06;" /><span style="color: #b45f06;">document.write(”<SCR” + “IPT language=’JavaScript’ type=’text/javascript’ ”</span><br style="color: #b45f06;" /><span style="color: #b45f06;">+ “SRC=//” + “srv2.wa.marketingsolutions.yahoo.com” + “/script/ScriptServlet” + “?aid=” + ysm_accountid</span><br style="color: #b45f06;" /><span style="color: #b45f06;">+ “></SCR” + “IPT>”);</span><br style="color: #b45f06;" /><span style="color: #b45f06;">// –></span><br style="color: #b45f06;" /><span style="color: #b45f06;"></SCRIPT></span>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-14535497787729488042010-05-04T04:28:00.000-07:002010-05-04T04:28:08.193-07:00How to Import Products into MagentoThere’s a little confusion among some on how to import products into a Magento ecommerce store. I spent some time today researching and trying to find the best method on doing this. The reason for my research is because there was no simple documentation anywhere that I could find on how to import products. Magento actually has built a pretty robust import/export mechanism into the ecommerce cms that has a ton of flexibility to do many things. I’m not going to cover all of those. This is just for those of you who simply just want to import products into their Magento cart.<br />
<br />
Step 1 – Add a new product manually add a new product manually to the catalog, assign it to a category, and fill out all fields that will be necessary to your store. The obvious ones are price, description, quantity etc. It’s important that you fill out all fields that you know you are going to need for all the products you import.<br />
<br />
Step 2 – Export Your Products Now we want to export your product to a .csv file so that we can view the fields that are required to import. Go to System >> Import/Export >> Profiles. Now click on Export All Products then Run Profile. Click on the “Run Profile in Popup” button. Once the export is completed, go to your var/export directory on your Magento install and you will find the .csv file there for you to download.<br />
<br />
Step 3 – Analyze The .CSV File Now if you look at your .csv export file you will see the field names that you need to match up. Now just start filling yours in and creating your csv file ready for import. This step is extremely important. Otherwise Magento cannot match what you are trying to import and the importing will fail. At a most basic level, here are the fields that I imported:<br />
• store<br />
• attribute_set<br />
• type<br />
• sku<br />
• category_ids<br />
• status<br />
• visibility<br />
• tax_class_id<br />
• weight<br />
• price<br />
• name<br />
• description<br />
<br />
Step 4 – Import Your New .CSV File Now go to System >> Import/Export >> Profiles. Now click on Import All Products. Change “Type” under Data Format to CSV/Tab Seperated. Now click on Upload File, and browse for your .csv file and click “Save and Continue Editing”. Now go to “Run Profile” and select your file from the dropdown menu. Click the button underneath to run the import. And whalllah. All your products should now be imported.Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com1tag:blogger.com,1999:blog-7076149793489824489.post-74127249621292141662010-04-27T02:21:00.000-07:002010-04-27T02:21:36.372-07:00Creating Block From the Code in Magento<span class="Apple-style-span" style="color: #333333; font-family: Arial, Helvetica, serif; font-size: 12px; line-height: 16px;"></span><br />
Here are some methods of creating block by code in Magento. This type of code can be used directly in template, not need to create a layout file or add a child node inside already existing layout file. You can use this to echo a different type of block inside already loading block and template.<br />
<span id="more-164"></span><br />
<pre class="brush: php;"></pre><pre class="brush: php;"><span class="Apple-style-span" style="color: #b45f06;">// Directly in the PHTML where you want to show the block
<?php
echo $this->getLayout()->createBlock("module/block")->setTemplate("module/page.phtml")->toHtml();
?>
</span></pre><br />
What we have actually done is just load the layout and create an instance of a block class defined inside its paramerter, then assigned a template to the block and finally echoed as html. Simple! The code above will be equivalent to what we do as following in layout and in template file.<br />
<pre class="brush: xml;"></pre><pre class="brush: xml;"><span class="Apple-style-span" style="color: #b45f06;">// In layout
<block type="module/block" name="module.name" template="module/page.html"/>
</span></pre><pre class="brush: php;"><span class="Apple-style-span" style="color: #b45f06;"><?php
// In parent PHTML
$this->getChildHtml("module.name");
?></span></pre>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-64068481292476524072010-04-26T02:22:00.000-07:002010-04-26T02:22:29.661-07:00How To install Magento In Wamp Server<span class="Apple-style-span" style="font-family: Arial, Verdana, sans-serif; font-size: 12px;"></span><br />
<div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Magento</strong> is an <span class="mw-redirect" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">open-source</span> <span class="mw-redirect" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">ecommerce</span> web application launched on March 31, 2008. It was created by Varien, building on components of the Zend Framework.<span id="more-1783" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></span></div><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Magento is available under the Open Software License version 3.0. Since version 1.1.7 some parts are licensed under the Academic Free License version 3.0.</div><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span class="Apple-style-span" style="line-height: normal;"></span></div><h3 style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: initial; background-image: none; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(215, 215, 215); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-style: none; border-right-style: none; border-top-color: rgb(215, 215, 215); border-top-style: none; border-top-width: 3px; border-width: initial; color: #232323; font-size: 1em; font: normal normal normal 1.7em/normal Georgia, 'Times New Roman', Times, serif; letter-spacing: 0px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 22px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 5px; padding-left: 3px; padding-right: 0px; padding-top: 5px;"><strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">To Download Magento In Wamp, Follow below steps.</strong></h3><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1. Download latest stable version of Magento from http://www.magentocommerce.com/download (Requires free registration), Unzip in www directory and Also create Mysql database and User from your phpmyadmin panel, which can be accessed by http://localhost/phpmyadmin.</div><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">2. Now start installing Magento by http://localhost/magento. If not accessible, please check the folder name of your folder.</div><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">3. Now Installation Wizard will be start, Step 2 is to enter your mysql details. It will take a while as it creates some tables.</div><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">4. Next Step will ask you about Admin login/Pass, So Create your admin/pass and save them.</div><div style="line-height: 19px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Well, thats all. Go Open your store and Enjoy</div>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-63908705355182387292010-04-16T23:12:00.000-07:002010-04-16T23:12:44.319-07:00Magento Commerce 1.4: How To Fix ‘Unable to submit your request. Please, try again later’ on the Contact Us formIf you’ve upgraded your Magento Commerce site to 1.4.x you may have run in to the problem where any attempt to send a response via your ‘Contact Us’ page fails with <br />
“Unable to submit your request. Please try again later”.<br />
<br />
Contact Us Form - Error: Unable to submit your request, please try again later<br />
<br />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeaAEFWgw3oZPrcNZbVPtqXic_nLKEg2YMsJt-lO1bjV14yOtGNR0SyugLTMVuPrD9wMT1BB5bTlVaIO2dE1RvrbEst7flPyhaTVR0ytxbS6iYKveIcGodg6ktGfQrt28vHfeVVLAQ1HE/s320/1.jpg" /><br />
<br />
If you look at the code /app/code/core/Mage/Contacts/controllers/IndexController.php<br />
<br />
<div style="color: #b45f06;">public function postAction()</div><div style="color: #b45f06;"> {</div><div style="color: #b45f06;"> $post = $this->getRequest()->getPost();</div><div style="color: #b45f06;"> if ( $post ) {</div><div style="color: #b45f06;"> $translate = Mage::getSingleton('core/translate');</div><div style="color: #b45f06;"> /* @var $translate Mage_Core_Model_Translate */</div><div style="color: #b45f06;"> $translate->setTranslateInline(false);</div><div style="color: #b45f06;"> try {</div><div style="color: #b45f06;"> $postObject = new Varien_Object();</div><div style="color: #b45f06;"> $postObject->setData($post);</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> $error = false;</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {</div><div style="color: #b45f06;"> $error = true;</div><div style="color: #b45f06;"> }</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {</div><div style="color: #b45f06;"> $error = true;</div><div style="color: #b45f06;"> }</div><div style="color: #b45f06;"> </div><div style="color: #b45f06;"> if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {</div><div style="color: #b45f06;"> $error = true;</div><div style="color: #b45f06;"> }</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {</div><div style="color: #b45f06;"> $error = true;</div><div style="color: #b45f06;"> }</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> if ($error) {</div><div style="color: #b45f06;"> throw new Exception();</div><div style="color: #b45f06;"> }</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> (...snip...)</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> } catch (Exception $e) {</div><div style="color: #b45f06;"> $translate->setTranslateInline(true);</div><div style="color: #b45f06;"><br />
</div><div style="color: #b45f06;"> Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));</div><div style="color: #b45f06;"> $this->_redirect('*/*/');</div><div style="color: #b45f06;"> return;</div><div style="color: #b45f06;"> }</div><br />
The Contact Us form requires the Name, Comment, Email not be empty or NULL. We do expect the “hideit” field to (a) exist and (b) be empty/NULL. The “hideit” field is new in 1.4 and is designed to help prevent spam. Automated bots would complete this field and this is how we can detect bots. It’s best to implement a Captcha system as well on your Contact Us page to further improve your spam protection.<br />
<br />
If any of the above checks fail, the function throws an exception and we get the “Unable to submit your request. Please, try again later” message. The message would be more descriptive if it read “Unable to submit your request, please verify all required fields have been completed”. You can change the message in the locale translation file if you want. This will also future proof you against updates.<br />
<br />
The best thing to do is examine the code on your site. Those site’s I’ve looked at have the following:<br />
<br />
<div style="color: #b45f06;"><div class="button-set"></div><div style="color: #b45f06;"> <p class="required">* Required Fields</p></div><div style="color: #b45f06;"> <button type="submit" class="form-button"><span>Submit</span></button></div><div style="color: #b45f06;"> </div></div><br />
The correct code should be:<br />
<br />
<div style="color: #b45f06;"><div class="buttons-set"></div><div style="color: #b45f06;"> <p class="required">* Required Fields</p></div><div style="color: #b45f06;"> <input type="text" style="display: none ! important;" value="" id="hideit" name="hideit"></div><div style="color: #b45f06;"> <button class="button" title="Submit" type="submit"><span><span>Submit</span></span></button></div><div style="color: #b45f06;"> </div></div><br />
Either something went wrong with the upgrade and the underlying files didn’t get upgraded, or you’re overriding the files within your theme directory.<br />
<br />
The Contact Us form is generated by /app/design/frontend/base/default/template/contacts/form.phtml. The code from a working 1.4.0.1 environment looks like this:<br />
<br />
<div style="color: #b45f06;"><div class="buttons-set"></div><div style="color: #b45f06;"> <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p></div><div style="color: #b45f06;"> <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" /></div><div style="color: #b45f06;"> <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button></div><div style="color: #b45f06;"> </div></div><br />
Remember to backup any files you edit, before editing<br />
<br />
You can choose either to edit the file directly or better yet, replace it with the correct 1.4.0.1 file.Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0tag:blogger.com,1999:blog-7076149793489824489.post-60501970008637522832010-04-15T23:47:00.000-07:002010-04-15T23:47:53.003-07:00Upgrading To Magento 1.4With the recent release of Magento version 1.4, many people are having trouble upgrading their current Magento installation, or installing their template on a fresh Magento 1.4 installation. A quick search online and you’ll find countless entries and posts stating that Magento 1.4 is buggy, not working, horrible, etc. Particularly when you browse through the Magento forums.<br />
<br />
In fact Magento 1.4 is different than the last previous stable version (1.3.2.4) but you should definitely be able to upgrade your installation, or install your custom template on a Magento 1.4 installation! Here are the most common issues and how to fix them!<br />
<br />
<b>Magento modern theme 1.4</b><br />
<br />
This relates to the following issues:<br />
<br />
* Can’t install Modern Theme through Magento Connect<br />
o Get error “magento-core/Interface_Frontend_Default_Modern requires package “magento-core/Mage_Core_Modules” (version >= 1.3.2.2, version <= 1.3.3, excluded versions: 1.3.3), installed version is 1.4.0.0<br />
Install Errors<br />
No valid packages found<br />
PEAR ERROR: install failed<br />
* Can’t upgrade Modern Theme through Magento Connect<br />
o Get similar error as above<br />
* etc<br />
<br />
As of now, there is no good way to install or upgrade the Modern Theme via Magento Connect. BUT you should definitely be able to get it by installing a fresh Magento 1.4 installation.<br />
<br />
Magento 1.4 comes by default with the default theme, the modern theme, and the iphone optimized theme. However, you’d have to install Magento manually and NOT use the downloader (as this will include the default theme only). Here is one way to install Magento 1.4 manually:<br />
<br />
1. Download all the files on your computer and upload them on your server<br />
2. Create a database and a database user and grant that user all permissions to the database. Make sure to write down your database name, database user name, and database user password.<br />
3. Go to the URL that points to your server and follow the instructions to complete Magento installation<br />
<br />
<b>Can’t access admin, blank page, products won’t load, error, etc</b><br />
<br />
Most issues will be resolved once you reindex Magento data and refresh all Magento cache. To reindex Magento data follow these quick steps:<br />
<br />
1. Go to System>Index Management<br />
2. Click on “select all” in the upper left corner<br />
3. Under “Action” select “Reindex Data” and click submit<br />
<br />
To refresh all Magento cache following these quick steps:<br />
<br />
1. Go to System>Configuration and<br />
2. Click on “select all” in the upper left corner<br />
3. Under “action” click on “refresh” and click submit<br />
4. Then click on these buttons:<br />
1. Flush Magento Cache<br />
2. Flush Cache Storage<br />
3. Fluch Catalog Images Cache<br />
4. Flush JavaScript/CSS Cache<br />
<br />
<b>Upgrading your existing theme (modern or else)</b><br />
<br />
Obviously I cannot cover here all the possible problems and issues that may arise when upgrading your particular template to be compatible with Magento 1.4. However, I found that the most common issue is “Categories not working after upgrading to 1.4″. This relates to the error people get when clicking on some categories: “Error processing your request” followed by a number.<br />
<br />
To fix that, you’ll need to do 2 things:<br />
<br />
1. First, edit your toolbar.phtml file located under app/design/frontend/default/yourthemename/template/catalog/product/list. Take the updated toolbar.phtml from the new 1.4 default theme (located under app/design/frontend/base/default/template/catalog/product/list) and use it in your theme. Then edit that file to apply any styling you had in your original toolbar.phtml file. Another way of doing it is editing your toolbar.phml file to use the right class names and code (you can compare with the default one and take it from there).<br />
<br />
2. Second, open catalog.xml located under app/design/frontend/default/yourthemename/layout/ and find this line:<br />
<br />
<block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”><br />
<br />
And underneath insert this code:<br />
<br />
<block type=”page/html_pager” name=”product_list_toolbar_pager”/><br />
<br />
And that should do it!Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com2tag:blogger.com,1999:blog-7076149793489824489.post-22367175950578080242010-04-15T04:16:00.001-07:002010-04-15T04:16:58.512-07:00How to show error description in Magento 1.4<span class="Apple-style-span" style="color: #444444; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 21px;">Simply go to your magento installation folder, locate the errors folder and you will find local.xml.sample, simply duplicate the file and rename it local.xml</span><br />
<span class="Apple-style-span" style="color: #444444; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Helvetica, Arial, sans-serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 21px;"><br />
</span></span>Creative Glance Technologieshttp://www.blogger.com/profile/06682952449499293725noreply@blogger.com0