X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   TPL files and their links to PHP files (https://forum.x-cart.com/showthread.php?t=44191)

AMMoyer 12-11-2008 08:21 AM

TPL files and their links to PHP files
 
I'm in the midst of building a new template and trying to understand how the tpl files link to the php files they are associated with. For example, I look at search.tpl in the main directory (there are 3 others and 2 of them may be the same?) and there is no less than 4 search.php files located in various places.

I guess my main question is: How does the info from the search form know where it's getting posted too? Or how can I trace the path?

If I have a new tpl file located in skin\, where should the corresponding PHP file be located?

Thanks,
Adam

Vetrivel 12-11-2008 09:31 AM

Re: TPL files and their links to PHP files
 
Hi,

1.
Quote:

How does the info from the search form know where it's getting posted too?
form action tag will say where to post.


2.
Quote:

how can I trace the path?

They will link the php and tpl file using the smarty variables.
EX:
PHP->
you can find the smarty variable in each php file like this
$smarty->assign("main","search");
TPL:In common templete
There will be file called common_templete.tpl in skin1/root
like this
{else if $main eq search}
{include file="tpl file name"}



Quote:

Originally Posted by AMMoyer
I'm in the midst of building a new template and trying to understand how the tpl files link to the php files they are associated with. For example, I look at search.tpl in the main directory (there are 3 others and 2 of them may be the same?) and there is no less than 4 search.php files located in various places.

I guess my main question is: How does the info from the search form know where it's getting posted too? Or how can I trace the path?

If I have a new tpl file located in skin\, where should the corresponding PHP file be located?

Thanks,
Adam


AMMoyer 12-11-2008 10:09 AM

Re: TPL files and their links to PHP files
 
Thanks for the help.

So in skin1\customer\search.tpl this line of code:

<form method="post" action="search.php" name="productsearchform">

Which of the 4 search.php files does it post the data to and is that connection made in the corresponding php file?

Adam

Vetrivel 12-11-2008 07:23 PM

Re: TPL files and their links to PHP files
 
hi,
If you currently in customer side then this form is submited to xcart root/search.php


Quote:

Originally Posted by AMMoyer
Thanks for the help.

So in skin1\customer\search.tpl this line of code:

<form method="post" action="search.php" name="productsearchform">

Which of the 4 search.php files does it post the data to and is that connection made in the corresponding php file?

Adam



All times are GMT -8. The time now is 03:42 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.