Add to cart in magento

addtocart.phtml is located in:

base/default/template/catalog/product/view/addtocart.phtml

Reference site is:

http://www.magentocommerce.com/boards/viewthread/8558/#t31512

http://blog.chapagain.com.np/magento-redirect-functions/

http://stackoverflow.com/questions/4209278/magento-cart-redirects-to-onepage-checkout-how-do-i-make-it-stop

http://webdevster.com/ecommerce/magento/to-redirect-a-newsletter-subscriber-to-a-landing-page-url/comment-page-1

http://blog.omnisubsole.com/2010/07/02/magento-quick-order-form/

http://stackoverflow.com/questions/4366230/add-to-cart-api-in-magento

http://xhtmlandcsshelp.blogspot.com/2011/02/configure-multiple-websites-with.html

currently working;

http://phprelated.myworks.ro/two-add-to-cart-buttons-with-different-redirect-actions-at-once-in-magnto/

http://magentocoder.jigneshpatel.co.in/adding-a-new-page-layout-to-magento/

http://www.exploremagento.com/magento/fix-add-to-cart-redirect-to-homepage-bug.php

 

 

Posted in Uncategorized | Leave a comment

To add a module in magento

Please refer this site:

http://magento4u.wordpress.com/2009/06/08/create-new-module-helloworld-in-magento/

Posted in Uncategorized | Leave a comment

To add a block in magento

If to add a block in magento having an id mess_block(for example)
where to display block please paste it:

echo $headBlock=$this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘mess_block’)->toHtml(); ?>
and
create block in backend having block id mess_block.

Posted in Uncategorized | Leave a comment

To display country name from billing information in checkout

If To display country name from billing information in checkout,
where to display in .phtml file, the following codings please paste it

$cn=Mage::getSingleton(‘checkout/session’)->getQuote()->getBillingAddress()->getCountry();

echo $countryName = Mage::getModel(‘directory/country’)->load($cn)->getName();

Posted in Uncategorized | Leave a comment

To know where the html files are stored in magento and page’s functions are stored

First Admin—>System—>Configuration—->Developer—>Debug—>
In Profiler, select yes.
IN Template Path Hints, select yes,
In Add Block Names to Hints, select yes
and give save config.
Suppose nothing happened, please change,Current Configuration Scope(the left side top)

Posted in Uncategorized, wordpress | Leave a comment

Country Names stored in Magento

The country names stored in magento in xml file.
the location is:
magento/lib/Zend/Locale/Data/supplementalData.xml

Some deduction might be necessary. But do a search for “USA” to get to the relevant section. In my file, it was on line 4590 and from there you deduce the other country codes.

Posted in Uncategorized | Leave a comment

THE COUNTRY iDS IN MAGENTO

please refer this site:
http://php.quicoto.com/magento-country-codes-for-table-rate/

Posted in Uncategorized | Leave a comment

HOW TO ADD COUNTRY/PROVIDENCE/REGION IN MAGENTO

To refer this website:
http://www.sycha.com/magento-add-custom-state-province-region-country
To add this code and changes according to ur task and run it once any php file in magento.
The code is:
define(‘PATH_TO_MAGENTO’, ‘E:\xampp\htdocs\venkat\magento’); // update accordingly
require_once PATH_TO_MAGENTO.’/app/Mage.php’;
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

// your php code here
// set up array containing regions to be added (region_code => region_name)
$new_regions = array(
‘NORTH’ => “North Island”,
‘SOUTH’ => “South Island”,
);

// specify country code for new regions
$country_code = ‘NZ’;

//specify locale//
$locale = ‘en_US’;

// create our core_write conection object
$connection = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);

// iterate our new regions
foreach ($new_regions as $region_code => $region_name) {

// insert region
$sql = “INSERT INTO `directory_country_region` (`region_id`,`country_id`,`code`,`default_name`) VALUES (NULL,?,?,?)”;
$connection->query($sql,array($country_code,$region_code,$region_name));

//get new region id for next query
$region_id = $connection->lastInsertId();

// insert region name
$sql = “INSERT INTO `directory_country_region_name` (`locale`,`region_id`,`name`) VALUES (?,?,?)”;
$connection->query($sql,array($locale,$region_id,$region_name));
}

?>

Posted in Uncategorized | Leave a comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment