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

New Static PHP Page with mySql Query

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-19-2013, 12:48 PM
 
macak49 macak49 is offline
 

Newbie
  
Join Date: Aug 2013
Posts: 9
 

Default New Static PHP Page with mySql Query

Hello,

I am working on creating a new php static page for the xcart instance I am building. The goal of this page is to dynamically display the current flat rate shipping charges available.

So far the page looks nice and the sql query works, it just displays either above or below the entire page. How do I get the sql query output to display in the center area that it should? (where content is normally displayed... products, static page text.. etc)

This is the code I have so far, the included php file for shiprates.php is the sql query.

Code:
<?php require './auth.php'; include $xcart_dir . '/include/common.php'; include './shiprate.php'; $smarty->assign('meta_page_type', 'C'); $smarty->assign('meta_page_id', $cat); $smarty->assign('location', $location); if ( isset($is_ajax_request) || isset($open_in_layer) ) { $smarty->assign('template_name', 'customer/main/pages.tpl'); func_display('customer/help/popup_info.tpl', $smarty); } else { func_display('customer/home.tpl', $smarty); } ?>

I'm pretty new to coding in x-cart and this is my first complete page creation.

Thanks!
__________________
Xcart Gold 4.7.4
Reply With Quote
  #2  
Old 08-19-2013, 04:08 PM
  cherie's Avatar 
cherie cherie is offline
 

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

Default Re: New Static PHP Page with mySql Query

I think we're missing the code that builds and assigns the list of methods (shiprate.php). You can use something like foreach in Smarty to loop through the list of rates wherever you need it on the tpl.

If it's just another Static Page then create the new page, add your code to pages.php, enable "parse smarty tags on static pages", then add your smarty code where you want it on the static page. You shouldn't need to build a stand-alone page unless you really want to.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
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 08:32 AM.

   

 
X-Cart forums © 2001-2020