Maybe It’s Not For You: iPad Overshadows State of the Union Address

So along comes the Apple iPad, and just behind it – the Wave of Great Hatred and Malice attacking it. For lo, the iPad is an Evil Device, exactly not what geeks, nerds, techies, webheads, etc. wanted.

Claudia's Friends List
Claudia's iPad; her Friends List

Maybe it’s not for you. A lot of people just want to read their e-mail, look at their photos, read a web page, maybe (*gasp!*) –  read a book. What else is there to do? Multitasking is meaningless: most folks don’t read their email and their friends’ Facebook status at the same time.

(Note: I even have my doubts about the photo thing, if the line at the Sam’s Club Photo Kiosk is any indication. Memory Card in, pictures print out. No computer necessary.)

Astounding as it may seem to all the TwittaBlogaMaccaWebosphere Cool Kids, most people’s lives aren’t entirely consumed by The Web and All Technology Attached To It.

There you were, poised to have Steve Jobs hand you the Golden Device of The Ages – only to have him announce he built something for Claudia in Accounting instead.

So stop sulking like jealous, spoiled 5 year olds.

Next week: Claudia becomes a fan of FarmVille; You and 4 others like this.

Conan to Fox? Settlement Pending? Leno Hands Over Show (Not)

1. New York Times is reporting the Conan deal is all but finalized, freeing him (and paying him). Deal will allow Conan to return to the air in September: http://mediadecoder.blogs.nytimes.com/2010/01/17/conan-deal-is-immiment-key-details-all-worked-out/

2. Looks like Fox has gone ahead and purchased the conanonfox.com domain name: http://www.networksolutions.com/whois-search/conanonfox.com

3. Finally – and bestest of all, for your personal video enjoyment, here’s Jay Leno himself handing over the reins of the Tonight Show “Dynasty” to Mr. O’Brien, courtesy of Funny or Die:


Magento Product Create API: use_config_min_sale_qty (and max) attributes

In a site I maintain I have a separate web application for adding products. The reason for this is that products need to be added to both a backend warehousing system as well as magento.

I’m posting this because the documentation on the magento site isn’t clear about how one goes about setting these attributes:

min_sale_qty
use_config_min_sale_qty
use_config_max_sale_qty
use_config_manage_stock

Although these attributes are exported to a csv file via Admin->Profiles, they are not so simply assigned via the API. Here’s the snippet given as an example on magento’s site:

1
2
3
4
5
6
7
8
9
10
11
$newProductData = array(
    'name'              => 'name of product',
    'websites'          => array(1), // array(1,2,3,...)
    'short_description' => 'short description',
    'description'       => 'description',
    'price'             => 12.05
);
 
// Create new product
$proxy->call($sessionId, 'product.create', array('simple', $set['set_id'],
     'sku_of_product', $newProductData));

What I cannot do is set min_sale_qty, use_config_min_sale_qty etc in the $newProductData array – that is, this will not work:

1
2
3
4
5
6
7
8
9
10
11
$newProductData = array(
    'name'              => 'name of product',
    'websites'          => array(1), // array(1,2,3,...)
    'short_description' => 'short description',
    'description'       => 'description',
    'price'             => 12.05,
    'min_sale_qty'            => 1,
    'use_config_min_sale_qty' => 1,
    'use_config_max_sale_qty' => 1,
    'use_config_manage_stock' => 1
);

Rather, these attributes must be set within a double secret probation array called stock_data! I divined this from this page on magento’s forum. I wrote my code like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$stock_data = array (
    'min_sale_qty'          => 1,
    'use_config_min_sale_qty' => 1,
    'use_config_max_sale_qty' => 1,
    'use_config_manage_stock' => 1
);
 
$newProductData = array(
    'name'              => 'name of product',
    'websites'          => array(1), // array(1,2,3,...)
    'short_description' => 'short description',
    'description'       => 'description',
    'price'             => 12.05,
    'stock_data'         => $stock_data
);
 
$proxy->call($sessionId, 'product.create', array('simple', $set['set_id'],
     'sku_of_product', $newProductData));

For the record, I chose to separately declare $stock_data to make the code easier to read and understand. I’m not a big fan of array with array within array etc. Gets too clunky.