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.
Archive for the ‘ PHP ’ Category
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
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” »
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” »
Creating Block From the Code in Magento
Posted on December 25, 2009 by Subesh Pokhrel | No Comments
Here are some methods of creating block by code in Magento. This type of code can be used directly in template, not need to create a layout file or add a child node inside already existing layout file. You can use this to echo a different type of block inside already loading block and template.
Continue reading “Creating Block From the Code in Magento” »
Adding custom options to a product in Magento
Posted on December 22, 2009 by Subesh Pokhrel | 17 Comments
Adding custom option in Magento is pretty easy! You just need to know the format of an array, which is taken by catalog/product_option Model to set the custom option. I’ve deviced a simple function (setCustomOption) that just does that. The function, according to the input type and values assigned creates an array, which is then used by the catalog/product_option Model to save the option to the product.
Continue reading “Adding custom options to a product in Magento” »
Adding Tabs in Product View Page Through Layout In Magento
Posted on December 9, 2009 by Subesh Pokhrel | 1 Comment
One of my new colleague, today asked me how to add tabs in product view page in Magento. He told me earlier he had used his own tabs CSS and Javascript to do, but now he found out that Magento gives default Tab Javascript to do the same. Then, I thought why not share with everyone else! Here it goes…
Continue reading “Adding Tabs in Product View Page Through Layout In Magento” »
Using Custom Query in Magento
Posted on December 8, 2009 by Subesh Pokhrel | No Comments
Magento has given us very good features to manage Models and Collection for interacting with Database tables. Nowonder, they are very helpful in most of the cases. Yet, we may need to write custom query in some cases (if you need it quick or if you are new to Models & Collection in Magento). But by Magento’s standard this is not recommended. If you are a starter you may find this quering to database very helpful. Here is how you can do this.
General Workflow of Magento’s Import/Export – Dataflow
Posted on December 4, 2009 by Subesh Pokhrel | 1 Comment
Magento’s Dataflow (Inport/Export) is one of distinguishing feature that makes Magento the leader in eCommerce Software. But for a programmer to understand how it workes in Magento can be quite nasty. I tried to understand how it workes and came up with following understanding. Continue reading “General Workflow of Magento’s Import/Export – Dataflow” »