Saturday, August 8, 2015

Group Prices in Opencart

Hi, Reader!

Recently I met an extension which allowed to define customer group prices under the main product price on the product edit page. Here is a screenshot from opencart 2.0.3.0.


I understand that it might be unclear how to define customer group prices in opencart for new users, but who could believe that this was a commercial extension sold about 100+ times? Amazing marketing, I am impressed...

If you are not sure how to define these prices let me explain. You should use the 'Special' tab on the product edit page. See a screenshot below where the same prices are defined on the 'Special' tab.



But returning to the mentioned extension I have to say that after examining the code I found out another "cool" thing. The extension does not use special prices at all and saves all prices in a serialized array of the product table. Therefore it ignores special prices completely. It is a very bad practice leading to incompatibility issues and other bad results like issues with filtering by prices.

I agree that it may be useful to define customer group prices on the 'General' tab under the main price, but they should be linked to special prices permanently. Maybe I should write a similar extension and publish it at the minimum possible price on the marketplace. Your thoughts?