Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento product url
 
rambi31
Jr. Member
 
Total Posts:  7
Joined:  2013-04-23
 

Hellow guys.

I have only one basic question here related to problem I’m unfamiliar in Magento with.
Where to put the example code in to test it or any PHP code I like to test or use?
I can’t find any tip nor any guidance :

<?php
$category_id 
10;
$detail_category Mage::getModel('catalog/category')->load$category_id ); 
echo 
$detail_category->getUrlPath(); 
?>
Should I use data block or *.phtml template file?
Where is the best place to start and put and test PHP code snippets and methods?
Any short and exact answer will be very helpful.
 
Magento Community Magento Community
Magento Community
Magento Community
 
hoanglan87
Jr. Member
 
Total Posts:  19
Joined:  2011-08-23
 

Create a test.php under your magento directory:

<?php
define
('PATH_TO_MAGENTO'$_SERVER['DOCUMENT_ROOT']); 
require_once 
PATH_TO_MAGENTO.'/app/Mage.php';
Mage::app()->setCurrentStore(0);
Mage::setIsDeveloperMode(true);
error_reporting(E_ALL);

Then put your code and run it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rambi31
Jr. Member
 
Total Posts:  7
Joined:  2013-04-23
 
hoanglan87 - 28 July 2013 05:21 PM

Create a test.php under your magento directory:

<?php
define
('PATH_TO_MAGENTO'$_SERVER['DOCUMENT_ROOT']); 
require_once 
PATH_TO_MAGENTO.'/app/Mage.php';
Mage::app()->setCurrentStore(0);
Mage::setIsDeveloperMode(true);
error_reporting(E_ALL);

Then put your code and run it.

Big thanks mate for support! Everything now is clean and works perfectly.
I was confused where to start with whole stuff.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top