PHP related blog, freelancer to hire!

Product review DATE in my account is incorrect (Magento)

Check template/review/customer/list.phtml replace with Noticed in Magento EE 1.11.0.2

Read more

How to access magento search results externally (Drupal, Joomla, Zend Framework, Symfony etc)

Blast Search Lucene module enables you to get superquick results delivered to external application Options are: 1) if applications are on the same server you can simply include Magento code and use module method:   $queryText = ‘stainless’; $storeId = 1; $mageFilename = ‘../path_to_your_magento_document_root/app/Mage.php’; require_once $mageFilename; umask(0);

Read more

Zend Paginator – how to access objects, not data only

If you’re using Zend_Paginator, I’m sure on some point you’ll need to access your object instead of only data.   First of all you need to have your Zend_Db_Table defined with rowchild, for example if your table class is App_Model_Db_Books, add this variable protected $_rowClass = ‘App_Model_Db_Books_Row’;

Read more

How to calculate database size in MySQL using sql query?

SELECT count(*) TABLES, concat(round(sum(table_rows)/1000000,2),’M') rows, concat(round(sum(data_length)/(1024*1024*1024),2),’G') DATA, concat(round(sum(index_length)/(1024*1024*1024),2),’G') idx, concat(round(sum(data_length+index_length)/(1024*1024*1024),2),’G') total_size, round(sum(index_length)/sum(data_length),2) idxfrac FROM information_schema.TABLES WHERE  TABLE_SCHEMA = ‘YOUR DATABASE NAME’;

Read more

How to return all magento product SKUs in one SQL?

Sometimes when you create some cart rules in magento you want to use condition that product SKU “is not one of” you can insert comma separated list of SKUs there to give you just idea look below   connect to your database from CLI or use phpMyAdmin

Read more

Mongo PECL problem after update

If you’re experiencing following error after upgrading mongo from PECL “Exception: pass in an identifying string to get a persistent connection” You can uninstall new one pecl uninstall mongo and install previous pecl install mongo-1.0.10

Read more

FastCGI and PHP Auth (HTTP_AUTH) problem solved

There is a problem with Authorisation headers and php running as FastCGI. To solve it you need to tell FastCGI to pass authorisation headers and then translate it back to PHP So in your vhost file or .htaccess file do: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.+) RewriteRule ^(.*)$

Read more

Send email to CustomerService team from magento

$templateId = 1; # Transactional emails template $mailSubject = ‘your topic’; $sender = Array(‘name’  => Mage::getStoreConfig(‘trans_email/ident_support/name’), ‘email’ => Mage::getStoreConfig(‘trans_email/ident_support/email’)); $vars = Array(‘item’=>’item123′, # your vars ‘order’=>’order123′); $storeId = Mage::app()->getStore()->getId(); $translate  = Mage::getSingleton(‘core/translate’); Mage::getModel(‘core/email_template’) ->setTemplateSubject($mailSubject) ->sendTransactional($templateId, $sender, $sender['email'], $sender['name'], $vars, $storeId); $translate->setTranslateInline(true);

Read more

Magento invoices mysql table located

If you’re looking where Magento stores its invoices, first step was to locate table sales_order_invoice, but such table doesn’t exists. Good starting point is always a Magento API, which shows you a little bit how to digg for information. I’ve located api.xml file responsible for invoices API

Read more

Zend_Test_Client problem with GET parameters in path

Let’s say you want to send REST request to http://test.server.int/articles and your provider requires to send token parameter – but in URL So your final url will be http://test.server.int/articles?token=12345 My client looked like: $rest = new Zend_Rest_Client(‘http://test.server.int’); $rest->restGet(‘/articles?token=123′, array(‘article’ => ‘<xml>YOUR XML</xml>’)); Fatal error: Uncaught exception ‘Zend_Uri_Exception’

Read more
Page 1 of 512345

Latest Posts