Unit testen, Magento en de database

Share
Posted on April 27th, 2015 | Posted by admin

Het schrijven van goede, test-driven code is belangrijk voor de stabiliteit en garantie van een project, maar het helpt je ook – als ontwikkelaar – om ‘s avonds beter te kunnen slapen. In dit artikel laten we je zien hoe we unit tests hebben ingezet voor een Magento project waarbij berekeningen met de database cruciaal waren.

Het scenario

Een grote klant van ons had een zeer specifieke wens voor een kortingsmodule voor hun nieuwe webshop. De korting welke een klant kreeg werd namelijk berekend aan de hand van de organisatie waar de klant aan toegewezen was. Dus de prijs voor product X kon verschillen tussen klant A en B.

Database Queries in magento

Share
Posted on May 11th, 2013 | Posted by admin

Magento is a complete and awesome MVC application. It’s fully moduler and easy to extend its features and functionality. All the CRUD operations are performed using the modules, model classes. But many a time it requires a developer to execute the db query in traditional form.

Here is the list of methods and queries.

In magento to Read or Write any query we need database connection.

<?php
//database read adapter
$read = Mage::getSingleton('core/resource')->getConnection('core_read')
//database write adapter
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
?>

These connections return special instances of the Mage_Core_Model_Resource class, that contains functions used to execute raw Database Queries.

Convert Magento Database to Innodb

Share
Posted on March 31st, 2013 | Posted by admin

Convert Magento Database to Innodb

ALTER TABLE `admin_assert` ENGINE=InnoDB;
ALTER TABLE `admin_role` ENGINE=InnoDB;
ALTER TABLE `admin_rule` ENGINE=InnoDB;
ALTER TABLE `admin_user` ENGINE=InnoDB;
ALTER TABLE `adminnotification_inbox` ENGINE=InnoDB;
ALTER TABLE `api_assert` ENGINE=InnoDB;
ALTER TABLE `api_role` ENGINE=InnoDB;
ALTER TABLE `api_rule` ENGINE=InnoDB;
ALTER TABLE `api_user` ENGINE=InnoDB;
ALTER TABLE `catalog_category_entity` ENGINE=InnoDB;
ALTER TABLE `catalog_category_entity_datetime` ENGINE=InnoDB;
ALTER TABLE `catalog_category_entity_decimal` ENGINE=InnoDB;
ALTER TABLE `catalog_category_entity_int` ENGINE=InnoDB;

Export and Importing MySQL Database via SSH

Share
Posted on October 17th, 2012 | Posted by admin

There are times when the usual methods of backing up a database do not cut the mustard – especially when it comes to Magento databases . Normally a Magento database can be backed up via the tool>backups module within the backend – however you may find that on some servers the process of backing up the database might time-out in your browser.
At times like these it is useful to know the following techniques for backing up and restoring via SSH.
First of all to backup your database you will need to firstly connect to your website via SSH – normally like so (on MAC):

ssh username@ip.add.re.ss

– enter your password
This will normally get you in to your website – that is if you have SSH enabled for your domain on your chosen hosting platform.
Next we will perform a nice clean backup – what I tend to do if it is a Magento website is to navigate to the backups folder within the Magento var folder by doing the following:

External Database Connector FAQ’s

Share
Posted on March 28th, 2012 | Posted by admin

We have been receiving a lots of comments on how to “install” External Database Connector (Formarly, TTT_EDB) in Magento. So we thought why not clear that out some of the questions we received here and lets see if this will help you and all.

First of all we would like to say that this is not a fully functional module (Don’t Panic..), meaning you will not be able work with tables of external database just by configuring the settings of the module. You will have to code your associated Model/Collection classes based on the Magento External Database Connector Released.

Few things which came and we would want to clear out.

Page 1 of 3123»