Box product implementation in Opentaps

What is a Box product?

A product which can be sold as a single unit as well as a Box of x units of that product. For example a T-Shirt can be sold as a single unit or it can be sold as a Box of 10 T-Shirts but in both the cases actual product(SKU) is same. Amicon Tech has implemented this functionality by extending Opentaps.

Box product implementation details

1. In this case item sold as a single unit and item sold as Box are going to have the same SKU.
2. Inventory is common which means if this product is sold as Box of 10 Qty, means customer has ordered 1 Box product so qty that will be reduced from the inventory will be 10.

3. On product detail page there are two input text boxes one for single unit qty and one to enter box qty. –

4. System is smart enough to split the ordered qty into Boxes and Single units. Example suppose customer enters 12 in qty text box for single unit item and adds it to cart then system splits this into to cart line items 1st a box product(box of 10 qty) and 2 qty of single unit.

5. To handle box products we have customized the code at all required places in the order fulfillment process, from Adding such item to cart, Editing cart, Create order, Edit order cases, Packing, Shipping, Dropshipping, Reserve Inventory process, Order (Box)item/s Return etc.

6. Admin can set prices according to business needs for example 1 T-Shirt can be of $49.00 but Box(10 qty) can be priced $450.00, So when system splits such items in Boxes and Single units it applies the prices accordingly.

7. When there is just 1 individual item in cart and when we update its quantity which equals the box item quantity break (for eg. 10 per box), then that item is converted to a box item automatically.

8. When the qty of box item is updated, it implies that the qty is for box items. For example – when a box item qty is updated to 4 from cart, this means user is ordering 4 boxes of that item.

9. When a box item and an individual item is added to order, 2 separate line items will be displayed in the order view page and the box item will be flagged as “Box Item: (Box of x)” in red font(refer snapshots).

10. When we try to update the box item qty by editing the order and put a quantity that is not a multiple of the box quantity break (for example – a box item has 10 units and we try to update it to 15), then we throw and error saying “Cannot update Box Item – 521C03 quantity to 15. The quantity for this Box Item should only be in multiples of 10.” So the box item qty can only be updated only if the new qty is a multiple of the box item quantity break.

11. When there is just 1 individual item in the order and when we update its quantity which equals the box item quantity break (for eg. 10 per box), then that item is converted to a box item automatically.

12. When there is one box item (10 units per box) and an individual item (of 5 qty), and when the qty of individual item is UPDATED to 10, then this individual item is merged with the box item and the order will then show – a bow item of 2 box quantities and the other line order item will be CANCELED.

13. When there is one box item (10 units per box) and an individual item (of 5 qty), and when the qty of individual item is ADDED of 5 qty, then this individual item is merged with the box item and the order will then show 3 order items – a box item of 2 box quantities and the 2 line order items will be CANCELED.

14. When there is just 1 individual item in the order (for example – having 4 quantities), and now we ADD the 4 quantities of same product, then the cart will show 2 line items of 4 quantities each. We DO NOT merge/update the quantity of existing item and it is like in out-of-the-box Opentaps.

15. When there is just 1 individual item in cart (for example – having 4 quantities and this item has a box item which has 10 items per box), and now we ADD the 8 quantities of same product, then the cart should show 2 line items – one box item of 1 qty and one individual item of 2 qty.

Snapshots -
A. Shopping Cart –

B. Checkout Page –
C. Order Review Page –
D. Order Confirmation Page –
E. CRMSFA Order View Page –
F. Warehouse Packing Screen –
G. Order view page after order completion –
H. Shipping option page CRMSFA-
I. CRMSFA Order Review Page –
J. CRMSFA Edit Order page –

Box product implementation has helped a lot of our clients having such requirements in their business. If you have any questions or suggestions then please leave comments i will definitely get back to you.

Posted in OFBiz and Opentaps, Opentaps | Leave a comment

Paypal Express Checkout Integration with Opentaps / OFBiz

How it works?
In OOTB OFBiz/Opentaps this integration has been done using PayPal’s Name-Value Pair API(NVP API). OOTB integration provides very basic features but those can not cover real time business scenarios like dynamic calculations for Shipping Estimates, Address Overriding etc. This OOTB implementation had to be customized and enhanced to make this fully functional. We will describe all the additional customizations that we have made in detail later.

NVP API provides parameterized mapping between request and response fields of a message and their values. NVP is a way of specifying names and values in a string. NVP is the informal name for the query in the URI specification. The NVP string is appended to the URL. An NVP string conforms to the following guidelines:
1. The name is separated from the value by an equal sign (=). For example: FIRSTNAME=Sumit
2. Name-value pairs are separated by an ampersand (&). For example: FIRSTNAME=Sumit&LASTNAME=Porwal
3. The values for each value in an NVP string are URL-encoded.

The request message is sent from your website by the API, and a response message is returned by PayPal server using a client-server model in which your site is a client of the PayPal server. See snapshot -

For example, you might want to obtain the buyer’s shipping address from PayPal. You can initiate a request specifying an API operation to obtain buyer details. The response from the PayPal API server contains information about whether the request was successful. If the operation succeeds, the response contains the requested information. In this case, the response contains the buyer’s shipping address. If the operation fails, the response contains one or more error messages.

NVP API provides various operations that we can perform to acomplish checkout process. To perform a PayPal NVP API operation, you send an NVP-formatted request to a PayPal NVP server and interpret the response. In this snapshot

