Book Image

Building E-commerce Sites with VirtueMart Cookbook

By : John Horton
Book Image

Building E-commerce Sites with VirtueMart Cookbook

By: John Horton

Overview of this book

VirtueMart is a premier eCommerce solution powered by Joomla!In Building E-commerce Sites with VirtueMart Cookbook you will learn how to create a full-functioning and attractive eCommerce solution with VirtueMart. You will be shown how to install and configure VirtueMart, how to set-up and run your store day-to-day as well as configure and customize the look and feel of your store. With this book by your side, you will be able to overcome as problems setting up, administrating and customizing your eCommerce store! This book finishes with blueprint projects meaning that getting started with VirtueMart is even easier for the novice and aspiring site builder or developer. If you have always wanted to create a professional-looking store, but are worried about the complexity and difficulty involved, then this book is for you! With numerous recipes, practical tips and solutions Building E-commerce Sites with VirtueMart Cookbook will take you through every step required to achieve eCommerce success.
Table of Contents (17 chapters)
Building E-commerce Sites with VirtueMart Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Detecting the user's country with Sourcerer and GeoIP


What we will do is detect which country a visitor to our website is from and vary the content we show accordingly. In this simple recipe we will detect if a visitor is from UK, Spain, or Germany and output a message in the appropriate language. You will be able to easily adapt or extend the code should you wish to cater for more countries or different countries. This will work by using Sourcerer to query a GeoIP database which tells us where the current visitor's IP address is registered.

Getting ready

If you haven't installed Sourcerer then see the recipe, Installing Sourcerer, in this chapter.

Pick an article, product, category, or Joomla! HTML module in which to do this. We will be installing the code in an article but with Sourcerer, as always, it would be trivial to amend the recipe and put the code somewhere to suit you.

How to do it...

This can appear quite technical at times but it really isn't. Understanding the PHP is not essential...