Magento Themes and Magento Extensions

Magento – how to count all products with php – Magento product collection model?

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

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):

  1. require_once ’app/Mage.php’; Mage::run();
  2. echo Mage::getResourceModel(‘catalog/product_collection’)->count(); // count all products
  3. echo Mage::getResourceModel(‘catalog/product_collection’)->addCategoryFilter(Mage::getModel(‘catalog/category’)->load(113))->count();

programatically clear magento cache

Share
Posted on February 3rd, 2013 | Posted by admin

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 ?>

Enable Template Path hints for Admin Panel :Magento

Share
Posted on February 2nd, 2013 | Posted by admin

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);

Codeigniter Multiple File Upload function

Share
Posted on January 29th, 2013 | Posted by admin

in magento An easy function to upload two image by a html form.

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function save_images()
{
$html = '';
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|JPEG|jpeg|PNG|GIF|JPG';
$this->load->library('upload', $config);
$this->upload->initialize($config);
if (!$this->upload->do_upload('pic1'))
{
$html .= $this->upload->display_errors();
$html .='<br />File Not Uploaded';
$upload_data['file_name']='nopic.png';
}
else
{

How to Delete Cache in CS Cart based site

Share
Posted on January 27th, 2013 | Posted by admin

CS cart based site uses a very strong kind of cache mechanism. If you are trying to change the magento theme in order to change the design of the site. Then it might be that  even after selecting a new theme from admin section you wouldn’t find that your new theme is being applied with your current website. This happens due to heavy caching

There are two ways to delete Cache from CS Cart:

Step 1:

Now the question comes How to Delete Cache in CS Cart Site

Just Delete “Cache” folder that available in “Var” folder.

Page 11 of 46« First...«910111213»203040...Last »