hey all,
i want to write my firste module for the oxid shop.
the basic function should be:
- get / list all products from a category (select box)
- make products dragable and a drop area where u can store 6 or 12 products (sets)
- when the drop box is full i want to send the values of the artikels to the basket
i dont have problems with the native php / jquery programming but i want to learn how to integrate my functionality in the shop. i read the tuts for module programming but be not really sure where i should now start. if you can give me some tipps what modules i should extend for this (get products from categorie, send product info to basket) or some links oder infos it would be extrem helpfull for me …
hope someone can help me
greets
binary
- get / list all products from a category (select box)
This is already coded. This is how the list.tpl (?or alist.tpl?) get’s it’s product lists when you browse categories. Should be able to find the code in list.php. Just have to have a template that displays the names in a select box rather than display all the mini-product templates. Very similar to how the product.tpl displays variants in a select box.
- make products dragable and a drop area where u can store 6 or 12 products (sets)
Modules can only extend existing objects. You’ll probably want a new object to make a new pre-basket bin and then relate this object to the user session, much like the existing basket is attached to the user session.
- when the drop box is full i want to send the values of the artikels to the basket
this could be a function of your new object.
Dig through the oxid wiki first (http://www.oxidforge.org/home). Good examples of modules use in there.
thank you for this usefull information.
im leaving tomorrow the civilisation for a outdoor trip but when i come back i will try this thinks out and write u if it works.
thanks a lot man and have a nice weekend!
greets from west australia
[QUOTE=spurvis;57347] You’ll probably want a new object to make a new pre-basket bin and then relate this object to the user session, much like the existing basket is attached to the user session.[/QUOTE]
IMO you could well handle this with jQuery first locally and without returning to the server for each dragged item… (At least, I would do it that way.)
Collect the OXIDs of all dragged items locally and send them (in the proper format) to the basekt only once.
AFAIK the basket is already capable to handle a multiple article submission…
The http://docs.jquery.com/UI/API/1.8/Draggable should help you with the drag-/drop-part…