Magento Themes and Magento Extensions

How to create a sub-query on Magento Way?

Share
Posted on May 11th, 2013 | Posted by admin

How to create a sub-query on Magento Way?
You can use the next examples:

public function getActiveCustomers($date)
{
    $orderTable = Mage::getResourceModel('sales/order_collection')
        ->addFieldToFilter('created_at', array('gt' => $date));
    $this->getSelect()
        ->joinLeft(array('order_table' => new Zend_Db_Expr( '(' . $orderTable->getSelect() . ')')),
'e.entity_id = order_table.customer_id')
        ->where('order_table.entity_id', 'notnull');
    return $this;

Create the checkout_cart_product_add_before observer in Magento

Share
Posted on April 14th, 2013 | Posted by admin

For some reason no one can explain, it appears that the event observer checkout_cart_product_add_before never existed in Magento (even though checkout_cart_product_add_after does). Say what?!??

Anyways, it’s fairly easy to go ahead and dispatch this event. Just add this to your module’s config.xml to rewrite the checkout/cart model:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0"?>
<config>
...
<global>
...
<models>
<checkout>
<rewrite>
<cart>Foo_Bar_Model_Checkout_Cart</cart>
</rewrite>
</checkout>
</models>
...
</global>
...
</config>

Then create your model that adds in the dispatch event to trigger the observers:

Create a custom category attribute in Magento

Share
Posted on April 4th, 2013 | Posted by admin

Create a custom category attribute in Magento
Copy and paste the following code in your header.phtml

Create Magento order invoice programmatically

Share
Posted on February 14th, 2013 | Posted by admin

Create Magento order invoice programmatically
Here is a quick and easy way to create order invoice programmatically.

Suppose, $_order contains your order.

Here goes the code to create invoice:-

HOW TO USE MAGENTO CMS FEATURE TO CREATE MULTILINGUAL CONTENT

Share
Posted on December 29th, 2012 | Posted by admin

Magento natively integrates CMSfeatures.

Two types of objects are available to allow you to create content in Magento:

  • Pages, which allow you to display general information such as your terms of sale, contact information, store locations, et cetera.
  • Static blocks ( “static” is not quite the appropriate term as discussed below, it means that the content of these blocks is editable directly from the back-office, without modifying php source code), which allow you to enter information to be usually displayed on several pages, such as footers, headers, but also specific informations (predictive site shut down, promotions
Page 1 of 3123»