Just another WordPress.com weblog

Archive for March, 2012

How to do Mass Deletion of Coupon and Date Changed

Hello

For Mass deletion of Coupon and change the “from” and “to” date in mass
For that we have to copy the app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php into

app/code/local/Mage/Adminhtml/Block/Promo/Quote/grid.php and following functions

protected function _prepareMassaction()
{
$dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$this->setMassactionIdField(‘rule_id’);
$this->getMassactionBlock()->setFormFieldName(‘rule’);

$this->getMassactionBlock()->addItem(‘delete’, array(
‘label’ => Mage::helper(‘rule’)->__(‘Delete’),
‘url’ => $this->getUrl(‘*/*/massDelete’),
‘confirm’ => Mage::helper(‘rule’)->__(‘Are you sure?’)
));

array_unshift($da, array(‘label’=>”, ‘value’=>”));
$this->getMassactionBlock()->addItem(‘date’, array(
‘label’=> Mage::helper(‘salesrule’)->__(‘Change Date’),
‘url’ => $this->getUrl(‘*/*/massDate’, array(‘_current’=>true)),
‘additional’ => array(
‘visibility’ => array(
‘name’ => ‘from_date’,
‘type’ => ‘date’,
‘class’ => ‘required-entry date’,
‘image’ => $this->getSkinUrl(‘images/grid-cal.gif’),
‘format’ => $dateFormatIso,
‘index’ => ‘from_date’,
‘label’ => Mage::helper(‘rule’)->__(‘From Date’)
),
array(
‘name’ => ‘to_date’,
‘type’ => ‘date’,
‘class’ => ‘required-entry date’,
‘format’ => $dateFormatIso,
‘index’ => ‘to_date’,
‘image’ => $this->getSkinUrl(‘images/grid-cal.gif’),
‘label’ => Mage::helper(‘rule’)->__(‘To Date’),
//’values’ => $date
)
)

));

return $this;
}

Clear the Cache from admin Hope this will help

Regards
Sandeep

Advertisements

How to show the Exact searh result in Magento

Hello

If you want to show the exact search reuslt for your products
Two things need to be changed

1) In admin system->configuration->catalog->catlogsearch->Search Type
Make it as Like

2)Just copy the fulltext.php file in local folder as given
app/code/local/Mage/CatalogSearch/Model/Resource/Fulltext.php

and just replace the above code

foreach ($words as $word) {
$like[] = $helper->getCILike(‘s.data_index’, $word, array(‘position’ => ‘any’));
}
if ($like) {
$likeCond = ‘(‘ . join(‘ OR ‘, $like) . ‘)’;
}

BY

foreach ($words as $word) {
$like[] = ‘`s`.`data_index` LIKE :likew’ . $likeI;
$bind[‘:likew’] = ‘%’ . $queryText . ‘%’;
}
if ($like) {
$likeCond = ‘(‘ . join(‘ AND ‘, $like) . ‘)’;
}

and clear the cache and reindex the data from admin

Regards
Sandeep

‘Mage not defined’ error in magento

js error Mage.Cookies.path var Mage not defined

To resolve this issues you need to be sure that in head.phtml (app/design/frontend/default/default/template/page/html/head.phtml ) you have
getChildHtml() ?> after getCssJsHtml() ?>.
So it should look like:
getCssJsHtml() ?>
getChildHtml() ?>