Keeping it short. After I got Crackspace to turn on SOAP (yeah I know how, but we pay for these peep to do this for us!) we got some serious NO WORKY.
Mostly 500 errors, occasional 404 (mod_rewrite was dropping page not found error).
Hit the forums, over and over. Some seriously WACKED solutions and things going on. Nothing was working. Until I hit this post:
http://www.magentocommerce.com/boards/viewthread/42062/
In short Magento programmers FAILED hard core. Besides not testing, they are not even using intelligent IDE’s? (meaning my KoMoDo IDE picked up on the error instantly.
About the change, in the file /app/code/core/Mage/Api/Model/Server/Adapter/Soap.php at line 144 (approx) is this original code:
}else {
$this->fault('0', 'Unable to load Soap extension on the server');
return $this;
}
Where a “}” was missing:
else {
$this->fault('0', 'Unable to load Soap extension on the server');
} // <--- This one is missing, line 135
return $this;
}
Ouch.
So, on to getting this stuff working – fast version:
$proxy = new SoapClient('http://YourSite/api/soap/?wsdl');
$sessionId = $proxy->login('apiuser', 'apipassword');
// ****** Gets core info based on Sku
$products = $proxy->call($sessionId, 'catalog_product.info', 'productsku');
var_dump($products);
The above code will return an array / dump of the product info based on sku via a SOAP call.
You will need to get the api user and password as well as the role dialed in on the admin.
Good Luck.
Addendum : Need images, this will dump and array for the sku with image information:
var_dump($proxy->call($sessionId, 'product_media.list', 'productsku'));
Pretty straight forward query to get the core shipping information out of in magento for v 1.4.1 (will not work pre 1.4x tables changed)
select shp.number, shp.title, shp.carrier_code, shp.updated_at, flt.shipping_description from `magento_store`.`sales_flat_order` as flt left join `magento_store`.`sales_flat_shipment_track` as shp on (flt.entity_id = shp.order_id) where flt.increment_id = '$order_id';
I use a WordPress install to interface with the Magento DB to stress server less.
Don’t forget that the 1.4x shipping API for Magento is B-U-S-T-E-D as of this writing. Here is the link I found:
http://magebase.com/magento-tutorials/shipment-api-in-magento-1-4-1-broken/
Short and sweet, if and when I am found to be in error let me know so I can update.
Define the players:
Timeline, crude but true:
We now stop and look at the problem.
The site referencedsite-inmessagebody.com is associated with an ip address that has a PBL listing. In short it could be said that referencedsite-inmessagebody.com sent spam or had mail flagged as spam and made it on the naughty list.
Moving forward with the assumption that referencedsite-inmessagebody.com is not one of the real offenders of spam on the net. We have to ask WTF?
Well, the WTF turns out to be just plain evil wrapped in evil.
I drop a WhoIs on referencedsite-inmessagebody.com and find out they are on a large shared (virtual) host. We all use similar services.
I happen to know this host, I use them. Generally I think the company runs 200+ clients per server.
What follows is a wild summary of the conversation I had with the tech at GoDaddy (he was cool and honest).
Any idiot on a virtual host can start spamming, get busted, loose account and flag the (shared) IP . That means referencedsite-inmessagebody.com is pretty much doomed along with any emails associated to that domain name, regardless of the location of the email server (as far as IP address goes).
Doomed to the point where (the actually broken GoDaddy protocol) is blocking my email because my message body has a “flagged” http address (with associated PBL flagged IP address).
Is there anything to be done – Nope. I asked they guy straight up, should I just move my emails off or is there something we can do such as petitions.
His response was “don’t even try”.
My Solution is to move all these email accounts onto a leased server with dedicated IP address I can get unflagged if ever necessary and run no risk of colliding with “some idiot”.
Ever wonder why certain stuff will NEVER EVER make it from one email to another, this is a clear outline of a protocol that will (often silently) kill your communication.
Emergency Workarounds are available and cumbersome for the low-tech. I suggest instant messaging and file sharing sites. You can create a real time one-to-one connection with your target and provide information to get the data.
File sharing services (of the professional type) are also a good alternative for moving files, but this is not a solution for general text communication over email.
Let’s close out with a list of things you should not do:
And one more important “beware“:
With that in mind email becomes a rather difficult form of communication.
I was taking no responses personally when they were dying or errored out. Going to have to meet people face to face to talk.
OMG.
Right now I am compressing some CSS into a slimmer package. This is only one of a few steps, but this little bit of planning and thought will save a lot of time in the end. Especially when your CSS file is 2000+ lines and already formatted in line to decrease line count.
The original:
#iz_catnav {
background: url(/add/images/left_nav_rpt.png) repeat;
width:185px;
padding:4px 0px 4px 0px;
overflow:hidden;
}
#catNavCap {
height:30px;
width:185px;
background: url(/add/images/left_nav_cap.png) no-repeat;
margin:0px;
padding:0px;
}
#catNavBase {
height:30px;
width:185px;
background: url(/add/images/left_nav_base.png) no-repeat;
}
compacted:
#iz_catnav, #catNavCap, #catNavBase {
background: url(/add/images/left_nav_rpt.png) repeat;
width:185px;
padding:4px 0px;
}
#catNavCap, #catNavBase {
height:30px;
margin:0px;
padding:0px;
}
#catNavCap, #catNavBase {
background: url(/add/images/left_nav_cap.png) no-repeat;
}
#catNavBase {
background: url(/add/images/left_nav_base.png) no-repeat;
}
So, minor gain, a 2 line reduction. From 18 lines to 16 lines. Just over 10% reduction. Think about that on the scale of thousands of lines of CSS. Then compound that with “smart” design and setting up better patterns in your CSS including Object-Orientated CSS where standard attributes are wrapped up in a well defined document.
How many times are you Floating? What if there was compressed style sheet with all your common needs defined in classes. Nice huh? That is the idea behind OO-CSS – more reusable objects (classes).
Need to get the Product categories output for custom scripts (like I am doing). Here is a basic prototype to begin:
// Nevermind - this will not make subcats, the children are all from the main
$obj = new Mage_Catalog_Block_Navigation();
$store_cats = $obj->getStoreCategories();
$current_cat = $obj->getCurrentCategory();
$current_cat = (is_object($current_cat) ? $current_cat->getName() : '');
foreach ($store_cats as $cat) {
echo '1- '.$obj->getCategoryUrl($cat).' 2- '.$cat->getName().' - -';
foreach ($obj->getCurrentChildCategories() as $subcat) {
echo 'A- '.$this->getCategoryUrl($subcat).' B- '.$subcat->getName();
}
}
// author : @marwei / datamafia.com / interzonemultimedia.com
// Check this out! for one level deep cat menu that you can place anywhere
// get your object
$navobj = new Mage_Catalog_Block_Navigation();
$store_cats = $navobj->getStoreCategories();
// open the list
$ret = '<ul id="corpDesMageNav">';
// parent cat loop
foreach ($store_cats as $cat) {
$ret .= '<li>'.$cat->getRequestPath().' - '.$cat->getName().'</li>';
$subcats = $cat->getChildren();
// one deep subcategory
$subCtr = 0; // for counting in the next foreach
$closeUL = false;
// reset the trigger // Child cat / one deep loop
foreach($subcats as $kid){
if ($subCtr==0) { // first itteration opens the (nested) <ul>
$ret .= '<ul style="margin-left:20px;"><!-- Only a helper for the subcat -->';
$closeUL = true;
}
$subCtr++;
$ret .= '<li> [sub cat] '.$kid->getRequestPath().' + '.$kid->getName().'</li>';
}
if ($closeUL == true) { // close the ul based on event trigger
$ret .= '</ul>';
}
}
$ret .= '</ul>';
echo $ret;
Notes on the (revised) above content. Most (but not all???) of the methods from the Class work (Magento reference). The above example provides you with the big pieces of information. The Cat Name and the Cat Link.
More importantly – this method allows you to use the menu system ANYWHERE! You are not working with $this->stuff, instead you are dropping isolated instances. My need arised because we are switching in important legacy information and programs in the middle of Magento. Trust me when I say No ecommerce software was ready for what we are doing.
So I can drop in custom scripting in the content pane using a simple content controller and variable sniffer inside the Magento system and then drop menus and such with out head ache.
The example is FAR from your final output, but this is enough for a programmer with medium skill to get a custom navigation going. My output has some “garbage” in there to help look at the category information. It should only take a minute to clean it up and check Strict.
And, as a friendly reminder, watch your “default category”. Magento (at the time of this post) reads from the top level category, no exceptions. There is plenty of documentation on this topic in the forums.
I hope this helps, let me know if you need more!
/*
ONE FINAL EXAMPLE - 3 levels deep!!!!
If anyone wants to write this into a fully recursive function/class let me know. I only need 3 deep
Adding another nested foreach is easier than a unit test on recursion.
*/
// get your object
$navobj = new Mage_Catalog_Block_Navigation();
$store_cats = $navobj->getStoreCategories();
// open the list
$ret = '<ul id="corpDesMageNav">';
foreach ($store_cats as $cat) {
$ret .= '<li>'.$cat->getRequestPath().' - '.$cat->getName().'</li>';
$subcats = $cat->getChildren();
// one deep subcategory
$subCtr = 0; // for counting in the next foreach
$closeUL = false;
foreach($subcats as $kid){
if ($subCtr==0) { // first itteration opens the (nested) <ul>
$ret .= '<ul>';
$closeUL = true;
}
$subCtr++;
$ret .= '<li style="margin-left:10px;"> [sub cat] '.$kid->getRequestPath().' + '.$kid->getName().'</li>';
// ome more deep - we got children?
$subSubCtr = 0;
$closeSubUL = false;
if($kid->hasChildren()==1){
$subSubCat = $kid->getChildren();
foreach($subSubCat as $grandKid){
if ($subSubCtr==0) { // itteration opens the (nested) <ul>
$ret .= '<ul>';
$closeSubUL = true;
}
$ret .= '<li style="margin-left:20px;"> [sub sub cat] '.$grandKid->getRequestPath().' + '.$grandKid->getName().'</li>';
}
if ($closeSubUL == true) { // close the ul based on event trigger
$ret .= '</ul>';
}
}
}
if ($closeUL == true) { // close the ul based on event trigger
$ret .= '</ul>';
}
}
$ret .= '</ul>';
echo $ret;
Working on some application and I wrote this comment:
include $_SERVER['DOCUMENT_ROOT'].'/######.#####.php'; /* this file includes switching and error handles/ This has to be on the root (or you will need to hire a song and dance man with a one trick pony, a knife, 2 avocados, an icepick, and a pastry blender)
Comments are the programmers legacy. Some people consider the program to be the legacy (Caprica even referenced this idea). The comments are the communication to the piers. The piers need to know where you stand. Sometimes this standing is honesty in stating
/* I know this is a bad way to do things, but the pay was not enough to do this correct. When the database catches on fire tell the boss they should have found another $500 */
More to come, coffee on the way.
The way to make a fair dollar with many apps is simple. You will need scrolling.
This same method is the dividing point between what should be a killer ap on the Droid and what you would expect on the iPhone. The exact app is not important.
Droid: App is free and works great but scrolling is a dog.
iPhone: App is $3.99 and scrolls nice.
Is scrolling worth the $3.99 or $0.99 or however the dev sets it?
Probably.
Yeah, most of the time.
Also, it is no longer an iPhone, Android, Blackberry, or whatever thing. I say this with the anticipation of Adobe Flash in CS5 firing out files for iPhone, and I imagine more to come. Bonus – ECMA 5 was recently finalized.
So imagine one common language, guided by a larger common model, allowing multiple platforms to receive from a single codex.
Hmm, the circuit you run on is much getting less important.
Oh yeah, remember there is JQuery Touch (demo). So the walls are closing in on some ideas, but generally opening up for the masses.
So, that money thing. Free gets the crap scroll.
Paid gets the smooth glide.
My history with Rackspace is growing. New work puts me on a new dedicated server and in direct connection with the “fanatical” support. So my problem was with the .htaccess file and mod_rewrite (Apache) functionality.
After spending the evening looking up “Rackspace htaccess” searches most information comes in relating to the cloud hosting (also referred to as Mosso). Not the same thing. I have reached success and I wanted to put my $0.02 into the blog-o-sphere.
More On This
I am wrapping up the Ableton Denver site and I found myself checking the file extension rather often. Like most programmers, if you do something more than one time you write a function. I wish I could write a function for grocery shopping, any who, here is a tidy snippet for anyone who might need this type of thing:
More On This
Before I drop $100 for a dev account I wanted to outline my need and see if anything comes through the wire.
App Description:
Provide reasonably accurate BPM calculations based on file size, bit depth, and type.
Details:
Example (not real math here) 245.98 kb file in stereo @ 16bit in .wav format = 95.78 bpm.
I am totally aware that this type of math is not totally stable, but preliminary calculations on the files are coming through just fine.
If you know of this app OR want to colaborate on building it contact me (commets are fine!).
Purpose: If you use Ableton you will appreciate this need.