Wednesday, November 21, 2012
Magento REMOVE CACHE INVALIDATION ERROR(THOUGH IT'S NOT A BUG ;))
YOU HAVE TO PUT CACHE CLEAR CODE SOME WHERE IN ADMIN PHTML FILE.
i put that code in head.phtml
file:
head.phtml
path:
app/design/adminhtml/default/default/template/page
<?php
try {
Mage::app()->getCacheInstance()->cleanType('block_html');
} catch (Exception $e) {
// do something
error_log($e->getMessage());
}
?>
Friday, September 14, 2012
Pisc Euvat extension error
I was implementing this module https://support.pillwax.com/open-source/doku.php?id=magento:euvat
but got the below mentioned error
Column not found: 1054 Unknown column '_table_taxvat.value' in 'where clause'";i:1;s:7921:"#0
To resolve this i just removed the sql conditions like below in file Grid.php
at path: app/code/local/Pisc/Euvat/Block/Adminhtml/Customer/Invalidstatus
change the below lines
"(_table_taxvat.value IS NOT NULL AND (".$collection->getTable('euvat/vies_cache').".response LIKE '%valid=1;%') AND tax_class_id<>".$config->getTaxClass_EuBusiness()." AND tax_class_id<>".$config->getTaxClass_DefaultCountry().")".
to
"( (".$collection->getTable('euvat/vies_cache').".response LIKE '%valid=1;%') AND tax_class_id<>".$config->getTaxClass_EuBusiness()." AND tax_class_id<>".$config->getTaxClass_DefaultCountry().")".
As u can see i just removed the red colored line "_table_taxvat.value IS NOT NULL AND" , just do the same for all occurance of that line.
but got the below mentioned error
Column not found: 1054 Unknown column '_table_taxvat.value' in 'where clause'";i:1;s:7921:"#0
To resolve this i just removed the sql conditions like below in file Grid.php
at path: app/code/local/Pisc/Euvat/Block/Adminhtml/Customer/Invalidstatus
change the below lines
"(_table_taxvat.value IS NOT NULL AND (".$collection->getTable('euvat/vies_cache').".response LIKE '%valid=1;%') AND tax_class_id<>".$config->getTaxClass_EuBusiness()." AND tax_class_id<>".$config->getTaxClass_DefaultCountry().")".
to
"( (".$collection->getTable('euvat/vies_cache').".response LIKE '%valid=1;%') AND tax_class_id<>".$config->getTaxClass_EuBusiness()." AND tax_class_id<>".$config->getTaxClass_DefaultCountry().")".
As u can see i just removed the red colored line "_table_taxvat.value IS NOT NULL AND" , just do the same for all occurance of that line.
Wednesday, August 29, 2012
magento- Stock Status Index process is working now. Please try run this process later.
To remove this error first thing you have to do is to clear the content of locks folder under var folder.
If this didn't solved your problem then check out the file permission of locks folder and change it to 777
If this didn't solved your problem then check out the file permission of locks folder and change it to 777
magento remove index.php
Under "Search Engine Optimization" set value of "Use Web Server Rewrite" to "Yes"
Under "Secure" section set "Use Secure URLs in Frontend" to "Yes".
Now,
Add the following lines to your .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
If your magento setup is under some folder like Clients/testsite then use followin lines
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Clients/testsite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /Clients/testsite/index.php [L]
</IfModule>
Monday, August 13, 2012
magento ecommerce google analytics
BELOW IS THE CODE THAT I USED IN MY PROJECT
File: success.phtml
path: app/design/frontend/default/mytheme/template/checkout
<?php
$order1 = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
$subtotal = $order1->getSubtotal();
$order_id = $order1->getId(); //the id of the order
//$order->getIncrementId();//the increment id of the order
$gtotal = $order1->getGrandTotal();//grand total of the order
//echo "<pre />";
//print_r($order->getBillingAddress()->getData());
$address = $order1->getBillingAddress()->getData();
$city = $address['city'];
$state = $address['region'];
$country = $address['country_id'];
?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17916440-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'<?php echo $order_id; ?>', // order ID - required
'steigerhoutstunter.nl', // affiliation or store name
'<?php echo $gtotal;?>', // total - required
'0', // tax
'0', // shipping
'<?php echo $city;?>', // city
'<?php echo $state;?>', // state or province
'<?php echo $country;?>' // country
]);
<?php
$order_items = $order1->getAllItems();
$itemcount=count($order_items);
$name=array();
$unitPrice=array();
$sku=array();
$ids=array();
$qty=array();
foreach ($order_items as $key => $item)
{?>
_gaq.push(['_addItem',
'<?php echo $order_id; ?>', // order ID - required
'<?php echo $item->getSku(); ?>', // SKU/code - required
'<?php echo $item->getName(); ?>', // product name
'category name', // category or variation
'<?php echo $item->getPrice(); ?>', // unit price - required
'<?php echo $item->getQtyToInvoice(); ?>' // quantity - required
]);
<?php
}
?>
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Subscribe to:
Posts (Atom)


