Well I must be on some good drugs because I think I just figured out a way to use some magical javascript sorcery to make adding tabs to your product info page as easy as adding one variable and one requires reference.
I fear tho that it might open a whole new can of worms. So I think I will keep the safe version and maybe release this magickery version as a try-at-your-own-risk.
Fear not, as there is no permanent damage to be done.. and its all in one file so if you run into a problem, you could always revert to the safe(r) one.
Currently, the "Safe" one works by:
1. requiring the tabbed prod lite module file which performs all the calculations and saves it to a single variable.
2. add echo $variable to the product info template
3. add 'IF' logic to each existing location where the attribs, add to cart, etc stuff would be so you don't show it twice.
The last step is the ugly part, as it requires many changes to custom product info files. Tho I will of course include a pre-modified copy based on zen-carts default version.
The "magickery" one works by:
1. requiring the tabbed prod lite module file which performs all the calculations and saves it to a single variable. It also uses fake id's for the tabbed version of the existing divs. Then, using javascript, it manipulates the real div ids to a fake name with display:none. And manipulates the fake divs to use the real names with display:block.
2. add echo $variable to the product info template
That's it. There would be no more modifications to make to the product info file except for those 2 simple changes because the javascript would finagle all the values around.
The way I do it also prevents duplicate ids for validation.
And, if javascript is disabled, it will simply not show the tab box and just default to the normal page style as if tabs never existed.
Magic indeed!
I still gotta put it all into the code to try it, I've got it working for one section tho, so as long as I don't run into any other craziness, it might just work!
Stay Tuned!
I have still not worked on the ordering thing. I have an idea for it, but it seems to be stuck at the back of my mind so I am waiting patiently for my mind to send it front and center.
Bookmarks