you can see how can we specify a NVP request. A method specifies the PayPal operation you want to execute, and each method is associated with a version. Together, the method and version define the exact behavior of the API operation. You must specify API credentials in each request to execute a PayPal API operation. For any operation there are various fields available to send information to NVP API server, on Payapl’s official site ther are very well documented.

The Name-Value Pair response consists of the answer to the request as well as common fields that identify the API operation and how it was executed. This snapshot shows fields in the response to a PayPal NVP API operation.

There are some common response fields which will be common in every response that we get from NVP server, also there are fields in response message which are specific to the operation that we have requested to perform.

Below are the operations provided by NVP API –
1. SetExpressCheckout API Operation – This API operation initiates an Express Checkout transaction. Via this operation we can send all the information that we have in our cart like all cart items, their SKU, Unit Price, Product Name, Description, Cart Total Amount, Promotions on item as well as on Cart Total, Sales Tax, Shipping Charges etc. to paypal so they can create shopping cart with all these details at their end. In this operation we can specify CALLBACK url which is the URL to which the callback request from PayPal is sent, we will discuss the purpose of this operation saperately. We can also override buyer’s paypal ac Shipping Address by setting “ADDROVERRIDE” field and other address related fields.

2. Callback API Operation – Basic purpose of this operation is to update the PayPal Review page with shipping options, insurance, and tax information. The max limit of callback timeout is 6 seconds.

3. GetExpressCheckoutDetails API Operation – This API operation obtains information about an Express Checkout transaction. In sipmle words we can say that when buyer has updated the cart on Paypal Review page and click on continue button then this operation gets executed which grabs all the updated information from paypal and send it in response message to our website so we can show them on Order Review page on our website.

4. DoExpressCheckoutPayment API Operation – The DoExpressCheckoutPayment API operation completes an Express Checkout transaction. In this operation we send order’s final payment related information to Paypal. Till this point order’s payment has not been authorized so other stays in Created status. In this operation we can also send some aditional information to paypal like Merchant’s Order# etc so that Merchant would be able to see this Order# in his paypal account.

Here is the process flow diagram of express checkout –

5. There are other payment related operations like for Authorization=DoAuthorization, Capture=DoCapture, Refund=RefundTransaction, Void=DoVoid. These operations get executed like they do for a normal order fulfillment process. There are some constraints for all of the above operations so when we implement the code and configure the merchant account we should be very carefull.

At OFBiz side you will have to prepare some payment settings related seed data. Also you will have to set Paypal payment gateway confoguration related data in entity “PaymentGatewayPayPal”. You can set this data for sandbox as well as for live paypal account.

What additional fixes/enhancements were made on top of OOTB code?
1. OOTB Address Override feature is not implemented. So we customized SetExpressCheckout code to support it.
2. Callbacks were not working in OOTB code.
3. In OOTB code Shipping Options and Shipping estimates are hard coded. We have made it dynamic so now Shipping options and Shipping estimates all are dynamic and based on shipping destimation address.
4. As per our client’s requirement we implemented shipping promotion that UPS Ground will be Free Shipping if cart total is equal or greated than a predefined amount.
5. In our client’s system there are some special products called box product which can be sold as a single unit or as a box of x units. This was a special case for which we had to customize the code to send proper cart item info to paypal.
6. We had to customize the Payment Information section(where payment method used is displayed) on Order Review as well as on Orer Confirmation page, as in OOTB code payment section doesn’t show Paypal as payment method in payment informaction section in front-end as well as in back-end.
7. OOTB Paypal Guest Checkout in not implemented. We have implemented it successfully.
8. OOTB when we send user selected shipping option to paypal then on paypal order review page it doesn’t display that shipping option as selected in shipping option dropdown. We had confirmed with Paypal Tech support team that this is a bug. We fixed this bug by making chnages in code at our end so that now user selected shipping option that we send to paypal will be displayed at 1st position as selected on paypal order review page in shipping dropdown.
9. OOTB when we create an order using Pypal Express Checkout then order gets created in CREATED status, admin has to click on Approve order button so that order payment gets authorized and order status gets converted to APPROVED. We have customized the code and automated this process so now as soon as paypal order gets created it automatically get authorized and approved and if authorization fails then order stays in CREATED status and we can see in Payment Information section that why Order payment Authorization failed, so admin can take action accordingly.
10. We had to customize the code to handle Refund use cases for box products.
11. OOTB there was no facility to search a paypal order by using paypal order transaction id. We customized the code so that now admin can search such orders via Find Order screen in CRMSFA.

What problems we came across.
1. It took us a lot of time to get the Callbacks working. We had to go through thoughroughly all the documentation provided by paypal on Callback implementation.
2. Once we got the callbacks working the major issue we faced was Callback timeout issue. The max limit of callback timeout is 6 seconds. So in these 6 seconds we had to dynamically calculate shipping estimates(via connecting to UPS server) and send the estimates with Free shipping promotin if applicable and updated sales tax values(Tax on shipping charge) to paypal. We had to customize code a lot to make it time efficient.
3. On paypal review page Total Tax doesn’t change on selection of any new shipping option other than already selected one that customer might have selected from checkout page. Initially we thought that we are missing something or doing something wrong so we went through all the documentations but couldn’t find any reason so we contacted Paypal tech Support team and later we found that this is a bug from Paypal side. To fix this we made changes in GetExpressCheckout code.
4. The most important thing is whatever code is implemented or you have customized, in Paypal Merchant’s account all the confirurations should be done so that they will support those code changes.

