[Magento] How to get Add-To-Cart, Add-To-Wishlist, Add-To-Compare Urls

This was just a note while I was working on a client’s project regarding to How to load more magento products with Ajax

magento-add-to-cart-wistlist-compare

[Tofu And Tomato] Magento 1.7 “Database server does not support InnoDB storage engine message”

I’m trying to re-install a cloned Magento 1.7 website on a local server using AMPPS. InnoDB is set as the default engine but it still shows me the message: Database server does not support InnoDB storage engine.

To sort out this issue:

Go To Line 59 of the file app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php

Replace:

public function supportEngine()
{
    $variables  = $this->_getConnection()
        ->fetchPairs('SHOW VARIABLES');
    return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true;
}

With:

public function supportEngine()
{
    $variables  = $this->_getConnection()
        ->fetchPairs('SHOW ENGINES');
    return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO');
}

Also see my screenshot:

magento1.7.inodb

[Tofu And Tomato] [Magento Solutions] Fix email not sent

Today, my client at http://www.dubuy.it/ told me that, he had an weird problem with email settings in Magento, he had never receive any sale / order emails after submitting one-page-checkout form.

If the order displays the email as sent and you or your clients are not receiving the email, then the problem is most likely the email settings you have for Magento or the local email server that Magento is using.

I also checked the settings:

  • Admin -> Configuration > Advanced -> System > SMTP Settings and see that you do not have emails disabled.
  • Admin -> Configuration > General > Store Email Addresses and check if you have the email addresses in there correctly. Sometimes email servers would refuse to send email if the senders email is not a proper email address.

However, the settings are correct but emails still were not sent. After digging into the code, I found the issue:

Just been looking into this myself. I’ve followed the code and functions back to this function “public function sendNewOrderEmail()” in:

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

starting at line 1270 is the following code:

$emailSentAttributeValue = $this->load($this->getId())->getData('email_sent');
    $this->setEmailSent((bool)$emailSentAttributeValue);
    if ($this->getEmailSent()) {
        return $this;
    }

This is checking the sales_flat_order db table to see if the email has already been sent to the customer and if so just to return, but this does not send the email and should throw an error. So I would say it is a bug somewhere. To fix it so you can resend order/invoice emails etc..

Copy

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

to

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

and comment out line 1273

if ($this->getEmailSent()) {
            //return $this;
        }

Works like a charm for me. But literally only this second tested it.

magento-fix-email-not-send

[Tofu And Tomato] How to add CSS classes to Magento top links.

Ever wonder or ever hit your head on the wall what bloody template file controls the site link, footer link in Magento and how to add a class to it? That’s right, it’s thepage/template/links.phtml.

The template file generates ‘first’ and ‘last’ class in li tag, but sometimes we need more styling in each individual link list and we want to add a class either in li or anchor tag without hacking the core file or extend a class in Magento core, how do we do that?

The answer is in the xml file

magento-top-links

LET’S HAVE A LOOK AT MY CODE:Screen Shot 2014-10-18 at 11.38.48 AM

[Tofu And Tomato] Magento – How to add another language to your store

I currently have two sites under development that are going to take advantage of multiple languages.

One will have a second store view in French and another will have a second store view in Spanish.

The fist step is to change the default store view name to English. Login into admin and go to the System>Manage Stores section.
Click on Store View Name for your default store. Change the store name to English. Then save.

Next step is to create the second store view, which will be Spanish.
Click on Create Store View button at top.
Enter your information for the Spanish store per image below:

new-spanish-store

Click on Save Store View and you should have a new Spanish store view.
On the front end, you will now see that there is a store switcher in the header area.

switcher

Now, we have two stores, one english and one spanish.
But as you can see, it’s not all working as it should.
If you go to the home page in the Spanish Store, we will get a 404.
You can fix that by assigning the home page to All Store Views, per below.

home

You will also need to go to Catalog>Manage Products and select all your products, then update attributes.
Then go to websites section, per below, and add product to website.

update-products

You should now see all your products showing in categories, regardless of what store view you are in.
We will cover products later.

If you take a quick look at your Spanish view store, you will notice that it’s not really in Spanish, it’s still in English.
That’s because you haven’t given Magento any translations for your Spanish store. That’s next.

Go to Magento’s Translations Page.
Search for your language pack then click on it to go to the pack’s download page.
You are now ready to download the Spanish pack, see below.

translations

Save the es_MX folder to your desktop, and upload to your server in the app>locale folder.See below.

locale

Now that you have installed the Spanish language page, it’s time to tell Magento about it.
Go to System> Config> General tab, then click on Locale Options tab.
In top left, select Current Configuration Scope, and select Spanish. See below.

