I'm asking for a best practice tip to achieve the following in A4D:
Have 3 4D database tables named cart, backorder, stock.
Want to create 2 new temporary tables "final_cart" and "final_backorder",
that differ from cart and backorder in, that products in cart with no stock
are moved to final_backorder and products in backorder with stock are moved
to final_cart.
As this is solely for preview on the web, I do not want to generate real 4D
tables for that task.
I initially thought about generating cached rowsets from cart and backorder
and adjust the numbers with callbacks. I've hit a block when it comes to add
new rows in preview_backorder for items in cart with no stock, that are not
already in backorder. I'd had to add individual rows to the rowset manually
and I do not see a command in A4D to do that.
Next I tried to loop through both tables and populate collections for each
field. That works but frankly I do not see any benefit in compare to using
standard 4D arrays as the key is a numeric index anyways.
Tried to use 2 collections "final_cart" and "final_backorder" and add values
via $final_cart{"itemno"}{} but that didn't work. Maybe I have to create the
arrays for each field first and then assign the array to the collection. But
then again, where is the point vs. just using a bunch of arrays.
I have a feeling, that you can make this more elegantly in A4D, but may be
I'm wrong.
Like to hear your comments.
Peter
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/