Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

home_main.tpl and the $main value

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-01-2003, 12:29 PM
  Satyr's Avatar 
Satyr Satyr is offline
 

Member
  
Join Date: Jan 2003
Location: Lexington, KY
Posts: 20
 

Default 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:
{elseif $main eq "anonymous_checkout"} {include file="customer/main/anonymous_checkout.tpl"}

what is "anonymous_checkout"? Where is this value coming from?
__________________
and stuff,...
Reply With Quote
  #2  
Old 02-01-2003, 01:00 PM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

the actual PHP files. They are from a SMARTY ASSIGN function.
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #3  
Old 02-01-2003, 05:32 PM
  Satyr's Avatar 
Satyr Satyr is offline
 

Member
  
Join Date: Jan 2003
Location: Lexington, KY
Posts: 20
 

Default

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,...
Reply With Quote
  #4  
Old 02-06-2003, 03:11 PM
  Satyr's Avatar 
Satyr Satyr is offline
 

Member
  
Join Date: Jan 2003
Location: Lexington, KY
Posts: 20
 

Default

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:
$memtype
each link on the main nav bar sets the variable for $memtype with good ol
Code:
?memtype=
in the url.
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:
$Row[firstname]$Row[lastname].html
The ony problem was I neened to pass htis variable back through the home_main.tpl so I could get the users page to show up inside of the middle table in x-cart (I really wanted it to show up in something that looked like the "featured products" box.
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:
www.site.com/search.php?user=$Row[firstname]$Row[lastname]
the search.php it is leading to is the index.html page from the catalog with a small bit of code added in the "featued Products" table. An include statement that looks something like
Code:
include($user.php);
sorry i dont have the code in front of me at the moment so some of this might be a little off.
So thats about it. If someone would like to see code let me know.
__________________
and stuff,...
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:09 PM.

   

 
X-Cart forums © 2001-2020