Archive - Magento RSS Feed

Creating a Magento Script that Disables Coupons

As I mentioned in my previous post, I had to quickly find a way to disable a large number of coupons in Magento.

Generally I would say that it would be faster to do this by hand in the admin panel, but I had to disable 62 of them (and I was not sure that the solution would work so I did not want to put all that time into it only to not have it work). Continue Reading…

One Way To Fix Add to Cart Being Slow In Magento

Please Note: This post is more of an anecdotal post as opposed to a tutorial. There are no code samples and the actual code that I discuss may not be 100% accurate as I am typing this at the end of a 12 hour work day. I wanted to get this story out so if there are people out there with a similar problem, they can solve it quickly. If you need more solid code samples or guidance, feel free to comment on this post or email me at jpenn (at) bouncr.com and I will do my best to help you. Continue Reading…

Setting Up Your Magento Scripting Environment

Note: This is of  a series of posts where I share some of my work I do at The Working Person’s Store.

One of the things that I do quite often in Magento is write scripts to accomplish certain tasks. Mostly these tasks involve me updating prices, creating a sale, or fixing a data problem in products. The code base for Magneto is heavily object orienated which makes it incredibly easy to pull in the full power of Magento and use it in outside scripts. Continue Reading…

New Happenings Coming Soon

I have been relatively quiet about my day job in the past. I was unsure if they would have an appreciation for sharing my knowledge and experiences. However, I have discussed my blog with the company I work for and they have given me their blessing to share more knowledge and some source code (with some modifications).
Continue Reading…

Getting and Setting Session Variables in Magento

Working in the Magento ecosystem can seem daunting at first. Even experienced PHP programmers have a steep learning curve to work through before they really get the sense that they know what they are doing.

One thing that is very easy to do in regular PHP programming is setting a session variable. All you really have to do is set the variable in $_SESSION and you are good to go. In Magento, you probably could do it this way, but you would probably get this feeling that you are doing it incorrectly (and you would be correct).

Luckily, setting session variables in Magento is only difficult until you see it once, and then it is just as easy as setting the variable in $_SESSION. As long as you know how to set variables on an object, you can set a session variable. Look at the following code:

Mage::getSingleton(‘customer/session’)->setMyCoolSessionValue(“variable”);

This piece of code sets the session variable my_cool_session_value to the value of “variable”. Getting the value back out, all you have to do is replace “set” with “get” and it will return the value.

Page 1 of 41234»