How Are You Coming With Working With Magento?

For those of you who have fairly recently started to work with Magento, how has it been learning to work within the Magento file and structure system in terms of modifying/customizing things?

I have recently started working with Magento and I am finding it’s quite a different world and a challenge than working with Joomla and/or Virtuemart -- especially trying to position/reposition things within the various xml and phtml files.

Would be interested in hearing your thoughts and/or tips/tricks for working with Magento.

12 answers

flytrapcare 0.00 $tone September 22, 2009
Public

Tom, I’m struggling with magento in many ways. Templating is one of them. I know how to turn on template path hints, so I can see what PHTML file I need to edit, but I don’t know how they relate to the XML or how I know what variables are available to me in the template. Perhaps you could help me out with that? The only real modification that I’d like to make is to have a categorical navigation bar on the left side of them home page. Right now it’s just displaying those goofy images that come by default.

I don’t mean to hijack the thread, but I’m also really struggling with enabling USPS. Can someone help me out? I have it enabled as far as I can tell on the back end. I definitely have the API account active on the USPS production server because I ran a test script that queries the USPS server and that script works fine. However, I only ever see an error message on the site. See the attached images for reference.
Settings:
http://www.flytrapcare.com/usps_problem1.jpg
And the result on the site:
http://www.flytrapcare.com/usps_problem.jpg

Any ideas?

#2
flytrapcare 0.00 $tone September 22, 2009
Public

Interestingly the USPS shipping just started working all of the sudden. I have no idea why. Perhaps I didn’t refresh the page enough times or something.

I’d still love to get some tips on the best way to add a category list on the left side bar on the home page. Thanks!

#3
Profile photo of tomc 0.00 $tone September 22, 2009
Public

Well, I haven’t messed with the whole Shipping aspect of Magento, yet . . . so I’m afraid I won’t be much help in that respect, yet. As for working within the phtml and xml files -- it is a pain in the neck, for sure. Most of my "success" thus far has been a whole lot of trial-and-error experimentation. (Though I have been enjoying learning as I go).

I got the "Official Magento User Guide," but I have to be honest -- it’s not really much of a "user guide." It’s more of a "look what Magento can do" book with nifty color pictures. There is a Designers Guide available which I’ve found somewhat helpful --> Magento Designer’s Guide

Also, I recently came across an "Unofficial User Guide" called Grow With Magento that was written by a user (not a developer/programmer) that I think I am going to purchase. It seems to be written for the non developer/programmer and covers a wide range of topics that the "Official" User Guide does not. (No, I’m not an affiliate or getting any kind of kick-back for saying this … just telling it as I see it).