Known Limitations for Paypal Express Checkout -
1. On paypal review page Total Tax doesn’t change on selection of any new shipping option other than already selected one that customer might have selected from checkout page.
2. In partial capture case (like when we decrease the qty of an ordered item) the remaining authorized amount is not voided as soon as we decrease the qty. It will be voided automatically when the Auth(hold) period is over which is usually 29 days.
3. All the edit order cases in which an additional amount get added to order total like Manual Adjustments, Misc Charge, Increase of qty of any order item etc are not supported currently, as in such cases we need to authorize the additional added amount and currently multiple Auths for a Paypal order are not available.

Snapshots –
1. Shopping Cart page –
Customer can also opt for Paypal Express Checkout from Cehckout page as well by choosing Paypal as payment method, but in both the cases SetExpressCheckout NVP API Operation will execute to initiate Paypal Express Checkout process.
2. Customer got redirected to Paypal login page –
3. Paypal Order Review page –
4. Order Review page on client’s ecommerce site –
5. Find Order page –
6. Order Confirmation page front-end –
7. Order View page(CRMSFA) –

8. Order Complete Status –

I hope this articale will help others who are planning to use & customize Paypal Express Checkout available in OOTB OFBiz/Opentaps.

Posted in OFBiz, OFBiz and Opentaps, Opentaps | Leave a comment

eBay Integration with OFBiz / Opentaps – Part 2


This blog gives a brief of eBay Store Component in OFBiz/Opentaps, talks of how to set-up an eBay Store and also briefs the ways to create promotional sales, set-up free shipping, listing product variants and the corresponding limitations.

I. eBay Store

eBay Stores help sellers maximize their business on eBay and the Internet. With an eBay Store, you can display all your listings—regardless of format—in one convenient location. You can create and personalize your own eBay Store with a unique web address. Your monthly fee gives you access to eBay Stores tools that you can use to build, manage, promote, and track your business.It helps you showcase all of your merchandise in one
location, an eBay Store creates a central shopping destination where buyers can learn more
about you, your products, and your policies.

a) Setting up a Sandbox eBay Store

i. Set Up PayPal Sandbox Account
Register at PayPal developers Site, Once you are registered and logged-in, You
should see :

Use “Create a preconfigured Account” to create two test Accounts , a Business test account to represent yourself as the seller and a Personal test account to represent buyer. Seller’s account needs to be a premier or business account to accept payments.

ii. Link your PayPal Sandbox account to your eBay Sandbox account.For this you
shall go to Account > PayPal Account and click on “Link My PayPal Account” ,
System navigate you to a PayPal login page where you shall login with the seller
test account as created in in the previous step,System navigates you back to eBay.

iii. Click the Open an eBay Store link in the upper right-hand corner of the stores page, click on “Open a Store”. There are three levels of Subscription,The details and the fee for the same could be found out here.

b) eBay Store Component in OFBiz/Opentaps
Helps you keep sync with your online eBay Store. You can list products from your
OFBiz/Opentaps Store over your eBay store in different ways. You can create a Sale
under which you offer discount in terms of amount or percentage of the total amount or
you can mark it to be shipped for free through a shipping service of your choice.
You can list products as Auction Style listings or Fixed Price. An Auction Style Listing
can be listed for a duration of your choice, whereas for a Fixed Price Listing, a
Listing Duration Type Code is defined. A test (sandbox) store created by us could be observed in the snap as under :

II. Product Variants

eBay also supports variations in products but only on Fixed Price Listings. With
an AddFixedPriceItem call, you can list variants. At this time you can create listings with
variations in:

• Baby
• Clothing, Shoes & Accessories
• Crafts
• Health & Beauty
• Home & Garden (most sub-categories)
• Jewelry & Watches
• Pet Supplies
• Sporting Goods

eBay supports up to 5 variation details with up to 30 values for each.
Example: If you’re selling shoes, you can have up to 5 different variation details—for instance, Color, Size, Width, Material, and Style. For each variation detail, you can have up

to 30 different values. In this example, you could offer up to 30 different colors, 30 sizes, 30 widths, 30 types of material, and 30 styles.

So basically you could list upto 150 variants of a virtual.
With Item Specifics , you can specify the characteristics that apply to all the items in your
listing.Furthere details on posting variants on eBay could be found here. A sample Variant
created by us on our test eBay Store could be observed as under :

III. Free Shipping

There are two ways to ship items for free, by creating a Promotional Sale or using the
setting Free Shipping to true in Shipping Service Options while making an AddItem (for auction style listings) or an AddFixedPriceItem call.

IV. Promotional Sales

You can create sales that are seasonal, for specific holidays, for specific categories, or just to clear out inventory. Fixed price listings can be discounted by a percentage amount or
discounted by a specific monetary amount.Price sales can’t be applied to auction
style listings. However, you can select a free shipping discount for any listing, including fixed price and auction-style listings.Auction and auction/BIN format listings can include only free shipping as a promotional discount.There are three types of promotional sales:

• Price discount only
• Free shipping only
• Price discount and free shipping

If you select a free shipping discount, it applies to the first U.S. shipping service you selected when you listed your item. The free shipping discount doesn’t apply to any additional services that you selected.

All items with price sales can be discounted by 5% to 75%. The sale price of your item appears as a Buy It Now price anywhere on the site your listings typically appear.
To create a sale from your application, you need to make a SetPromotionalSale request, it takes between 1-6 hours for the sale to be approved, please make sure that the PromotionalSaleID is stored as it will be needed for further execution. To mark items(products) available on your eBay store, you need to make a SetPromotionalSaleLisitng request. You can see the status of sales using
Markdown Manager in your eBay store managment console or you can make a GetPromotionalSaleDetails request, If you do not specify a PromotionalSaleID value in the request, GetPromotionalSaleDetails returns all promotional sales for the authenticated user.

