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

new/custom php page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 09-27-2009, 12:33 PM
 
masada3336 masada3336 is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 115
 

Default 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!
__________________
4.4.5 - with Customized Smart Template
Reply With Quote
  #12  
Old 09-27-2009, 09:38 PM
 
masada3336 masada3336 is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 115
 

Default 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!
__________________
4.4.5 - with Customized Smart Template
Reply With Quote
  #13  
Old 09-28-2009, 04:22 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #14  
Old 09-29-2009, 07:23 AM
 
masada3336 masada3336 is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 115
 

Default 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?
__________________
4.4.5 - with Customized Smart Template
Reply With Quote
  #15  
Old 09-29-2009, 07:26 AM
 
masada3336 masada3336 is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 115
 

Default 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...
__________________
4.4.5 - with Customized Smart Template
Reply With Quote
  #16  
Old 09-29-2009, 09:48 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 11:36 AM.

   

 
X-Cart forums © 2001-2020