Posted by Bhupesh on May 3, 2012 in
Uncategorized
$this->addAttribute( Mage_Catalog_Model_Product::ENTITY, 'yes_no_attribute', array(
'group' => 'General',
'type' => 'tinyint',
'backend' => '',
'frontend' => '',
'label' => 'Featured Product?',
'input' => 'boolean',
'source' => 'eav/entity_attribute_source_table',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '',
'searchable' => false,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'visible_in_advanced_search' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => 'simple',
) );
Posted by Bhupesh on Apr 28, 2012 in
git,
magento
app/code/community/Find/
app/code/community/Phoenix/
app/code/core/
app/design/adminhtml/default/default/
app/design/adminhtml/default/find/
app/design/frontend/base/
app/design/frontend/default/blank/
app/design/frontend/default/default/
app/design/frontend/default/iphone/
app/design/frontend/default/modern/
app/design/frontend/enterprise/default/
app/design/install/
app/etc/modules/Enterprise_CatalogEvent.xml
app/etc/modules/Enterprise_CatalogPermissions.xml
app/etc/modules/Enterprise_Checkout.xml
app/etc/modules/Enterprise_Cms.xml
app/etc/modules/Enterprise_Customer.xml
app/etc/modules/Enterprise_CustomerBalance.xml
app/etc/modules/Enterprise_Eav.xml
app/etc/modules/Enterprise_Enterprise.xml
app/etc/modules/Enterprise_GiftCard.xml
app/etc/modules/Enterprise_GiftCardAccount.xml
app/etc/modules/Enterprise_GiftRegistry.xml
app/etc/modules/Enterprise_GiftWrapping.xml
app/etc/modules/Enterprise_ImportExport.xml
app/etc/modules/Enterprise_Invitation.xml
app/etc/modules/Enterprise_License.xml
app/etc/modules/Enterprise_Logging.xml
app/etc/modules/Enterprise_Pci.xml
app/etc/modules/Enterprise_Persistent.xml
app/etc/modules/Enterprise_PromotionPermissions.xml
app/etc/modules/Enterprise_PricePermissions.xml
app/etc/modules/Enterprise_Reminder.xml
app/etc/modules/Enterprise_Rma.xml
app/etc/modules/Enterprise_SalesArchive.xml
app/etc/modules/Enterprise_WebsiteRestriction.xml
app/etc/modules/Find_Feed.xml
app/etc/modules/Mage_All.xml
app/etc/modules/Mage_Api.xml
app/etc/modules/Mage_Authorizenet.xml
app/etc/modules/Mage_Bundle.xml
app/etc/modules/Mage_Centinel.xml
app/etc/modules/Mage_Compiler.xml
app/etc/modules/Mage_Connect.xml
app/etc/modules/Mage_Downloadable.xml
app/etc/modules/Mage_ImportExport.xml
app/etc/modules/Mage_LoadTest.xml
app/etc/modules/Mage_Ogone.xml
app/etc/modules/Mage_PageCache.xml
app/etc/modules/Mage_Persistent.xml
app/etc/modules/Mage_Weee.xml
app/etc/modules/Mage_Widget.xml
app/etc/modules/Mage_XmlConnect.xml
app/etc/modules/Phoenix_Moneybookers.xml
app/etc/config.xml
app/etc/local.xml.additional
app/etc/local.xml.template
app/.htaccess
app/locale/en_US/
app/locale/de_DE/
app/locale/es_ES/
app/locale/fr_FR/
app/locale/nl_NL/
app/Mage.php
cron.php
cron.sh
downloader/
errors/
favicon.ico
get.php
.htaccess.sample
includes/
index.php
index.php.sample
install.php
js/blank.html
js/calendar/
js/extjs/
js/flash/
js/index.php
js/jscolor/
js/lib/
js/mage/
js/prototype/
js/scriptaculous/
js/spacer.gif
js/tiny_mce/
js/varien/
js/enterprise/adminhtml/catalogpermissions-config.js
js/enterprise/adminhtml/catalogpermissions.js
js/enterprise/adminhtml/checkout.js
js/enterprise/adminhtml/cms.js
js/enterprise/adminhtml/rma.js
js/enterprise/adminhtml/staging.js
js/firebug/errorIcon.png
js/firebug/firebug.css
js/firebug/firebug.html
js/firebug/firebug.js
js/firebug/firebugx.js
js/firebug/infoIcon.png
js/firebug/warningIcon.png
lib/3Dsecure/
lib/flex/
lib/googlecheckout/
lib/.htaccess
lib/LinLibertineFont/
lib/Mage/
lib/PEAR/
lib/phpseclib/
lib/Varien/
lib/Zend/
LICENSE_AFL.txt
LICENSE.html
LICENSE.txt
LICENSE_EE.html
LICENSE_EE.txt
mage
media/customer/
media/downloadable/
media/.htaccess
media/import/
media/xmlconnect/
nbproject/
pear
pear/
php.ini.sample
pkginfo/
RELEASE_NOTES.txt
shell/abstract.php
shell/compiler.php
shell/indexer.php
shell/log.php
skin/adminhtml/default/default/
skin/adminhtml/default/enterprise/
skin/frontend/base/
skin/frontend/default/blank/
skin/frontend/default/blue/
skin/frontend/default/default/
skin/frontend/default/french/
skin/frontend/default/german/
skin/frontend/default/iphone/
skin/frontend/default/modern/
skin/frontend/enterprise/default/
skin/install/
var/
Tags: gitignore, magento
Posted by Bhupesh on Apr 22, 2012 in
magento
Today I was setting up Magento with sample data and the default admin wouldn’t let me in the Magento backend. And because I was on windows I was unable to get the email from ‘Forgor your password link’
Here is what I did to unlock the admin user. The file ‘app\code\core\Mage\Adminhtml\IndexController.php’ contains the ‘forgotpasswordAction’ which contains on foreach loop.
Change the foreach loop as below.
foreach ($collection as $item) {
$user = Mage::getModel('admin/user')->load($item->getId());
if ($user->getId()) {
$pass = Mage::helper('core')->getRandomString(7);
$user->setPassword($pass);
$user->save();
$user->setPlainPassword($pass);
$user->sendNewPasswordEmail();
Mage::getSingleton('adminhtml/session')
->addSuccess(Mage::helper('adminhtml')
->__('A new password was sent to your email address. Please check your email and click Back to Login.'));
$email = '';
}
var_dump($pass); // I was able to see the new password on the page
break;
}
Notice the var_dump of the $pass variable, which contains the new password for the admin.
Once I got the new password, next challenge was to unlock the locked admin account. Once again I traced the code and found that Observer in ‘app\code\core\Enterprise\Pci\Model’ contains the check if the account is locked or not in ‘adminAuthenticate’ method. That revealed Magento uses ‘lock_expires’ column in admin_user table to check if account was locked.
So to unlock the account, ran the following query to reset the lock_expires and login failures.
UPDATE admin_user SET failures_num = 0, lock_expires = NULL WHERE user_id = 1
And voila the account was unlocked.
Hope this helps someone.
Posted by Bhupesh on Aug 29, 2011 in
css
Here is the solution I came up with for CSS only ribbon.
Markup is as follow.
<div class='ribbon'>
<h1 class='ribbon-content'>Ribbon</h1>
</div>
CSS as follow.
.ribbon {
background-color: rgb(128,0,0);
background-image: -webkit-gradient(
linear, 0 0, 10% 100%,
from( rgba(255,0,0,1) ),
to(rgba(128,0,0,1)));
background-image: -moz-linear-gradient(
left top -68deg,
#FF0000 -3%,
#800000 46%);
display: inline-block; *display: inline; zoom: 1;
font-family: Arial;
font-size: 16px;
height: 3.125em;
margin: 0 2em 1em 0;
min-width: 150px; *width: auto; *width: 150px;
padding: 0 1.2em;
position: relative;
left: -2em;
}
.ribbon .ribbon-content {
color: white;
font-size: 1em;
font-weight: bold;
height: 100%;
line-height: 3.125em;
margin:0;
text-align: center
}
.ribbon .ribbon-content:before {
content: '';
width: 0;
height: 0;
border-top: solid 1em rgba(200,0,0,1);
border-left: solid 1em transparent;
position: absolute;
top: 3.125em;
left: 0
}
.ribbon .ribbon-content:after {
content: "";
width: 0;
height: 0;
background-color: transparent;
border: solid 1.58em rgb(128,0,0);
border-right: 1.58em solid transparent;
border-left-width: 5px;
display: block;
position: absolute;
right:-1.875em;
top: 0;
margin: 0
}
And here is the result. CSS Only Ribbon demo
Tags: css, css only ribbon, css ribbon, ribbon
Posted by Bhupesh on Oct 15, 2008 in
fedora
While working on different website projects on localhost, I found it very difficult to manage the sites in single document root. Even it requires to remember and type long urls in browser. So I decided to setup virtual servers for each projects, it is very convenient when we, as web developers, have virtual server dedicated to each project we are working on. We don’nt need to remember the long urls for project, the project files dont get messed, we can put those wherever we want even on windows partitions. Hence, we get the improved manageability.
Fedora 9 has apache configuration directory in /etc/httpd. The main configuration file httpd.conf is in conf direcory. Other include files are in conf.d directory. We will configure vhost.conf file in conf.d directory, if this file is not there, create one. I will assume that the project directory named webproj1 is in home directory of user. Copy the following code in vhost.conf file.
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>
DocumentRoot /home/user/webproj1
ServerName webproj1.localhost
DirectoryIndex index.php
<Directory "/home/user/webproj1">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Make sure that the following line in httpd.conf is not commented. It will automatically include and load configurations from our vhost.conf file.
Include conf.d/*.conf
Now restart apache server. Run the following command as root to restart httpd.
/etc/init.d/httpd restart
While restarting httpd, selinux will prevent httpd to access webproj1 folder. To allow access to webpro1 folder, use chcon command as root.
chcon -t httpd_user_content_t webproj1/
Now again restart apache server and the virtual server should be available at 127.0.0.1.
Tags: apache, chcon, fedora, httpd_user_content_t, selinux, virtual host
Posted by Bhupesh on Oct 1, 2008 in
fedora
I have tried a lot more distros counting more than 2 dozen. I never liked any distro as much as opensuse. I was using opensuse since version 10, and kept myself updated until version 10.3. I made decision to change to opensuse 11 when it was released, but for the first time I didnt like the opensuse 11. It never looked as polished as its predecessors. I still don’t know why wireless doesn’t work on my laptop with Intel wireless 3945 chipset. I thought may be some problem with 3945 drivers and tried it on other laptop with broadcom chipset. The situation remains the same. And I didn’t have enough time to figure out the problem and resolve it. So I just switched back to opensuse 10.3 and still distribution remains the same. Impression of KDE and ease of use, flexibility and configurability it provided was way more than gnome.
The story changes when I decided to try fedora 9, despite the fact that I had tried all fedora versions and it never seemed as usable and easy as opensuse, it didnt have many repositories compared to those for opensuse. But this time things were about to change and infact it did. I installed fedora 9, configured livna repository, figured out quickly that /sbin is not included in user environment path. And was able to install Nvidia proprietary drivers with ease. Installing compiz-fusion and make it work was a breeze. Livna has enough packages if not many for normal day to day life computer use and an amazing stability with single feature kept in mind to work. For example, nvidia drivers had worked like charm on opensuse but nvidia-settings. Laptop LCD brightness couldn’t be controlled by software resulting in less efficient powermanager.
Fedora just changed the situation, nvidia-settings worked everytime I wished and LCD brightness is controlled by software
. SELinux is enabled by default making it more secure and yet easy to configure to allow access by providing the command in SELinux denial messages. I always wanted to have latest kernel, not only the security fix but feature updates as well which was a bit difficult in opensuse. Once I tried to update the kernel from KOTD repo but it had a lot of dependancy problem. The fedora 9 provided me kernel update from 2.6.25 to 2.6.26 which again caused me to love it.
It was obvious to me that the motto “Just Works” of fedora 9 was “just working” and it was more polished than my long loved opensuse.
I am still emotionally attached to opensuse and I’ll try opensuse 11.1 when it gets released. But now the view has changed and Fedora has special 15GB space in my laptop 2.5″ SCSI Seagate 120 GB HDD and will remain there for now.
Tags: fedora, gnome, install, linux, opensuse
Posted by Bhupesh on Sep 14, 2008 in
fedora
Fedora 9 codenamed ‘sulphur’ gives an astonishing impression at first sight. New nice and elegant GDM and default GNOME theme WAVES gives a refreshing feel. It continues the feature of changing with the day-light.
Fedora 9 has a very good hardware support, it detected everything except ‘Conexant modem’ which is acceptable as it has commercial driver developed by linuxant.com. But it will need proprietory drivers for nvidia and ati graphics cards. So lets start making it more “USABLE” !!
Add repositories:
Very first repo I add is the livna repo.
execute the following commands and you’ll have working livna repo.
su
Password:
yum install livna-release
More repositories I add are, google and play-on-linux. For google repo just make a text file, say google.repo add the following text to it
[google]
name=Google - i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=1
copy this file to /etc/yum.repos.d/
for playonlinux repo, download the repo configuration rpm from http://www.mulx.net/rpm/playonlinux-yum-3-1.noarch.rpm and install with rpm command as root.
rpm -ivh playonlinux-yum-[version number].noarch.rpm
Next turn for adobe repository. Run the following yum command as root.
yum install adobe-release
Now time to update the whole system. The fedora’s core packages which are bundled on CD/DVD are most likely updated in repository since the initial release. So to be safe just update the fedora system.
yum -y update
Proprietory 3D accelerated drivers for Nvidia and ati:
Time to install proprietory drivers for nvidia. Livna does have proprietory drivers for nvidia but there is an alternative way also by downloading the drivers from nvidia website and installing manually. If you prefer livna’s precompiled drivers just install akmod-nvidia and xorg-x11-drv-nvidia
yum install akmod-nvidia xorg-x11-drv-nvidia
Or go to nVIDIA driver download page and download the binary driver package. http://www.nvidia.com/Download/index.aspx?lang=en-us. To install this driver go to virtual console by pressing CTRL+ALT+F1, login as root and switch to runlevel 3 by executing
/sbin/init 3
Now navigate to nvidia driver’s directory and execute
sh NVIDIA-Linux-x86-177.80-pkg1.run
The nvidia driver installer will take care of the rest after asking some basic questions. Once the drivers are installed, execute
/sbin/init 5
and fedora now should have working nvidia proprietory drivers.
Tags: compiz, fedora 9, install, linux, nvidia
Posted by Bhupesh on Sep 10, 2008 in
Uncategorized
Hi,
This is very first post on my blog powered by wordpress. I hope people will be benefited by sharing of my knowledge and experiences encountered during daily usage of computer and my enthusiasm for opensource.
-Bhupesh