Revising the item price, shipping cost, or both for an item removes the item from a sale.
Sales can be scheduled for a later date or rescheduled once they’re over.
Sales can be scheduled up to 30 days in advance and eBay keeps sale information for up to 15 months after the end date.

If a listing is already on sale, you won’t be able to add a new sale.
For example, if your listing is on a price sale, you won’t be able to add a free shipping sale to that listing.

If you have listings in multiple currencies and choose to discount by an amount (not a percentage), that discount is in the currency of the listings and won’t be converted. For example, a discount entered as “5″ will be CN$5 for Canadian listings and US$5 in the United States.

If you have bids on an auction-style listing, you can’t add or remove a free shipping sale.

You can’t add a free shipping sale if your listing includes one or more of the following:

• Handling cost
• Shipping surcharge (for UPS domestic services)
• Freight shipping
• Local pickup only

Limits to sales in Markdown Manager
Sales in Markdown Manager are limited in these ways:

• The number of listings allowed to be changed in one day is 250 for Basic Stores, 2,500 for Premium Stores, and 5,000 for Anchor Stores. Changes include scheduling, editing, or adding listings to a sale.
• A price or free shipping sale on a fixed price listing can be 1 to 45 days.
• Free shipping sales on auction-style listings are valid until the listing ends.
• A listing can be in only one active sale at a time, but a listing can exist in multiple scheduled and inactive sales. There must be at least 1 day between sales for a particular listing.

Posted in OFBiz, OFBiz and Opentaps | 2 Comments

OFBiz and Multi-Tenancy

What is Multi-Tenancy?

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants). Multitenancy is contrasted with a multi-instance architecture where separate software instances (or hardware systems) are set up for different client organizations. With a multitenant architecture, a software application is designed to virtually partition its data and configuration, and each client organization works with a customized virtual application instance. Multitenancy is also regarded as one of the essential attributes of Cloud Computing.

Cloud computing is a marketing term for technologies that provide computation, software, data access, and storage services that do not require end-user knowledge of the physical location and configuration of the system that delivers the services.

Cloud computing describes a new supplement, consumption, and delivery model for IT services based on Internet protocols, and it typically involves provisioning of dynamically scalable and often visualized resources. It is a byproduct and consequence of the ease-of-access to remote computing sites provided by the Internet. This may take the form of web-based tools or applications that users can access and use through a web browser as if the programs were installed locally on their own computers.

Multi tenancy support in OFBiz

Multi-tenancy has been introduced in OFBiz at rev 927271. Multi-tenancy is the ability to run separate data instances (tenants) from a single copy of OFBiz. Each data instance is kept in a separate database which is dedicated to that tenants. A user logs into a data instance (or tenant) by specifying the tenant ID in the login form. There are various configurations that have to be made to make OFBiz Multi-tenant. These includes defining the tenant data sources in “TenantDataSouces” entity main reason for defining it in entity is “The advantage with multi-tenant is that the tenant doesn’t need access to load data using something like “ant run-install …” or anything else on the command line. You could have hundreds of people active in other tenant instances so you don’t want to stop and start the server to do anything like this, and hopefully you can avoid having an admin work with the tenant to get custom data loaded. You want things to be self-service, and that is the point of making it database driven (with a UI so the user can get stuff into the relevant portions of the database).”, set property variables so user will be able to see “Tenant Id” field in login form, configuration in entityengine, and entry in ofbiz-component.xml to load the tenant data. There are various commands which are available to load tenant data. Here you have to be careful while defining different readers to load the data. We have tenant specific delegators, while defining delegators we must follow the naming conventions as provided in OFBiz Multi Tenancy documentation. OOTB demo tenant configuration data is Derby specific but other datasources can also be configured like MySql, Oracle etc. We can set the ecommerce application to use a specific Tenant Database for which you will have to configure Web.xml. Tenant Data loading and other configuration setting should be managed through database and not configuration files, so that if any new new Tenant is added or we need to load any custom data for any tenant we need not to stop server. This is the area which need more improvement.

Multi-Tenancy is really a good addition to OFBiz feature list. Because of Multi-Tenancy feature now OFBiz can be used as SaaS and if used with Cloud Computing the results will be out standing.

To know all the configuration steps refer this –

Posted in OFBiz, OFBiz and Opentaps, Opentaps | Leave a comment

eBay Integration with OFBiz / Opentaps – Part 1


This blog covers the prerequisites & instructions for linking user’s eBay A/C to the OFBiz/ Opentaps respective module. It also shows you how to export products and import ordes from eBay into the respective eBay module.

I. eBay Component in OFBiz / Opentaps

This component has been basically designed to keep sync with eBay Auction Listings.
It contians functionalities to export products to eBay as auction listings and importing orders for the exported products. OOTB, It helps you search new orders based on Item Id
(basically the Product Id used as SKU on eBay), Order Id, Transaction Id and time frame.

II. Prerequisites

The miscellaneous information that you should be ready with is :

a) eBay Dev Id – your eBay developer I.d.
b) eBay App Id – a unique identifier from your eBay developer account that identifies
your application and links with your eBay developer account.
c) Cert Id – eBay developer account certificate Id
d) Token – Authorization token for your eBay user account
e) Site Id – eBay Site Code based upon your country
f) Xml Gateway Uri
– the unique resource identifier location to the gateway that will
parse your xml inputs and will pass back the output in xml format.
g) eBay Shipping Configuration Information – the shipment methods that shall be
displayed as on the eBay auction listing
h) In house set up details – Product Store,Catalog,Category and product Setup

