Take the 2-minute tour ×

Here's the setup (using a made-up scenario), but applicable to my real situation: For the purposes of this explanation, let's say that i design T-shirts (Let's call them ShirtA, shirtB, shirtC). Rather than selling them myself, i have several vendors that sell the product for me (we'll call them Vendors X, Y, and Z). I have a table in my Joomla database for the vendors, and a table for the t-shirts. When customers are buying from this vendor, they will visit my site and based on the ID url variable, will display a different vendor's page. Each vendor can choose to sell all of my t-shirts, or only some of them. Additionally, the vendor can override the price that i have set in the t-shirt table, with their own. In the admin section of the component, each vendor needs to be able to select which t-shirt they want to sell, and provide an optional price override.

This is how i imagine it looking... Each vendor will have a column in their table that will contain the serialized data of a multidimensional array. The main array contains a sub-array for each t-shirt that i have in my t-shirt table. Each of those sub-arrays contains all of the override data (price, sizes offered, etc..).

How would i write the model, view, and/or edit page in a Joomla 2.5 component so that a vendor can select all of the options in the component admin page, and have it serialized in a column?

I am sorry if this is poorly explained and PLEASE PLEASE PLEASE don't hesitate to ask if you need further information in order to assist me. Thanks!

share|improve this question
try out virtuemart, rather than coding everything from scratch, you can set up vendors & prices, and there's a lot of others possibilities in it, there are also addons available, and if it's not enough you can edit/hack the component ... –  HamZa Jun 6 '12 at 8:28

1 Answer 1

up vote 0 down vote accepted

I hate to say it, but I don't think that there is a "standard" method to do this in Joomla 2.5. Joomla has all kinds of ways to interact with the database and use their standard classes, but none of the classes are designed to work with serialized data to the best of my knowledge, so you would be stuck building all of the pieces by hand.

That being said, in general the model, should handle retrieving and storing the serialized data, the view would request any data in the database from the model, and the edit page should unserialize the data and display it in a way that your vendors can add their overrides. Beyond that it would be up to you to code each piece in your own way.

share|improve this answer

Your Answer


