$stores = Mage::getModel('core/store')->getCollection();
foreach( $stores as $store ){
$url = Mage::getModel('core/url') ->setStore($store)->getUrl('');
echo $url."\n";
}
About Magento, Linux, Jquery, PHP ... and other!
$stores = Mage::getModel('core/store')->getCollection();
foreach( $stores as $store ){
$url = Mage::getModel('core/url') ->setStore($store)->getUrl('');
echo $url."\n";
}
SELECT entity_id, count( * )
FROM catalog_category_flat_store_x
GROUP BY entity_id
ORDER BY count( * ) DESC
LIMIT 0 , 30
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>
$filter = Mage::getModel('core/email_template_filter');
$vars = array( 'value'=>'toto');
$filter->setVariables( $vars );
$filterdResult = $filter->filter( ' Text Text Text Text Text {{var value}} Text Text Text Text ' );
Redirect 301 /oldpage.html http://www.yoursite.com/redirectpage.html
Redirect 301 /redirectpage2.html http://www.yoursite.com/folder/
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod o+w var var/.htaccess includes includes/config.php app/etc
chmod 550 pear
chmod -R o+w med
<?php getQuote();
$total = $quote->getGrandTotal();
// format total in order to have a user friendly price
$total = $this->helper('checkout')->formatPrice($total); ?>
protected function _sendFile($pdfPath) {
if (! is_file ( $pdfPath ) || ! is_readable ( $pdfPath )) {
throw new Exception ( );
}
$this->getResponse ()
->setHttpResponseCode ( 200 )
->setHeader ( 'Pragma', 'public', true )
->setHeader ( 'Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true )
/* View in browser */
//->setHeader ( 'Content-type', 'application/pdf', true )
/* Download */
->setHeader ( 'Content-type', 'application/force-download' )
->setHeader ( 'Content-Length', filesize($pdfPath) )
->setHeader ('Content-Disposition', 'inline' . '; filename=' . basename($pdfPath) );
$this->getResponse ()->clearBody ();
$this->getResponse ()->sendHeaders ();
readfile ( $pdfPath );
//exit(0);
}
$text = <<<TXT
text here
TXT;
$model = Mage::getModel('checkout/agreement');
$model->setName ();
$model->setContent ( $text );
//$model->setContentHeight ();
$model->setCheckboxText ();
$model->setIsActive (1);
$model->setIsHtml (1);
$model->save();
Mage::helpet('core/url')->getCurrentUrl()
Mage::helpet('core/url')->getHomeUrl()
jQuery(".link-view").toggle(
function () {
// Show treatment
},
function () {
// hidden treatment
}
);