| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Create a New php Page? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I want to create a new php page that uses the template system of xcart.
I figured I could copy the contact us one, but it doesn't seem like it is going to work. I don't believe I can start from scratch simply because I need to pass along the sessions and things like that. Is there a page I can copy to start with, and then just create a few tpl files for the main content area? I want something similar to what appears on home.php, but there looks to be a lot of code inside that file that I would not want to use. This has to have been answered in the past, but the search didn't turn up anything.
__________________
Product: X-Cart Gold Current version: 4.0.14 Additional Mods: X-Affiliate |
|||||||
#2
|
|||||||
|
|||||||
![]() If it were me I would copy the register.php and the include/register.php and work from there. You will notice the include/register.php is called into the root register.php, and they are working off of skin1/customer/main/register.tpl.
If you follow that setup, you should be fine with creating your own new php page ;o) Keep in mind you can also do similar things with "static pages" - but not sure what your goal is. Working with the static pages would be much easier...
__________________
Instinctual 8,000 feet up in the Rocky Mountains of Colorado X-Cart Versions 3.5.x - 4.0.x IF you xcart, THEN you prosper, ELSE you fail. ELSEIF xcart fails, THEN you fix it, all the WHILE {loop}\'ing {section}\'s to feed your $smarty mind. |
|||||||
#3
|
|||||||
|
|||||||
![]() Thanks! I will give the register pages a try.
My goal is just to have a page that uses the smarty template system, I figured a PHP page would be the best to do this. Thanks again ![]()
__________________
Product: X-Cart Gold Current version: 4.0.14 Additional Mods: X-Affiliate |
|||||||
#4
|
|||||||
|
|||||||
![]() I think it is going to have way too much useless information.
The include/register.php page contains about 900 lines of php code ![]() The reason why I did not want static pages is because I want to be able to use webmaster mode to make text changes. Also, I don't see anywhere that tells register.php to use register.tpl template ![]()
__________________
Product: X-Cart Gold Current version: 4.0.14 Additional Mods: X-Affiliate |
|||||||
#5
|
|||||||
|
|||||||
![]() I would have thought a lot more people would have known how to do this. Here are all the steps:
1. Create 'new_page.php' file in the '<xcart_root_dir>' with the following content : --------------------------------------- <?php require "./auth.php"; # Assign Smarty variables and show template $smarty->assign("main","new_page"); func_display("customer/home.tpl", $smarty); ?> --------------------------------------- 2. Open '<xcart_root_dir>/skin1/customer/home_main.tpl' template and add following code : --------------------------------------- {elseif $main eq "new_page"} {include file="new_page.tpl"} --------------------------------------- after the following fragment: --------------------------------------- {elseif $smarty.get.mode eq "unsubscribed"} {include file="main/unsubscribe_confirmation.tpl"} --------------------------------------- 3. Then create 'request_catalog.tpl' template in the '<xcart_root_dir>/skin1/' folder with the following content: --------------------------------------- {$lng.lbl_new_page} --------------------------------------- Then, when the customer opens the 'new_page.php' URL the standard X-Cart page will appear with the '{$lng.lbl_brochures_text}' language variable text in the central area.
__________________
Product: X-Cart Gold Current version: 4.0.14 Additional Mods: X-Affiliate |
|||||||
#6
|
|||||||||
|
|||||||||
![]() dont forget to use the 'code' button when making a post. makes it much easier to read
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. ![]() ![]() |
|||||||||
#7
|
|||||||||
|
|||||||||
![]() You'll want to include your categories, etc., in your php file too. And set the location:
Code:
|
|||||||||
#8
|
|||||||
|
|||||||
![]() I didn't put each bit into code tags because I thought it would have looked horrible.
Jon, can you explain a bit about this code segment? Code:
__________________
Product: X-Cart Gold Current version: 4.0.14 Additional Mods: X-Affiliate |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|