| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
home_main.tpl and the $main value | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
home_main.tpl and the $main value
ok, im getting just a little flustered here. Im trying to figure out the home_main.tpl file but I cant for the life of me figure out where the $main value is coming from. For example:
Code:
what is "anonymous_checkout"? Where is this value coming from?
__________________
and stuff,... |
|||||||||
#2
|
|||||||
|
|||||||
the actual PHP files. They are from a SMARTY ASSIGN function.
__________________
Joshua Sowin ...taking things one TPL at a time. |
|||||||
#3
|
|||||||||
|
|||||||||
ok, that makes more sence. How does this work though?
Maybe I should explain what Im trying to do (I might be going at this all wrong) I have set up a a new page that seaches the "customers" section of the database for a certain user type and then displays a table of information about these customers (ie: first name, lastname, country). This all works fine except each of these customers is going to have a unique page with more information about them (ie: history, pictures of themselves, contact info). I was wanting to keep all of this in x-cart and not have to use any popup windows. sooo,... I have a link setup in the table that looks loke this Code:
so im getting a user specific link generated by the mysql query. The link works but Im not quite sure how to pass this back through x-cart to get the users page to display. any guesses?
__________________
and stuff,... |
|||||||||
#4
|
|||||||||
|
|||||||||
OK, I think I got this all figured out now (just a few more lines of code to throw down and I should be golden). For anyone who would like to know how this is done. Heres my basic logic.
First off I was going about it all wrong. trying to pass a php variable throught a tpl file and back to a php script was just too much for tiny skull, so I cheated. I took the index.html file from my x-cart generated catalog to give me something to play with. So here is how it works. On the main page of x-cart I added a new section to the nav bar on the left (just like adding extra pages) This gave me a section to in the nave bar to link to the non x-cart related content that needs to be on the site. 2 of the links in this section are to find certified practitioners of Interior Alignment (those that pay there due's that is). So I set up 2 member types via x-cart (Practitioners and Teachers). This way the store owner has total control over who is listed as a Practitioner and who is listed as a Teacher. This was the easy part. I built a php page that searches the database for customer listed as Code:
Code:
The url these links point to is actually the index.html page changed to index.php with the mysql query added in there. The output from this query is displayed nicely in the center most table of the page. So,...that wasnt so hard right? Well I still have a problem. Each Practitioner and each Teacher also has to have a link to a "more info" page. This is where I ran into trouble before. The last time I posted, the page that was running the mysql query was linked via the home.php method. Just like setting up and extra blank page (ie: it led to a tpl page with the php code in it). This worked fine accept I needed to have 2 different pages for the 2 different searches (didnt make much sence to me). I also could not for the life of me figure out how to set up the url for the mysql generated table with the Teachers and Practitioners info on it. Each page needed to have a unique URL based on some peice of info that the mysql query could grab, for example Code:
So this is where my cheat came in. once you click the link to find a Practitioner or Teacher you are no longer in x-cart. A few lines of code here and there keep the session ID going but there is no more dealing with smarty. The link that the mysql query generates is now functioning more like Quote:
Code:
So thats about it. If someone would like to see code let me know.
__________________
and stuff,... |
|||||||||
|
|||
X-Cart forums © 2001-2020
|