Archive

Posts Tagged ‘magento’

Magento Notes — Bulk update of Product tax class

July 26th, 2010

Just as we are ready to go live on one of my client’s web site, we started to test the tax rules just to make sure that taxes would apply properly.  To our surprise, it DIDN’T!

After verifying the tax classes and customer groups, I got lucky by noticing that for some odd reason, all of my products had their tax class set to NONE instead of TAXABLE GOODS, WTF!! Since there were over 3000 products, I figure using the admin page to do a bulk update of the attribute will one way or another just time out.

After some digging, I have found a way to directly modify the tax class field in phpmyadmin, below is the script that I used to make this sweeping change.  Seems to work, but just make sure a backup is done before running this:

UPDATE `catalog_product_entity_int` SET `value` = ‘2′ WHERE `catalog_product_entity_int`.`attribute_id` =81;

Attribute_ID 81 is the tax class flag for the products. Whereas value of 2 indicates “Taxable Goods”, if you want to set as downloadable goods, this is set to “4″

blog posting, magento , ,

Magento Notes - Add gift wrap service at checkout

July 8th, 2010

Searched high and low for a way to add gift-wrap service, and came across an excellent solution on the Magento forum. Here’s the link:

http://www.magentocommerce.com/boards/viewthread/176424/P0/

blog posting, magento, wordpress ,

Magento Notes - Quick way to update pricing for all products

June 10th, 2010

Had a need to increase pricing for ALL products in the Magento store by $5.00, below is the script that I ran directly in phpadmin that takes care of this:

UPDATE catalog_product_entity_decimal val
SET  val.value = (val.value + 5)
where val.attribute_id=’60′

Where 5 is the price increase, so you can adjust that number accordingly.

blog posting , , ,

Magento Notes — Adding Company Name, Address, Phone in Registration Form

August 26th, 2009

This is a simple yet practical fix that, for some reason, Magento never got around to enabling upto Magento Version 1.3.2.3.

Basically by default the Magento registration form only requires you to enter First Name, Last Name, Email and VAT/Tax Number, but that in a real world scenario is not practical and not enough for business owners to follow up on.  Base on looking into the code here: app/design/frontend/default/blue/template/customer/form/register.phtml, we know Magento has every intention of adding additional fields, just they haven’t been enabled.

By following the fix here, you can reveal the additional fields. Essentially you just have to comment out a IF-Then statement to reveal the proper form fields. Below is the result:

blog posting, magento, technical notes , , , ,

Tickon.com for Sale

July 28th, 2009

We are selling our e-commerce web site: www.tickon.com.

Why are we selling? Becuase we have more projects to work on, and we simply don’t have time to operate the business side of the e-commerce site, and that includes marketing the site, fulfilling orders, finding new products, and most importantly — providing excellent customer service.

How much are you selling for? Make your best offer and we will consider every bid.  We just want the site to be in good hands; someone willing to put in the effort to market the site.

What’s included? We will include the domain name, help you move to your desired web hosting company? or we will host it for you for a small monthly fee. You will also have the code (the site runs on Magento 1.2.1), and the existing database, and you will be hooked up with the product supplier for future order fulfilment (they are a great supplier to work with!!).

For more information email me at jerry at casualcommerce dot com

blog posting, e-commerce, magento , , ,

Performance tuning for Magento

June 26th, 2009

For the most part, I have used WAMP on Windows XP for development and used Simple Helix for magento hosting; they really do make Magento run fast on their server.

Recently working on a project in which the client wants to host the web site themselves, but by default, the LAMP implementation is totally not optimized for Magento.

Did some research and came across this post filled with performance tuning tips..althought i haven’t tried them, but I believe the tips are worth a try if you are hosting your own magento installation.

http://www.magentocommerce.com/boards/viewthread/36225/

blog posting ,

Problem with Magento not able to download/install extensions

June 24th, 2009

Not sure if it’s just me.  But for every Magento development done, whenever I upload my code to the production server, the code would run fine, but when it comes to installing extensions using Magento Connect, it would never properly install the extensions (even though it claims that it has successfully installed the ext.).

The problem appears to be an issue with the “Downloader” folder not being writeable in the production environment; this makes perfect sense from security perspective, but there just needs to be better documentation on how to best setup the site so that Magento Connect works as advertised.

I googled and came across the following post: https://www.gigapros.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=164, the long and short of is is simply to make Magento fully writeable (777) when you run the Magento Connect, and then reset the permissions after the extension has been installed….it’s a somewhat satisfactory workaround i guess.

Here’s how to do this thru your SSH client. Log in to your SSH account and then execute the following commands:

1. cd <your_magento_folder_path>
2. find . -type d -exec chmod 777 {} \;
3. chmod 666 downloader/config.ini

You should now be able to access the Magento Connect Manager. When you have finished the installation/upgrade, you should reset the permissions by executing the following SSH commands:

1. find . -type d -exec chmod 755 {} \;
2. find . -type f -exec chmod 644 {} \;
3. chmod o+w var media app/etc/use_cache.ser

blog posting , , ,

Magento Notes — Default sorting is not logical

May 19th, 2009

Now that I have my e-commerce site, tickon.com, running for a while (3-months), I am back at it adding more products to link to my affiliate partners (this is a new experiment on this web site).

As I started to add new products, I noticed that newest items are added to the last page of the category that it was assigned to…not a very smart implementatio in my opinon. Did some googling and found a fix here:

http://www.magentocommerce.com/boards/viewthread/1176/

Essentially what needs to be done is to fix the file: app/code/core/Mage/Catalog/Block/Product/List/toolbar.php

near line 47, I changed the original code to the following:

$this->_availableOrder = array(
‘entity_id’ => $this->__(’Newest’),
‘name’      => $this->__(’Name’),
‘price’     => $this->__(’Price’)
);

The first item listed will be the default sort filter, the default was “best value”…which didn’t make a lot of sense to me.

Second item to fix up is in the same file, but you go to line 108 (approx.) and modify the highlighted part as below:

public function getCurrentDirection()
{
if ($dir = (string) $this->getRequest()->getParam($this->getDirectionVarName())) {
$dir = strtolower($dir);
if (in_array($dir, array(’asc’, ‘desc’))) {
return $dir;
}
}
return ‘desc‘;

default is asc, but you need to change it to descending so that it sorts from newest id first.

blog posting, e-commerce, magento, technical notes , ,

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 ,