I’ve always wanted to contribute something in Magento Community and I think today the day has arrived. The module is named as Sirius Blog Helper, just a name, Who cares about the “Name” unless it works
. The basic function of the Module is to list the post made via AW Blog extension, categorized by category identifier of the post, using Layout. Yes, only through layout you can list the post anywhere you want. Not only that you can also restrict the size of the list through layout as well.
Author Archive
Magento Module Release: Uses Layout To List Post, made by AW Blog, on the basis of Category Identifier
Posted on March 16, 2010 by Subesh Pokhrel | No Comments
Creating Product Links in Magento Using Custom Query
Posted on March 12, 2010 by Subesh Pokhrel | No Comments
I’ve already made a post in this blog about Adding Related Product and other links to Product in Magento . But when I used the method to creating links among product’s, while importing very large number of products and creating large number of product links, it took a lot of time and resource. So I thought why not give it a try by direclty creating a link using SQL? And YES! it worked.
Continue reading “Creating Product Links in Magento Using Custom Query” »
Creating Collection of Objects in Magento using a “Magical Class”:Varien_Data_Collection
Posted on March 11, 2010 by Subesh Pokhrel | No Comments
Have you ever wondered how Collection in Magento are built, containing array of individual Entity Objects of Magento? Collections are one of the most important data structure (if I am right) used in Magento. Most of the queries in Magento will result into collection, and then you will apply a foreach loop to access individual Entity Objects and their values. Today I came into a different situation where I had individual objects but needed to create a collection of those objects, so that I could return the collection from a function.
Getting Ordered Items and their Detail from Order ID in Magento
Posted on March 10, 2010 by Subesh Pokhrel | 1 Comment
Here is a small snippet of code, yet useful, to get ordered items and its details. I’ve deviced this code a lot before and posted in Magento Commerce’s Forum as well. But felt like writting it again, so that I can have a quick refrence to it as well. Next thing, I’ve tried a lot to get all orders and their items details by single query, but have not yet come up with a solution. If you have any method of finding order and its details by a single query, then please do response. The code below first needs an order ID as it parameters to give order details.
Continue reading “Getting Ordered Items and their Detail from Order ID in Magento” »
Create and Download XLS Report file using Magento’s Core
Posted on March 2, 2010 by Subesh Pokhrel | No Comments
Reporting can be a very important part of the Module you might be developing for Mageneto. If you are showing your data in Grid that’s good, but it will be better if you add XLS file generation action on that grid, so that the site administrator can see the report in paper. And if you have in paper you can visualize more clearly than on screen.
Continue reading “Create and Download XLS Report file using Magento’s Core” »
Debugging Magento Using Eclipse PDT & Zend Debugger
Posted on January 22, 2010 by Subesh Pokhrel | 9 Comments
I had always thought of using Eclipse to debug Magento’s complex code flow, and tried number of times before. But without any success I had to abandon it, and thought was not applicable for Magento, remember the fox and the sour grapes
I also tried using Trial Version of Zend Studio, but with no sucess.
Continue reading “Debugging Magento Using Eclipse PDT & Zend Debugger” »
Getting Customer’s Info Using Single Query Including Billing and Shipping Addresses
Posted on January 18, 2010 by Subesh Pokhrel | 2 Comments
Query in Magento can be quite troublesome, if you are a starter..or non-starter. So I’ve tried to share some of the difficult queries using collection in Magento, so that it will be helpful to my blog readers and also a place where I can later refer to. Here is one of them, may not be dificult to all, but for me I had a very bad time initially, when I first started on Magento about a year ago. I had always thought to post on my blog, but when one of my collegue asked me about this I remembered and here’s the query.
Getting Configurable Attributes (Super Attributes) of a Configurable Product
Posted on January 14, 2010 by Subesh Pokhrel | 10 Comments
In one of those time when you need to know what attributes of a product is used to make the current configurable product “configurable”, then here it goes
Those configurable attributes are called as “Super Attributes”. Looking into the lower level at the Database level the attributes id are saved in the table “catalog_product_super_attribute”. In this configurable product’s Id and the attribute are saved. To get the attribute’s id you can directly write a custom query and fetch it. But to get its attribute code, attribute level you will then have to create an object attribute using the fetched id. But there is one shot option as well to do the same, in a managed Magento Way!
Continue reading “Getting Configurable Attributes (Super Attributes) of a Configurable Product” »
Creating Custom Sourced Multiselect Product Attribute
Posted on January 13, 2010 by Subesh Pokhrel | 2 Comments
Creating Multiselect type of product attribute whose source will be the Magento’s core tables is pretty simple. Just go to Manage Attributes and create a new one. But if you want the attribute’s source table be a custom table, then you need to think. Some times a case pops up that the store admin wants to save custom type of data for attribute’s option and you need to manage an image according to the attribute’s option. So for each option of the multiselect attribute option there is an image associated with it. In this case one of the method to sort out the things is to create a module that gives you an GUI to save option’s data in custom table and give option to upload the image along with it. Later, use this tables data as source of the attribute for product. The first part, saving the data in custom option is not our concern. You can go through this for doing those. But the main point of this article is to use the custom source as source of the muliselect attributes.
Continue reading “Creating Custom Sourced Multiselect Product Attribute” »
Using Custom Table for Custom Module in Magento
Posted on January 8, 2010 by Subesh Pokhrel | 1 Comment
If you want to create a custom module in Magento that has something to do with storing data into a custom table and using that later, then this is just the right post you have bumped into! I will presume that you already know about Models in Magento, what are they and how you can create them. Also I will presume that you will also know the basic module structure in Magento.
You will have to place this in your config.xml
<global>
<ymodel>
<class>YNamespace_YModule_Model</class>
<resourceModel>quotes_mysql4</resourceModel>
</ymodel>
<quotes_mysql4>
<class>YNamespace_Ymodule_Model_Mymodel</class>
<entities>
<mymodel>
<table>ymodel_ytable</table>
</mymodel>
</entities>
</quotes_mysql4>
</global>
Continue reading “Using Custom Table for Custom Module in Magento” »