III. Setting It Up

a) eBay Account(s) and Configurations

i. Register for your eBay developer’s account here .
ii. Generate Sandbox/Production keys – When you login to your ebay developer
account, on the landing page you shall see :
eBay Account(s) and Configurations

Proceed with Sandbox if you’re into developement and go for Production when you want to set-up a live system. For e.g. let us proceed with generating Sand Box keys.
You shall see this :

iii. User Registration – This depends on the scenario, If you want to set-up your system for production account then you should register yourself at eBay .For configuring Sand Box environment, In the tools section, you should see :

Clicking on this the system navigates you to the screen to register yourself as a
sandbox user. After registration you can access your account here.

iv. User Authorization Token – In the tools section , you should see :

The system navigates you to ‘Get User Token’ screen on which you can choose
between sandbox and production environment and the token could be generated

After selecting your environment, you should select the keys,corresponding to which you want to generate the user token,then you should click on ‘Generate User Token’
as in :

Then based upon the environment selection, system navigates you to a login screen,where you should provide the credentials as per ‘ Step iii ‘ . After accepting
the privacy policy, system navigates you to the final step of token generation, as in :

Copy the token to clip-board and save it clicking on ‘Save Token’. Please note that
multiple key-sets could be generated for each type of environment (Sand Box/
Production), but with one key-set only one token could be active at a time. For
obtaining multiple key-sets for an environment of your choice please refer here.

b) Setting up OFBiz for working with eBay

i. Create Store.
ii. Create Catalog and associate it to the Store.
iii. Create Category and associate it to the Catalog.
iv. Create one more category and associate it to the previous one, previous one being
its parent. – The system looks for products in the categories related to the Top
Category(prodCatalogCategoryTypeId =PCCT_BROWSE_ROOT) /
Top eBay Category (prodCatalogCategoryTypeId = ‘PCCT_EBAY_ROOT’) of the
catalog via ‘ProductCategoryRollup’.
v. Setting up Stores’s website information :


vi. Setting up shipment methods to be shown on your eBay product Listing :











vii. Setting up your products – for products to be exported to eBay as auction listings
you need to define two types of prices for the very product, viz. Start Price
(Minimum Price with purpose as EBAY ) and Buy It Now Price (Maximum Price
with purpose as EBAY), you could make use of seed data as under :



Or it could be defined using the ‘Prices’ tab in Catalog for a product.

viii. Configurations in ‘eBay Component’ – after logging into the eBay component
click on the ‘Ebay Configurations’ tab and click ‘New’ , System navigates you to
the screen as under :

Product Store – Select the Store you want to create a configuration for.
Dev Id, App Id, Cert Id, Token are to be specified as generated in ‘ III – a) ‘
Site Id – is the site code based upon your country, It could be obtained from here.

Xml Gateway Uri – For Sand Box :

For Production :

Api Server Uri – For Sand Box :
For Production :

Custom Xml –


Web Site – As defined in ‘ 3 b) v ‘

IV. Exporting Products

On the ‘Main’ / ‘Export To Ebay’ screen select the ‘Product Store’, ‘Catalog’ ,’Category’,etc and
click on ‘Find’, System shows the results as under :

Check the check-boxes adjacent to the buttons showing product information and click ‘Export
To Ebay’, System will navigate you to the screen as under :

Select the category from eBay, you want to export your products to, Enter Location and
select the ‘Payment Methods Accepted’ for the listing, System will keep on showing the
above screen and :

until you reach the lowest level in category hierarchy in the firstly selected one.To make sure
you are at the lowest level in the category hierarchy,i.e. You’re able to export your products
in right place, you could also notice the address bar it shall be showing ‘Y’ pre-pended to the
categoryCode parameter.After you have selected the lowest level category click on the
‘Export To eBay’ button. After successful export of products to eBay, System shows a success
message as in :

The exported Products could also be observed via > Login > Activity >
Selling > Active , as could be observed in :

V. Importing Orders

To Import Orders either of ‘Import Single Transactions’ / ‘eBay Orders Import’ , Select the
time frame and click on ‘Search Single Transaction From eBay’ / ‘Find’, System shows a list
of all the orders placed so far with checkboxes adjacent to the orders not yet imported and
payment accepted.

Please note that in order to import the orders the payment made by the buyer on eBay shall
be accepted by the seller using his/her eBay account.

Check the checkboxes against the orders to be imported, and click on ‘Import Single
Transactions’ / ‘Import Orders From eBay’ as in :

After the Order has been imported successfully, System shows a success message specifying
the order I.d. To which the corressponding order from eBay has been mapped as in :

The corressponding Order could be using Order component , as in :

Posted in OFBiz and Opentaps, Opentaps | Leave a comment

Setting Up Magento On Ubuntu

To set up Magento on Ubuntu you’ll need to set-up lamp first. In case LAMP is already configured you can proceed from Step 7, you can also skip the steps as per the already configured libraries/settings on your system.
1. Install MySql
    sudo apt-get install mysql-server

2. Install Apache2
    sudo apt-get install apache2

3. Install PHP
    sudo apt-get install php5

4. Installing and Configuring PHP5 module in Apache
    a) Install Apache PHP module
        sudo apt-get install libapache2-mod-php5

     b) Enable PHP Module in Apache
        a2enmod php5
    c) Re-start Apache2 :
        sudo service apache2 restart

