#1273 – Unknown collation: ‘utf8mb4_unicode_ci’ in localhost or Cpanel

There is a comomn problem that we all faced that You will face this type of error >> ” #1273 – Unknown collation: ‘utf8mb4_unicode_ci'” When we try to export and import Database in different envirment. The following technique is more effective than any other (I thinking..)..

First export your database to .sql, open it on sublime text / Notepad++ and go to “Replace”. Then just replace “utf8mb4” with “utf8” for all. It will replace the “utf8mb4_unicode_ci” to “utf8_unicode_ci” .

Now go to your Database in PhpMyadmin and set the DB collation to utf8_unicode_ci (Operations > Collation).

N.B: you can also replace the whole Collation with your disired collation.

how to rename the attribute’s label for front-end Magento

Sometime there need to be a situation to change the default attributes name for the front-end. In that case the all of the custom theme don’t have the pre-work for this. We have to make it with replace the following code ….

In
app/design/frontend/YOURPACKAGE/YOURTHEME/template/catalog/product
/view/type/options/configurable.phtml in line 35 for my case

if the file not there then please check in

app/design/frontend/base/default/template/catalog/product/view
/type/options/configurable.phtml

and you may copy it to the theme and Change the following code inside the line

echo $_attribute->getLabel()

To

echo $_attribute->getProductAttribute()->getStoreLabel()

Then you should get the Label you set in Default Store View section of the attribute in admin

The order confirmation email is not sent in Magento

It’s very common that the order confirmation email is not sent to the email. And it’s specially problem for the Magento 1.9.x. There is a very simple trick to make it work …

We need to change in order.php in below

public_html/app/code/core/Mage/Sales/Model/Order.php

We have to create one directory structure on the path below, then copy and paste the file to the path below.

public_html/app/code/local/Mage/Sales/Model/Order.php

Now, change from

$mailer->setQueue($emailQueue)->send(); ( for me it was line 1356)

to

$mailer->send();

Reviews do not show up in the Magento admin

Sometimes we faced prolem for the reviews in admin…
Catalog -> Reviews and Ratings -> Customer Reviews -> Pending Reviews

But this is the bug specially in Magento 1.8 and we can easily resolved it by the following …

We have to open the file here >>

/app/design/frontend/themename/default/template/review/form.phtml

and then find the following line

<form action=”getAction() ?>” method=”post” id=”review-form”>

and add next to :

getBlockHtml(‘formkey’);
?>