Thoughts about coding and books

Simple Erply and Magento integration plugin

Recently I helped a company to build e-commerce website with Magento. She had existing shops already and she uses Erply with almost 10000 items which she wanted to import into e-shop.

Even though Erply and Magento both are market leaders then importing the data from Erply to Magento was poorly supported. I took existing github project, forked it, upgraded to magento connect version and fixed many issues in it. It is still not fully stable but usable, expert help is still advised. You download the plugin from here https://github.com/smartman/magento-integration

Simplest way to integrate Erply and magento is to:

  1. Install Erply plugin from Magento Connect service http://www.magentocommerce.com/magento-connect/erply-inventory-management-for-magento-1.html
  2. Download source of fixed plugin from https://github.com/smartman/magento-integration/archive/master.zip
  3. Copy/merge folders design, code and etc from magento-integration-master/erply/app/ to app folder in your magento installatation. This overwrites old broken files.
  4. Enjoy

Issues fixed are:

  1. Missing price, description and some other fields import
  2. Fixed big number of product import
  3. Fixed category import
  4. Many more small things

Issue with large number of product import was that it takes very long time. PHP script execution may time out and process never finishes. Read more about Simple Erply and Magento integration plugin

Paypal [L_SHORTMESSAGE0] => Internal Error [L_LONGMESSAGE0] => Timeout processing request

Paypal error messages are very unfriendly. It can say “Timeout processing request” without delay like 2012-12-20 19:45:34 INFO – Paypal call: https://api-3t.sandbox.paypal.com/nvp?VERSION=74.0&USER=username&PWD=12345&SIGNATURE=12345&METHOD=SetExpressCheckout&RETURNURL=http%3A%2F%2Fttawidget.dev%2Findex.php%2Fpayments%2Fpaypal%2Fsuccess&CANCELURL=http%3A%2F%2Fttawidget.dev%2Findex.php%2Fpayments%2Fpaypal%2Fcancel&L_PAYMENTREQUEST_0_AMT=2.00&L_PAYMENTREQUEST_0_ITEMAMT=2.00&L_PAYMENTREQUEST_0_CURRENCYCODE=EUR&L_PAYMENTREQUEST_0_DESC=payment+description 2012-12-20 19:45:34 INFO – PayPal call response: Array (     [TIMESTAMP] => 2012-12-20T19:45:34Z     [CORRELATIONID] => cdea44429896f     [ACK] => Failure     [L_ERRORCODE0] => 10001     [L_SHORTMESSAGE0] => Internal Error     [L_LONGMESSAGE0] =>Read more about Paypal [L_SHORTMESSAGE0] => Internal Error [L_LONGMESSAGE0] => Timeout processing request[…]

Application code deployment from SVN with fast and simple rollback

Most important thing in every new release is the rollback procedure. Once you discover issues in new version then you need to be able to swithc back to previous version until you work on a fix. I have developed shell script to handle the automated deployment process and which allows quick and simple rollbacks if there are no database changes that dont allow easy rollback. Main idea is to

  • download code from SVN, GIT or similar
  • copy all code to new folder
  • replace all configuration with environment related conf
  • use symlink to switch between code versions

Here is example script that handles the automated deployment for you  Read more about Application code deployment from SVN with fast and simple rollback

Quality software testing guidelines (for startups)

Importance of software testing=quality assurance=QA cannot be stressed enough.  Here is experience from my startup regarding good quality testing process.

The goal of testing is to guarantee that the released code does not contain any critical issues. This is contrary to understanding that this is just finding as many defects as possible. There are 2 main types of testing: a) testing new features and bug fixes b) regression testing to validate that old code is still working.

Reporting defects

When issue is discovered then it is important that it will be very easily understandable and reproducible. Making extra effort to report issues in understandable format means that development team will be able to fix the issue much faster. Recommended format for reporting bugs is: Read more about Quality software testing guidelines (for startups)

Error: redirect_uri_mismatch – Reset google authentication oauth api secret

I have a few webapps where I am using google login.  When you are running the app in different domain then you will get error like Error:redirect_uri_mismatch The redirect URI in request: http://mywebsite.com/ did not match registered redirect URI. Also  you might want to create new app for google oauth2 login. Anyway it is forRead more about Error: redirect_uri_mismatch – Reset google authentication oauth api secret[…]

Access virtualbox shared folders from Ubuntu and fix ruined ubuntu installation.

If you are running Ubuntu virtualbox guest then you cannot access the shared folder under /media/shared with regular user. However you can fix this by adding your user to vboxsf additional group.

Important! make sure you append the additional group so that other groups are not removed! Run te command below as exactly as seen and replace you username. If the permission is not applied immediately then reboot.

usermod -a -G vboxsf username

In case you forgot flag -a then it is bad but not hopeless 🙂 Read more about Access virtualbox shared folders from Ubuntu and fix ruined ubuntu installation.