Working within the Magento file structure is truly a challenge … but I still like the overall professional feel of a Magento based store. (Be sure to check out the many extensions (especially the free "Community" and "Core" extensions) available via Magento Connect.

#4
flytrapcare 0.00 $tone September 22, 2009
Public

Thanks for the link to the Magento Designer’s Guide. I’ll take a look at that and see if it can help me along in my quest to make a small modification to the front page.

I actually purchased the "Grow With Magento" book and it’s definitely better than either the Official User’s Guide or another one that I downloaded that I can’t remember the name of but that’s basically a compilation of the documentation. I’d recommend the Grow With Magento book.

I’m actually a programmer and I have a decent amount of experience with several CMS’s and a few carts, but I find Magento to be very hard to learn. It’s taking me a lot of time to just figure out the basics. Thankfully I’ve made a lot of progress recently. I have questioned my choice in Magento a few times, but I just can’t seem to walk away from all of the configurability and the very professional presentation of a Magento store. It’s definitely a very nice piece of software, albeit somewhat difficult to manage and learn.

Anything that you’ve learned that might help me along with modifying the front page? Do you know how the xml and phtml files relate and how to know which variables are available in a template and how to pass variables to the template?

#5
Profile photo of tomc 0.00 $tone September 22, 2009
Public

It depends on what it is you want to modify . . . is it a placement issue?, repositioning an element? layout/design?
Depending on what it is you want to accomplish will determine what files you need to work with.

One thing I have found somewhat helpful in my quest for Magento knowledge is utilizing the Magento Knowledgebase (i.e. the search field atop the MagentoCommerce home page. Many times, others have asked a similar question and soimeone has provided an answer (not all the time, but most (so far)).

In the meantime, can you give me your personal review of the "Grow With Magento" ebook? -- strengths? weaknesses? I would very much like to get a first hand perspective and assessment of the book before I shell out money I probably shouldn’t be spending for it.

Look forward to your response.

#6
flytrapcare 0.00 $tone September 22, 2009
Public

Well, all I really want to do is put the list of categories on the left sidebar (I’m using a 3 column layout) on the home page. In the default template, all of the categories are linked to just under the header. I’m just trying to duplicate that menu but instead of in being horizontal across the page, I want them vertical on the left side.

In the "Grow With Magento" eBook, he discusses changing the images on the left and right side of the page that show by default. They’re called callouts and he says they’re defined in an XML file named "catalog.xml". I look there and I see that it’s pointing to the template "callouts/left_col.phtml". I also see that the top menu is controlled by the file "catalog/navigation/top.phtml". Now, when I look in that file, I see the code I want:

PHP Code:

        <h4 class="no-display"><?php echo $this->__('Category Navigation:'?></h4>

        <ul id="nav">

        <?php foreach ($this->getStoreCategories() as $_category): ?>

            <?php echo $this->drawItem($_category?>

        <?php endforeach ?>


Now the problem comes when I try to put this code into the left_col.phtml file. I don’t think it knows what the $this->getStoreCategories() is because when I put the foreach loop into that template, I get the rror:

Code:

Warning: Invalid argument supplied for foreach()  in PATH_TO_MAGENTO/app/design/frontend/default/default/template/callouts/left_col.phtml on line 41

So I guess for me it comes down to figuring out how to make the getStoreCategories() function available in the callouts/left_col.phtml template. Any idea how to do this?

As far as his book goes, I honestly haven’t read it in depth front to back. I basically skimmed it a couple of times and I’ve been using it as a reference when I need to figure out how to do something. It’s served me well in this capacity.

It’s organized in a way that you should be able to start from scratch and he’ll walk you through pretty much all that you need to do to get a site set up the way you want it. Of course, every person’s case is different, so he doesn’t cover everything really (such as what I need to do to add the category links to the left side bar).

#7
flytrapcare 0.00 $tone September 22, 2009
Public

An update. After writing my previous message, I actually started to figure out the structure a bit more of the templates and XML files. The getStoreCategories() funtion I want lives in app/code/core/Mage/Catalog/Block/Navigation.php. So I looked in the app/design/frontend/default/default/template/catalog/navigation directory and sure enough there is a left.phtml file in there that, by looking at the code, appears to print out all of the categories.

So, I changed the app/design/frontend/default/default/layout/catalog.xml file to use that left.phtml template by modifying the XML as so:

Code:

 
       <reference name="left">
            <block type="core/template" name="left.permanent.callout" template="catalog/navigation/left.phtml">
                <action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
                <action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>
                <action method="setLinkUrl"><url>checkout/cart</url></action>
            </block>
        </reference>

But I’m pretty sure that’s not the right way to change the XML because after that change nothing would show on the left sidebar.

#9
flytrapcare 0.00 $tone September 22, 2009
Public

Would any of these resources help? . . . . .

http://www.magentocommerce.com/board…thread/720/P0/

http://www.magentocommerce.com/boards/viewthread/4722/ (see post # 8)

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

That first URL looks very promising. I thought I’d been through all of the posts on the Magento Forums. Obviously not. I’m looking into it now. This should point me in the right direction. Thanks a million!

#10

Please login or Register to Submit Answer

Written By

Comments