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)
-   -   new/custom php page? (https://forum.x-cart.com/showthread.php?t=49898)

masada3336 09-27-2009 12:33 PM

Re: new/custom php page?
 
Thanks guys - I did get it to work now and am just trying to get the specific php calls working now. I'll let ya know when it's working and what I did to make it work correctly.
Thanks again!

masada3336 09-27-2009 09:38 PM

Re: new/custom php page?
 
OK guys - I have successfully implemented php being used in the tpl file. I can get it to echo "hello world". However, in the tpl file I have a call to http://www.mysite.com/my_search_file.php:
Code:

{include_php file="http://www.mysite.com/my_search_file.php"}
When I go to mysite.com/mysearch.php, when I only have it echo "hello world" it works. When i ask it like I have above to pull the php file, it gives me a smarty error "my_search_file.php is not readable in /mysite/Smarty-2.6.19/Smarty.class.php on line 1092"
Anyone know what gives?
TIA!

JWait 09-28-2009 04:22 AM

Re: new/custom php page?
 
Well, "not readable" is usually a permissions problem, but I'm not sure of the "include_php file" syntax.
Usually it would be a link like <a href="http://www.mysite.com/my_search_file.php">my search file</a>.

Also, look at search.tpl and search.php and the way they interact with each other. In search.tpl it "calls" search.php twice, once at the beginning of the file...
<form method="post" action="search.php" name="productsearchform">
and then again towards the end of the file...
<a href="search.php" class="Search">{$lng.lbl_advanced_search}</a>.

Each instance does something different. The first one asks for user input and then processes it. The second one "opens" search.php so the user can choose which input is relevant. Searching x-cart is a pretty involved process.

masada3336 09-29-2009 07:23 AM

Re: new/custom php page?
 
OK - I've tried everything I know of how to get this php search script to work. I've tried embedding it within {php} {/php} tags in the tpl file, but when I do that, it shows a blank page. So, I've had to refrence it as an external file from the tpl file:
Code:

{include_php file="skin1/customer/new/search.php"}
This is the only way to get it to call successfully, but then I run into a timeout error...shouldn't I be able to put the php code within the tpl files? Is there something that might cause an error I should be looking for that might cause it not to display if it's inside a tpl file, vs. outside include?

masada3336 09-29-2009 07:26 AM

Re: new/custom php page?
 
Oh, the logic for everything is this: xcart/mysearch.php --> skin1/customer/mysearch.tpl --> skin1/customer/new/search.php which is the actual code for the search...

JWait 09-29-2009 09:48 AM

Re: new/custom php page?
 
You really shouldn't have .php files in the skin1 directory. What if you moved it to x-cart root/include (except that is where the original search.php is) - can you rename your "new" search.php to mysearch2.php?


All times are GMT -8. The time now is 12:52 AM.

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