| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
new/custom php page? | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi there.
I have bought a new search program, and need to modify a search page. I'd like to insert some php code into it, but search.php has a lot of code and calls and programming logic that I can't seem to understand (I have tried deleting code line by line, but always get some kind of error). Is there some basic layout for a php page (that I can get a code snippet) that is basically a blank page and will allow me to put standard php code into? For that matter, is there a way to have a custom php page that has the template with "hello there" even on it in regular php, not calling a tpl page? Thanks a bunch!!!
__________________
4.4.5 - with Customized Smart Template |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Here is an example taken from
http://www.w3schools.com/PHP/DEfaULT.asP <html> <body> <?php echo "hello there"; ?> </body> </html> To get your content to be "surrounded" by your cart's design however you will need to create a template ("myphp.tpl")and include it by putting {include file="myphp.tpl"} in x-cart wherever you want your content to be displayed. Its not quite as simple as that but, not really much more difficult either. You may or may not need the "html" and/or "body" tags depending on where you place it in x-cart. Example: name the following myphp.tpl and save it to the root directory of x-cart Code:
__________________
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 |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thanks a million J!
I'd like the page to sit alone though - not be a template that's included within the home page - just like either the cart.php, search.php, news.php, or any of the other php pages that only have one type of content in them. If I did this correctly, it shows on the main template on each page, not when I call xcart/mypage.php right? Thanks again!
__________________
4.4.5 - with Customized Smart Template |
|||||||
#4
|
|||||||||
|
|||||||||
![]() A lot depends on how you want to access it. You could just make a static page and include a link in the speed bar. That will put your content in the "center" area of your cart (similar to your FAQ page).
Your php will probably need some of the "includes" that are used by x-cart. Look at just about any php script x-cart uses (they are near the top... (require "./auth.php"; require "./security.php"; whatever ones seem necessary).
__________________
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 |
|||||||||
#5
|
|||||||||
|
|||||||||
![]() It sounds like you are working on a "search" module, but you didn't specify if it was for the customer or admin. Anyway, what if you used the present link ("advanced search") and linked it to your new "my_search.tpl and my_search.php" using the existing search template and search.php and cloned them, putting in your own code.
I would be interested to see what you come up with.
__________________
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 |
|||||||||
#6
|
|||||||
|
|||||||
![]() Yep - I am trying to put together a new search module for my site. I've tried to dissect the search.php page. I've commented out just about everything to just a bare-bones page, but when I do that I get a "page not found" error.
I guess what I'm looking for is how to build a basic php page...what elements have to go in it, and where they have to be. I've gleaned from these forums that I need a php page with an include to a tpl file? my search.php is this: Code:
I flushed my templates, but just for a test my tpl file: Code:
Where am I screwing up?
__________________
4.4.5 - with Customized Smart Template |
|||||||
#8
|
|||||||||
|
|||||||||
![]() Umm.. try looking at skin1/customer/search.tpl.
Note that it has some "search" parameters and then at the bottom of the code (after the button) it has Code:
Code:
__________________
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 |
|||||||||
#9
|
|||||||||
|
|||||||||
![]() I'm no wiz at php but I think the
require $xcart_dir."/skin1/mysearch.tpl"; is wrong. There should be a include skin1/search.tpl that calls mysearch.php, not the other way around (I think). A .tpl is pretty much html, and html can include php, but I'm not sure about the other way around. I know php can include html code, that can be displayed, but I'm not sure that entire .tpls can be used.
__________________
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 |
|||||||||
#10
|
|||||||||
|
|||||||||
![]() Quote:
If you want this page displayed on customers side in skin1/cusotmer/home_main.tpl you have to specify which template to load when your new.php is called {if $main eq "_mysearch_"} {include file="path_to_file/mysearch.tpl"} {/if} Just look at the if statement there you will get the idea
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|