Skip to content
Yet Another Programmer's Blog

Yet Another Programmer's Blog

PHP, Magento, iOS and more

  • Home
  • Contact
  • Privacy Policy
Magento / PHP

Magento direct SQL INSERT with safe parameters binding

Posted on: February 28, 2015

Maybe someone will find it usefull: $write = Mage::getSingleton(“core/resource”)->getConnection(“core_write”); $query = “insert into mytable ” . “(field1, field2, field3, field4) values ” . “(:field1, :field2, :field3, 12)”; $binds […]

Magento / PHP

Send pdf automatically when invoice is created in Magento

Posted on: January 14, 2015

It is a bit different then method showed in previous post – this time its not transactional email sent at demand, but we will catch event fired after […]

Magento / PHP

Quicktip: How to send PDF invoice via transactional email in Magento?

Posted on: January 13, 2015January 13, 2015

Seems to be complex, but its not that bad: $orderModel = Mage::getModel(‘sales/order’)->load($myOrderId); $invoices = $orderModel->getInvoiceCollection(); $invoicesSet = array(); foreach ($invoices as $_invoice) { array_push($invoicesSet, $_invoice); } $pdf = […]

Magento / PHP

Quick tip: Conditions for addAttributeToFilter in Magento collections

Posted on: May 14, 2014

As probably you know (or maybe not) in Magento you can add your own filters to every collection, basically it looks like: $collection = Mage::getModel(‘catalog/product’)->getCollection(); $collection->addAttributeToFilter(‘myfield’, array(‘eq’ => […]

Magento / PHP

Quick tip: PHP Extensions “0” must be loaded error in Magento install

Posted on: May 8, 2014May 8, 2014

Such error happens in 1.7.x branch (I saw it in 1.7.2), when entering database parameters you’re seeing “PHP Extensions “0” must be loaded” instead of next step. This […]

Magento / PHP

Quicktip: Magento 1.7.0.2 shows Database server does not support InnoDB storage engine

Posted on: May 8, 2014May 8, 2014

During configuration of Magento 1.7.0.2 (in fact whole 1.7.x branch) you may encounter such error: Database server does not support InnoDB storage engine Of course your MySQL server […]

Magento / PHP

Quick tip: Ajax filter is not working in Magento grid?

Posted on: April 5, 2014April 5, 2014

It is a common issue, you added: $this->setUseAjax(true); but filtering just shows ajax spinner and not loading content? Check your grid class ([COMPANY]_[MODULE]_Block_Adminhtml_[CONTROLLER]_Grid extending from Mage_Adminhtml_Block_Widget_Grid) and if […]

Magento / PHP

Quick tip: Redirect to admin product edit at specified tab in Magento

Posted on: April 3, 2014April 5, 2014

It’s quite easy if you know how to do it, if not use this snippet: $this->_redirect(‘adminhtml/catalog_product/edit’, array(‘id’ => $productid, ‘active_tab’ => ‘mytab’)); It works in every controller extending […]

Magento

How to get payment method in Magento?

Posted on: October 20, 2011April 5, 2014

Just call: $payment = $order->getPayment()->getMethodInstance()->getTitle();

Posts pagination

Page 1 Page 2 Next page
  • iOS
  • Mac
  • Magento
  • MySQL
  • PHP
  • Promocje
  • Python
  • Salesforce
  • Uncategorized
  • Wordpress
  • April 2025
  • November 2024
  • October 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • September 2022
  • July 2022
  • September 2021
  • June 2021
  • September 2020
  • May 2020
  • March 2020
  • January 2020
  • December 2019
  • August 2019
  • July 2019
  • June 2019
  • April 2019
  • October 2018
  • August 2018
  • May 2018
  • April 2018
  • November 2017
  • August 2017
  • April 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • June 2013
  • March 2013
  • February 2013
  • November 2012
  • October 2012
  • August 2012
  • July 2012
  • May 2012
  • April 2012
  • February 2012
  • October 2011
  • September 2011
  • August 2011
  • July 2011
Theme Cube Blog by Kantipur Themes
 

Loading Comments...