Generally when php5 is installed this one gets installed and configured on its
own. You can check using ‘a2dismode’ is php5 is enabled or not.

5. Install PHP MySql connector
    sudo apt-get install php5-mysql

6. Configure Apache FQDN
    a) Configure Apache
        echo “ServerName localhost” | sudo tee /etc/apache2/conf.d/fqdn

    b) Restart Apache
        sudo service apache2 restart

– In case you haven’t done this earlier

7. If you use deprecated PHP code beginning only by “< ?" instead of " (which is highly inadvisable), open, as root, the file

    sudo gedit /etc/php5/apache2/php.ini

    look for the line “short_open_tag = On”, change it to “short_open_tag = Off” (not including the quotation marks) and add a line of comment (beginning by a semi-colon) giving the reason, the author and the date of this change. This way, if you later want some XML or XHTML
file to be served as PHP, the “< ?xml" tag will be ignored by PHP instead of being seen as a PHP code mistake. Restart Apache
    sudo service apache2 restart

8. Install and Configure PHPMYAdmin

    a) Install PHPMYAdmin
        sudo apt-get install phpmyadmin

    b) Configure PHPMYAdmin
        To configure PHPMYAdmin in apache open apache2.conf file :

        sudo gedit /etc/apache2/apache2.conf

        Put “Include /etc/phpmyadmin/apache.conf” at the bottom of the file,save it and close it.Restart Apache

        sudo service apache2 restart

9. Install Curl
        sudo apt-get install php5-curl

10. Download and Extract Magento :

    a) Download the CodeBase

    b) Extract the codebase
    tar -zxvf magento-

    c) Change the permission
    chmod -R o+w magento/

Move it to the location you want it to be.

11. Download and Extract Magento Sample Data

     a) Download Magento sample Data

    b) Extract Sample Data
        tar -zxvf magento-sample-data-1.2.0.tar.gz

    c) Change permission
        chmod -R o+w magento-sample-data-1.2.0

12. Set Up Data

Create database in mysql,restore sample data sql file,move the folders
inside the media folder of sample data inside the media folder of your
magento code-base’s media.

     mysql -u root -p magento < magento_sample_data_for_1.2.0.sql

13. Configure the Virtual Host

Configure the Virtual host in the default file or create a site of your own and
Restart Apache

14. Hit the magento URL through your browser configure it as per the options that suit you.

E.g. Hit Continue reading

Posted in Magento, Miscellaneous | Leave a comment

Data migration and integration of services in a heterogeneous environment

As a leading open source service provider supporting dozens of clients, we need to support wide variety of integrations and data migration services. As companies standardize processes to reduce operating cost, enterprise application development faces challenges associated with migrating applications to standard platforms. We customize and configure open source business applications for our customer’s needs and integrate these applications with their existing system, strategize data migration to load data into new application ensuring high integrity.

Case study:

When you are building an online enterprise system, you will recognize that the system requires wide variety of integration in a heterogeneous environment. When it comes to E-commerce, it should have the ability to integrate core platform capabilities to a wide of variety external services, payment systems, data migration and dumping to/from different database management systems. These services should be implemented in a cost-efficient, scalable manner that maximizes leverage of existing platform while supporting the creation and adoption of new components and services. At the same time system performance and high availability of the e-commerce platform must continue to be preserved.

The component which will fulfill these criteria’s must have ability to support various protocols in SOA architecture and a standard service oriented development framework. The framework must provide cost-effective integration of existing heterogeneous services, construction of services and format incoming data to the target system. So here we have analyzed and made comparison study with commercial ESB frameworks and open source frameworks to conclude which will suite for our client needs and which provides enterprise support as well. After going through a number of frameworks, Mule ESB came out to be the one fit’s in all places.

About Mule ESB:

Mule ESB is one of the world’s most widely used Enterprise Service Bus (ESB) framework and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data. It enables integration of existing systems, regardless of the technologies that the applications use.

Mule ESB act’s as transit system for carrying data between applications within your enterprise or across the Internet. Mule ESB is capable of Service creation and hosting, service mediation, message routing and data transformation.

To understand mule architecture in detail, click here.

Pre-requisites and Mule ESB setup:

Before going through system integration features we will see how to setup mule with tomcat in windows environment.


1. Install and setup latest release of eclipse.

2. Install Eclipse Mule Plug-in

3. Setup your java 1.6 and configure Java Path for your system.

4. Install latest version of Ant and set ANT_HOME

5. Install latest Mule Community Edition, currently we use 3.1.2

    - After download extract the files to chosen directory (e.g. C:\Mule) and setup MULE_HOME to that directory.

6. Install tomcat

    - CATALINA_HOME in system variables to your tomcat install directory.

    - Add to your CLASSPATH variables C:\\lib\servlet-api.jar; C:\\lib\jsp-api.jar; C:\\lib\el-api.jar;

Deploying Mule as a service to tomcat:

We need to install Mule in tomcat, Mule instance will be started from tomcat, so that you can hot deploy your Mule Applications. Take following steps to run Mule inside tomcat.

1. In the installed apache tomcat home directory, add the following line to the conf/server.xml file:

2. Copy the contents of the Mule lib folder with all its subdirectories except /boot to the mule-libs/ directory under your Tomcat home directory (create one if necessary). You do not need to flatten the directories.

3. Copy the mule-module-tomcat-.jar file to the mule-libs/mule/ directory under your Tomcat home directory (if it is not there already).