config Now that Magento knows about our Spanish language pack, it should be serving translated files in the front end.
Let’s see…

translated

Finally, we will talk about product translations.
If you want to have Spanish in a product, for example, you will need to go to Catalog>Manage Products.
Select your product, then select Spanish store view in top left.
Add your Spanish translations to short description, for example, by unchecking ‘Use Default Value’ and then pasting in your Spanish translation. See below.

short-desc

Here is result of that translation on front end…

short-desc-tl

I know that’s alot of steps, but it’s really amazing what we have just done.

We now have a multi-language store, serving different visitors, in their own tongue.

4 Benefits of Using Ecommerce Responsive Website Deisgn For Your Business

“Having an eCommerce responsive website for your online business is completely best to increase your sales and profit. By adopting a responsive web design, businesses can get lots of benefits, so checkout this blog and know what type of benefits you can get.”

In this highly competitive world, it becomes quite difficult for all the businesses run a successful online business by which they can boost sales of their business and earn maximum profit. However, it is not possible for businesses to increase their sales and profit without using responsive web design service.

If you have decided to make your eCommerce business more popular, it is best for you to adopt a responsive web design so that one can access your website from any device. By making your eCommerce website responsive, you can allow your customers and website visitors to access your website from any device or computer like desktop, tablet, laptop, smart-phone or any other device.

In this blog, I have listed the major benefits of responsive web design, so go through it and make yourself to ready to make your site responsive:

Improve User Experience –

Today, more than 90% of people have smart-phones and they prefer to access online websites from their device, so it is important for online businesses to have a Magento responsive design that helps their business to enhance user experience. By adopting responsive website, users can give a well-formatted website to access, and the website automatically adjusts as per their device’s screen and orientation.

tumblr_inline_n8e54uX55t1stddiv

Boost Conversion Rate of The Site –

One of the major benefits that businesses can get by opting for responsive web design is it helps them to boost conversion rate of their website. As per the report, approximately 54% of respondents are satisfied with their mobile experience and prefer to come again to purchase from the retailers mobile channel. Moreover, it is well-known for using standardized style sheets for lots of devices and develops a reliable look to provide a positive impact on the conversion rates.

Increase Brand Awareness –

Some years ago, having a simple website was good enough for visitors to access it from their computer, but now-a-days, most of the people prefer to access online websites from their tablets and smart-phones, so it is essential to have contemporary websites that adjust their resolutions in different screen sizes.

Responsive website design helps you to increase your brand awareness and get lots of attention from visitors and customers. You can give your customers a pleasant experience and stat ahead of your expectations by designing an attractive responsive site.

Improve SEO of Your Site –

Apart from above mentioned benefits, the other benefit that businesses can get is that they only need to optimize the content for one link. Because the URL structure of the website remains as it is for other devices as well.

Online businesses can make their website responsive and have only one URL that is easy to update and optimize their content. It does not matter whether it is iPad, desktop or any Smartphone, responsive design lets Google crawlers to index your website pages easily.

So, these are the major benefits of responsive website design that all the eCommerce businesses can adopt to make their business popular worldwide. However, if you have decided to make your eCommerce site responsive, it is important to hire a professional eCommerce developer from any trusted company.

Why outsource magento development to Vietnam?

In Vietnam, labor costs are 90% less than those in the U.S, which brings significant cost savings for your company. Compare to other outsourcing destinations, Vietnam’s labor costs are attractive. Developer salary in Vietnam is 50% less than in India, and even less than that of countries in Eastern Europe.

Beside, living cost in big cities of Vietnam, like Hanoi and Ho Chi Minh city, is still much lower than in big cities of India, China, Indonesia. All of these make hiring developer in general and hiring Magento developer in Vietnam cost much lower. Another important reason to chooseVietnam as an offshore location is that the young generation of skilled workers is highly motivated and technologically advanced. This dynamic and young generation provides a great pool of skilled software developers required to meet the growing demand of offshore development in general and specifically for Magento development.

Today the country has a 96% literacy rate and 80% of the country’s college graduates hold degrees in the sciences. Each year more than 25,000 technical engineers graduate from the universities Regarding communication, not like many Asian languages, Vietnamese uses the Latin alphabet, just as English does. This makes it relatively easy for Vietnamese people to learn English. English is the second most popular language in Vietnam, and the majority of college, university graduates have high proficiency in English. Consequently, most IT developers in Vietnam are able to communicate easily with U.S. companies in English during the implementation of projects. Are you looking for a real Magento expert? Hire us! tien@tofuandtomato.com