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

New Template Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-28-2011, 04:23 AM
 
helmsui helmsui is offline
 

Member
  
Join Date: Feb 2011
Posts: 16
 

Default New Template Page

In advance I apologize if this has been documented or discussed on the forums already. If so could someone direct me to it. I was unable to find exactly what I needed.

So I have created a form on the product detail page, to contact us regarding stock levels. This form goes to a PHP page in the root directory of the shopping cart to process and display status (sent, errors for fields required, etc.) I want to be able to display the shopping cart template on this page.

I understand I can create static pages, but they won't be able to process PHP code, correct?
__________________
Version: 4.5
Reply With Quote
  #2  
Old 02-28-2011, 06:26 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: New Template Page

The easiest way to do this is a form that passes the user to a static confirmation page. That way, the user never has to go to the PHP page itself, as you may lose your session data and cart contents that way.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-28-2011, 08:18 AM
 
helmsui helmsui is offline
 

Member
  
Join Date: Feb 2011
Posts: 16
 

Default Re: New Template Page

Thanks for the response. This will work for a successful submission where all required fields are populate and process correctly. However if some errors come up and the user needs to enter more information then they will still need to be directed to a PHP page where I can populate the fields with information already entered and display a dynamic error message.

For clarification, say I wanted to create a page like http://www.example.com/help.php (Help Page). All I want to be able to do is display the template on this page and some sample content. What steps would I need to take order to do this?
__________________
Version: 4.5
Reply With Quote
  #4  
Old 02-28-2011, 11:15 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: New Template Page

You'd need to skin that php page to match your site. Easier way is to use a form like this that uses dynamic error reporting on the page:

http://www.bebosoft.com/products/formstogo/overview/

Includes instructions on how to integrate into X-Cart via static pages.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 02-28-2011, 12:09 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: New Template Page

You can create a new php page that uses the same cart template structure if you look at a php page that already exists, use the same include lines at the top, include the last few lines that points to the Smarty files, create a tpl for that page, then add that new entry to customer/home_main.tpl.

As with creating any new php pages, you'll want to ensure that your site stays secure. That's why it's typically best to stick to pages that already exist when you can.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote

The following user thanks cherie for this useful post:
Steel (10-15-2011)
  #6  
Old 02-28-2011, 05:37 PM
 
helmsui helmsui is offline
 

Member
  
Join Date: Feb 2011
Posts: 16
 

Default Re: New Template Page

I would like to thank you both for your help. Took a little work to figure out since this is my first interaction using the templates and smarty files, but I was able to get it to work. I think my main problem was figuring out that you can't display content via PHP inside the content area and that it is handled through the template files.

Is there any documentation on the smarty system within X-Cart? Guessing I am looking for typical variables used and such.
__________________
Version: 4.5
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 05:28 AM.

   

 
X-Cart forums © 2001-2020