4. Copy the following libraries from your Mule lib/boot/ directory to your Tomcat mule-libs/opt/ directory:

    a. jcl104-over-slf4j-1.5.0.jar

    b. log4j-1.2.14.jar

    c. slf4j-api-1.5.0.jar

    d. slf4j-log4j12-1.5.0.jar

5. In the Tomcat conf/ file, add the following to common.loader (precede with a comma to separate it from existing values):

${catalina.home}/mule-libs/user/*.jar, ${catalina.home}/mule-libs/mule/*.jar, ${catalina.home}/mule-libs/opt/*.jar

6. Configure tomcat start-up properties.

Now we are ready to run Mule as a tomcat embedded instance. When we create a Mule based application and deploy it to tomcat’s web-app directory Mule starts listening to its requests.

Integration Process:

The purpose of this integration:

When we were started with the biggest Magento Enterprise E-Commerce with various integrations of outside services, payment systems, feed flow transactions and we needed an automated data transmission between IBM AS400 and Magento E-Commerce in a regular basis. We came up with this Mule ESB integration with this system architecture as a result of a thorough brainstorming over “Mule peer-systems” for similar functions.

System Architecture:

Mule ESB supports variety of communication protocols out of the box, still we have extend the functionality to add our own protocol support and changed some of the out of the box behaviors by overriding Mule ESB java classes. Mule ESB out of the box functionalities helped us much more to complete the development in faster phase. We have completed one of the biggest data migration and outside system integration in a short period with no time crisis on our deadline.


After thorough analysis and planning we started implementing our world’s biggest Magento project Our requirement was to integrate AS400 and Magento for data migration and order in a two way communication. Feed files are posted by AS400 every day whenever products are added or removed, to handle this, an intermediate processing to connect both the system was needed. The feed files in standard XML files were to be converted to JSON format with some Meta data added for Magento e-commerce suite. MongoDB a document storage database fits here well, when feed files reach Mule ESB, XML feeds are stored into the input collections. The quartz processor checks for available input feed documents in the MongDB and triggers document translators to convert the input feed data to formatted Json output. This Json output is sent to Magento through web service call; Magento starts importing the data based on the Meta data in the JSON feed. After processing feed file Magento sends back the feed status to Mule ESB through call back.

To interface the feeds posted by AS400, RichRelevance feed processing and Endeca Feeds have been integrated, these processed feeds are then sent forward using Mule ESB FTP outbound endpoint.

This integration helped us to automate feed file transformation in an efficient manner. We also implemented monitoring process in Mule ESB to send status alerts about the feeds currently processed and failure warning mails to system admin.

Mule ESB and Open Source:

Mule ESB can be used with many other open source applications to make the integration process easier and less time consuming. Mule ESB hot deploy instance can be deployed as an instance under tomcat. Spring and Mule ESB are powerful combination, spring makes the work lot easier to create, instantiate and use java bean type objects in Mule ESB. Mule uses many other open source technologies such as Apache CXF, Web Services and supports various protocol.


Using Mule ESB with various other frameworks and tools we support, we are one step ahead to make our integration services extended and easy implementing cost efficiency. There are various scopes for using Mule ESB with your Enterprise Application’s needs. When it comes to integrate an E-commerce suite with an ERP platform and a CRM, Mule ESB makes it happen. It also comes with an automated alert support for running process statuses, process management console to manage processes, etc.






Posted in Magento, Miscellaneous | 1 Comment

Synchronizing data between two PostgreSql Databases

In this lightening fast world full of a million different technologies and various database management systems and techniques, we still reach up to scenarios when we do have to extremely get on to a lower level to get something done. These are the scenarios when we either invent something new or implement a concept to get our work done.
The other day, there were two databases that contained the same schema, but different data and the data was to be popped into one database based upon a condition.
The databases belonged to PostgreSql and in the zest for efficiency, integrity and excellence,
analysis started.

If you google using any of the below statements:
a) Connecting two PostgreSql Databases
b) Copying Data from One PostgreSql database to another
c) Cross-Db References

You hardly find anything that’s readily available and works for your scenario.
Following are the ways to implement Db-links :
a) Using ODBC Link set of functions
b) Using DB Link set of functions

For the former you have to install ODBC link driver whereas the later one could be made use of by using a sql file provided with PostgreSql installation, the file’s name is dblink.sql, the functions in this file shall be created in both the databases.
To insert the sql file into the database you need to type this on your terminal:
psql -U $user -d $db1 -f dblink.sql;
Now decomposing the problem:
1. To fetch data from one table in a database based upon some condition.
2. To migrate the same to the similar table in another database.
So, the following two steps resolve this:
1. Query the data from a table of one database using dblink and copy to standard out(stdout)
2. Copy the data into the similar table of another database from standard in(stdin)
The set of subcommands are as follows: -
1. To connect to a database using dblink, you need to make use of:
dblink(‘dbname=<Name of the database you want to fetch data from>’,’<Query> ‘)

2. To Copy (copy command in Postgres) data from/to stdin/stdout you shall type :
a) copy “data set from query” to stdout
b) copy “data set/table name” from stdin
To read more on Dblinks, please click here. To read more on copy, please click here.


Posted in Miscellaneous, OFBiz, OFBiz and Opentaps, Opentaps | Leave a comment

Customizing ‘Help Pages’ for your application in OFBiz / Opentaps

To get help link’s working for your very own/customized application, you need to setup data accordingly and rest is taken care of by OFBiz. There are three tables associated with this functionality:

a) Data Resource – locates the xml resource from where we need to display the content of a help page.
b) Content – provides content related information
c) ContentAssoc – associates a help page to the Root_Help or one help page to the components’s main Help page (Creates a Tree).

To get this working, you need to:

a) Populate Configuration data into the above mentioned three tables.
b) Create an xml file relevant to each Help Page.

To populate data in above mentioned three tables, we can make use of seed data as under:

OFBiz has a HelpScreens.xml file which governs everything, there’s a screen “showHelp“, which is being called by the “showhelp” request of applications/commonext/webapp/WEB-INF/Controller.xml, this screen has its’ own logic, whenever we click on a help link on a page OFBiz passes “ComponentNameInCapitalLetters_ViewMapNameOfTheVeryRequest” as a query string to the popup function as : “https://localhost:8443/catalog/control/showHelp?helpTopic=”
where “helpTopic” contains the parameters, using which the showHelp screen retrieves the specific content and then includes a screen “showDocument” which then based on the contented for that “mapKey” using the content tag fetches the content.

Posted in OFBiz, OFBiz and Opentaps, Opentaps | Leave a comment

Google Calendar Component using Google API


Opentaps/ofbiz also has calendar implementation we can access through CRMSFA component. Opentaps/ofbiz implements calendar with help of WorkEffort entity. Opentaps/ofbiz also establishes services that allows programmer to manipulate calendar data in from of event or an activity.
Google calendar gives easy access to calendar data over internet. We can access the google calendar through the google calendar API.

Google Calendar allows client applications to view and update calendar events in the form of Google Data Protocol feeds. Your client application can use the Google Calendar Data API to create new events, edit or delete existing events, and query for events that match particular criteria[1].

It will be advantageous if we are able syncronize two clendar together. The syncronization will help the Opentaps user calendar events and data over google calendar.

There are two ways we can syncronize google calendar and opentaps calendar. a) funambol, b) google APIs. In this disccusion we are going to disccuss syncronization through google APIs.

Sync Mapping

Sync Mapping

Illustration 1: Block diagram

The above block diagram depicts the components that plays part in the opentaps and google calendar synchronization. We will be using google-calendar API for synchronization purpose.

The synchronization process can adopt one of the three stategies,

  1. One-way (google-calendar wins) : In this strategy says that the google-calendar data will take presidence over opentaps calendar data. If there are any conflicts between two data taking the same spot of event, then google-calendar data is said to win that conflict.
  2. One-way(opentaps-clendar wins): in this strategy the priority sifts to opentaps-calendar data. If there is conflict between the changes to same data, the opentaps-calendar data wins the round and google-calendar is reflected with the opentaps-calendar data.
  3. Two-way(merge): In this strategy we give equal presidence to both the parites, however the conflits in data is resolved by the timstamp of chage. If the change occured on the opentaps-calendar is recent than the google-calendar then opentaps-calendar wins or the vice versa.

Sync preperation

Sync Preparation

Illustration 2: Preparatoin

Before we can perform the actual syncing operation we have to prepare data of the calendar-objects that needs to be synced. The calendar-data on either side may needed to be created, updated, deleted or maked as synced.

To identify what operation needed to be performed on the calendar data with reference to the strategy we have to follow the table given below. This mapping is called as LUID-GUID mapping.


OT - Opentaps data should reflect to both sides

GC - Google-calendar data should reflect on both calendars

X - Dose not occur

= - Equal

C - Conflict; the resolution of this conflict depeds upon the strategy choosen.

Google-      calendar


New Deleted Updated Synced Dose not exist
New C C C C OT
Deleted C X C C X
Updated C C C C C
Synced C C C = C
Dose not Exists GC X C C X

Class diagram

Class Diagram

Illustration 3: Class Diagram

The above class diagram shows how the google-calendar component is constructed. Each of the calss has specific roles.

  1. GoogleProperties: For storing/handling the google username and password. This class also handles the strategy aginst which the syncronization is going to be performed.
  2. CalendarSyncHelper: This Class has only one purpose, it identifies the operations needed to be perfored on the calendar objects. For example, how many objects are added on the google-calendar that needed to be added onto opentaps-calendar.
  3. CalendarService: This class handles the events to opentaps-calendar. This class is responsible for opentaps ended calendar operations.
  4. GoogleCalendarHelper: This class is responsible for google-calendar ended operations.
  5. CalendarSync: This class is where all the stategies are implemented. The operation sync(), is where the syncronization is perfomed. Depending upon the stategy choosen, one of serverWins(), clientWins() or merge() function gets called.


Using this component is very simple as well. To perform the actual syncing operation you must have following things available to you

  1. Google Calendar username
  2. Google Calendar password
  3. Opentaps Username
  4. Opentaps user password
  5. one of the three stategy selected.

After which point you can just initalize and call the syncrinization operation.

//set the username and password for the sync session
CalendarSync  sync = new CalendarSync();
GoogleProperties properties = new GoogleProperties();
properties.setGoogleUserName((String) request.getParameter("USERNAME"));
properties.setGooglePassword((String) request.getParameter("PASSWORD"));
//syncString result = sync.sync(userLogin, UtilHttp.getTimeZone(request));

Current Limitations

As of the current devleopment of google-calendar coponent is concerned, there are some things still left to be completed such as,

  1. Multiple calendar support : google calendar can have multiple calendars for one user. However at this point the code dose not supports this.
  2. Recurring event support: The event can be set as recurring against a time period such as weekly, daily, monthly etc. This feature is yet to be added onto this component.
Posted in OFBiz, OFBiz and Opentaps, Opentaps | Leave a comment