VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: shakir on November 12, 2011, 16:26:57 PM

Title: Is it possible to display products by size?
Post by: shakir on November 12, 2011, 16:26:57 PM
Is it possible to somehow setup a drop down search that will display all products in a category that match a certain size (for clothing for example)
A radio box for size 6,8,10,12 that will then only display stock available in those sizes.

Currently Im using custom fields "Size" on each product in category 'dresses'.
Would be great to somehow display only size selected.

The other problem I guess will be that custom fields dont allow allocation of stock control (availability) I dont think?
So perhaps will need child products to do this part?

Its a very common scenario that I need. So I hope there is a way to do this or perhaps a search module is in the makings soon after official release.

If anyone has any ideas please feel free to share :)
Wanting it to work like the "Refine By" box in top left of this page http://www.asos.com/Women/Dresses/Cat/pgecategory.aspx?cid=8799
Again, will need to integrate and assign stick levels for each size of a certain product (dress).

Thanks for any advice or help.
Title: Re: Is it possible to display products by size?
Post by: Stephen Roberts on November 13, 2011, 00:25:41 AM
I actually wrote code to do something very similar to what you're asking for. Here's my example, on the right-hand side.

http://www.integritymusicdirect.com/index.php?option=com_virtuemart&page=shop.browse&category_id=11&Itemid=29&vmcchk=1&Itemid=29

A couple of days ago, I ported my solution to VM2 and wrote a couple of plugins/modules to get the job done. It doesn't do any stock control though. Let me know if you're interested in taking a look at my code.
Title: Re: Is it possible to display products by size?
Post by: shakir on November 13, 2011, 07:22:48 AM
Hi Stephen.
Looks interesting. Would love to see how you made it.
Perhaps it can be adapted somehow to filter custom fields?
Title: Re: Is it possible to display products by size?
Post by: Stephen Roberts on November 13, 2011, 16:45:29 PM
Possibly. I created a whole separate system for it that includes:


It's definitely not a trivial set of code. I'm debugging a few things on it right now. Let me finish that and I'll post what I have so far. Should be done by tomorrow. I would love some thoughts and help on possibly developing this further.
Title: Re: Is it possible to display products by size?
Post by: shakir on November 13, 2011, 17:10:27 PM
Sounds very cool!
Title: Re: Is it possible to display products by size?
Post by: Milbo on November 14, 2011, 13:08:40 PM
Use the search in a category, then the customfield search pops up (dont know why the others wrote it that way).

There will be a new customfield plugin with stockable custom variants. So afaik everything is already done in the code. But I am quite sure that stephenroberts plugins are worth looking at.
Title: Re: Is it possible to display products by size?
Post by: shakir on November 14, 2011, 15:24:03 PM
Hi Milbo. That sounds perfect.
Any idea when that will be available?
Title: Re: Is it possible to display products by size?
Post by: Stephen Roberts on November 15, 2011, 01:15:58 AM
WHEW! Finally got all this working. In the attached file, you'll find 3 plugins and 2 modules as well as some files that need to be replaced (due to bugs in the current release). I've included a README with some basic installation and usage instructions. Please note this ONLY works on VM2 sub release M and has only been tested on Joomla! 1.5.24, so I'm not sure the compatibility with later versions of Joomla! at this point. Also, please keep in mind this is a VERY early version so I'm sure there are lost of issues. It does what I currently need it to do, so I'm not too worried about it right now.

Let me know if you have any thoughts/questions!

[attachment cleanup by admin]
Title: Re: Is it possible to display products by size?
Post by: Stephen Roberts on November 15, 2011, 05:49:22 AM
I made a couple of changes and now it's working in Joomla! 1.7.3, so imagine it would also work in Joomla! 1.6.x. I need to do some cleanup, especially for the language files. I'll finish that and post a Joomla! 1.5, 1.6, and 1.7 compatible version tomorrow.
Title: Re: Is it possible to display products by size?
Post by: Stephen Roberts on November 15, 2011, 19:09:33 PM
As promised, I've cleaned up the code a lot and tested in both Joomla! 1.5.24 and 1.7.3. In addition, I added the search plugin that allows filtering of search results as well. Enjoy!

[attachment cleanup by admin]
Title: Re: Is it possible to display products by size?
Post by: shakir on November 16, 2011, 07:46:48 AM
Excellent! Thanks. Will check it out :)
Title: Re: Is it possible to display products by size?
Post by: Enter_PL on January 10, 2012, 10:08:35 AM
This plugin looks very promising, but I could not run it in VM 2. (J1.7 and VM 2.0.0).
Does anyone managed to implement a solution is in the final version of the VM?
Title: Re: Is it possible to display products by size?
Post by: Stephen Roberts on January 10, 2012, 17:40:34 PM
I've made many changes since posting that original version. Try this file and PM me if you need help with it.

[attachment cleanup by admin]