Wednesday, November 21, 2012

MAGENTO GET STORE SPECIFIC ATTRIBUTE LABEL:

 <?php echo $_product->getResource()->getAttribute($_attribute->getAttributeId())->getStoreLabel();?>  

Magento error :Mage registry key "_singleton/core/resource" already exists

Magento invoice pdf : display custom options in one line



open default.php
at path:

app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice

//REPLACE THE LINES  one that starts with if ($options) {
        //foreach ($options as $option) { with the followin lines.

       
       $options = $this->getItemOptions();
    if ($options) {
        foreach ($options as $option) {
            if ($option['value']) {
                $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']);
                $values = explode(', ', $_printValue);
                foreach ($values as $value) {
                    $optlabel= Mage::helper('core/string')->str_split(strip_tags($option['label']), 70, true, true);
                    $optval = Mage::helper('core/string')->str_split($value, 50, true, true);
                    $lines[][] = array(
                        'text' => htmlspecialchars_decode ($optlabel[0]." : ".$optval[0]),
                        'feed' =>35
                    );
                }
            }
        }
    }

Cargowiz issue bd.addClass is not a function ext-tree.js (line 33)




Open file
js/extjs/ext-tree.js

Search for bd.className
Replace bd.addClass(cls);  by  bd.className+=cls;


firefox screen shot of the error:

Magento connect installation error Connection string is empty


Click on "settings" tab
And fill up "FTP Host","Ftp login","Ftp Password","Installation Path:"


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.