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:-
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:-
Mage registry key “_singleton/core/resource” already exists : is a very common problem during magento update and due to this issues many time we are getting the erros in the page “There has been an error processing your request” . In my case i found the issue is due to cache so what i did i cleaned my cache every time through index.php of magento .
i found two solution of this problem
Solution One :
Try to add this code in index.php line , this code will delete the cache every time .
Magento – how to count all products with php – Magento product collection model?
You wonder how many products you have in your store and want to count them trough PHP code? It’s easy, add following code to test.php (create in root folder):
programatically clear magento cache
01 |
<?php |
02 |
include $_SERVER['DOCUMENT_ROOT'].'/app/Mage.php'; |
03 |
Mage::app('default'); |
04 |
05 |
/** |
06 |
clear magento cache programatically |
07 |
*/ |
08 |
|
09 |
function clean_magento_cache(){ |
10 |
Mage::app()->getCache()->clean(); |
11 |
//Mage::app()->getCacheInstance()->flush(); |
12 |
//Mage::app()->cleanCache(); |
13 |
} |
14 |
clean_magento_cache(); |
15 |
16 |
?> |
ust run this query in your magento database and u can see path hint in admin side of magento…
INSERT INTO core_config_data (scope, scope_id, path, value)
VALUES (‘default’, 0, ‘dev/debug/template_hints’, 1),
(‘default’, 0, ‘dev/debug/template_hints_blocks’, 1);