Archive

Archive for April, 2009

Relaunch of 52my.info — Chinese classified web site

April 17th, 2009

I would like to announce the relaunch of our fast-growing 52my.info web site.  It is a “chinese-craigslist” for the Chinese community in Southern California.  With a rapid growing user base we will be expanding into other cities soon!

The web site has been completely rewritten with ASP.NET 3.5 & C#, and a lot of ajaxy features have been thrown in to make the user-interface more friendly then what it was before.  So far the feedback has been mostly positive, but we are always gathering new feedback and trying to improve on the site.

If you can read Chinese, please visit the site and provide me with some feedback! Constructive criticisms are welcomed too!!

blog posting, news , ,

Magento Notes — Setting Product Options to ALWAYS Show in Product Info Column

April 13th, 2009

I can’t believe how difficult it is to modify the admin interface so that when you are adding an item, that in the Design menu options, it would default to “Product Info Column” rather than “Block After Info Column”. After hours of searching, I came up with a hack, it’s not the best fix, but it works for my scenario in which I would never set the options to use the “Block After Info Column”. Personally, I think that “block after info column” design is poor usability, so it baffles me what that is even the default.

Anyways, the way I got around to fixing this is to simply remove that option as a possible selection option in the dropdown, so that is left is “Product Info Column”. So if this is something that suits your need, all you would have to do is the following:

Modify config.xml inside: app/code/core/Mage/Catalog/etc, and go to line (approx): 257 and look for the xml block:

<option2 translate=”label”>
<value>container2</value>
<label>Block after Info Column</label>
</option2>

Hope this helps!!

blog posting ,

Magento Notes — How to reference custom product attributes

April 6th, 2009

One thing that I find very useful as I start to seriously customize the product details page for my B2B client is the ability to create custom attributes.  But it took me forever to figure out how to call them from the view.phtml which is the file you are most likely gonna be modifying as well as list.phtml, both located in: app\design\frontend\default\blue\template\catalog\product

If you have created a custom attribute of type dropdown list or other multi-select list, you will reference the attribute using:

<?php echo $_product->getAttributeText(’attribute_code‘) ?>

where the attribute_code is what you have setup in the admin interface when creating this custom attribute. For textboxes and text area data types, you will call these a little differently using:

<?php echo $_product->getAttributeName() ?>

where getAttributeName is a variable of “get” + “attribute_code” where if you have underscores (_) or dashes (-), they are removed, and each word’s first character is capitalized.  So for example, if you have an attribue code called: shirt_size, your call would be:

<?php echo $_product->getShirtSize() ?>

Note that it is case-sensitive.

The link here has additional information on this topic.

magento, technical notes ,

Magento Notes — Adding a mini login to the side bar

April 5th, 2009

Client requested to have a user login (user name and password textboxes) on the side bar for the customers to more easily login to their account and place an order.  This is a b-2-b web site, so users are only able to order after they have successfully logged in. I found a great post on Sibble.com, which details the steps to add the mini login, walking through the suggested procedure it worked for my ver 1.2.1 install using the BLUE theme.

Below is my walkthrough steps:

1) Modify the boxes.css inside: /skin/frontend/default/blue/css/, near line494 add the following line:

.mini-login-form h4 { background-image:url(../images/icon_page_white_text.gif); }

what this does is add a small logo at the top of the mini login form, so that it stays consistent with all the other boxes in the sidebar.

2) Modify the existing mini.login.phtml file to add extra formatting as the default only shows a plain textbox without any formatting. Go to app\design\frontend\default\blue\template\customer\form and open up mini.login.phtml, and change:

<form action=”<?php echo $this->getPostActionUrl() ?>” method=”post”>
<table width=”100%” class=”mini-login”>
<tr><td><?php echo $this->__(’Email’) ?>:</td><td><input name=”login[username]” /></td></tr>
<tr><td><?php echo $this->__(’Password’) ?>:</td><td><input name=”login[password]” /></td></tr>
<tr><td>&nbsp;</td><td><input type=”submit” value=”<?php echo $this->__(’Login’) ?>” /></td></tr>
</table>
</form>

to:

<div class=”box base-mini mini-login-form”>
<div class=”head”>
<h4><?php echo $this->__(’Login’) ?></h4>
</div>
<form action=”<?php echo $this->getPostActionUrl() ?>” method=”post” id=”login-form”>
<div class=”content”>
<ul class=”form-list”>
<li>
<label for=”email”><?php echo $this->__(’Email Address’) ?> <span class=”required”>*</span></label><br />
<input name=”login[username]” value=”<?php echo $this->htmlEscape($this->getUsername()) ?>” title=”<?php echo $this->__(’Email Address’) ?>” id=”email” type=”text” class=”input-text required-entry” style=”width:122px;” />
</li>
<li>
<label for=”pass”><?php echo $this->__(’Password’) ?> <span class=”required”>*</span></label><br />
<input name=”login[password]” type=”password” class=”input-text required-entry validate-password” id=”pass” style=”width:122px;” />
</li>
</ul>
<p class=”required”><?php echo $this->__(’* Required Fields’) ?></p>
</div>
<div class=”actions”>
<button class=”form-button-alt” type=”submit” name=”send” id=”send2″><span><?php echo $this->__(’Login’) ?></span></button>
</div>
</form>
<script type=”text/javascript”>
var dataForm = new VarienForm(’login-form’, true);
</script>
</div>

3) Add mini.login.phtml to the sidbar. Go into: app\design\frontend\default\blue\layout and open up customer.xml. Go to line 76, which should take you to the <customer_logged_out> block, then add:

<remove name=”reorder”></remove>
<reference name=”right”>
<block type=”customer/form_login” name=”mini_login” template=”customer/form/mini.login.phtml” />

underneath <remove name=”reorder”></remove>

From here you should see a mini login in your right sidebar when you are not logged in. This mini sidebar would disappear after you have successfully logged in.

One catch to this is that for some reason now all the page title shows: Customer Login, so this required editing the core file. Open up: app/code/core/Mage/Customer/Block/Form/Login.php and comment out the line that says:

$this->getLayout()->getBlock(’head’)->setTitle(Mage::helper(’customer’)->__(’Customer Login’));

Now it should be functional.

blog posting , ,

Magento 1.3 Release

April 1st, 2009

Came across the news release on Magento’s blog with the release of Magento 1.3 Download here

One of the most coveted feature is now available: Customer Upload of Files.  I can see many uses for this feature, and I will definitely take advantage of this feature in my next project. But I won’t actually touch 1.3 for awhile, or atleast after I hear other people’s feedback on this update.

blog posting, e-commerce, magento, news ,