Jump to content
xt:Commerce Community Forum

PC-Konfigurator


tmj

Recommended Posts

Hallo!

Ich bin auf der Suche nach einem PC-Konfigurator und bin auf die Contribution Custom Computer Creator f?r osCommerce gesto?en.

Nun w?rde ich gerne die Contrib so umschreiben, dass sie auch unter xtc l?uft. Den Adminbereich habe ich soweit hinbekommen.

Jedoch wird die Contrib im Shopbereich nicht innerhalb vom Template, sondern oben ?ber dem Shop angezeigt wird. Wie kann ich den Code am besten mit den Smarty Tags umschreiben, dass die Contrib l?uft und im Template angezeigt wird?

Ich poste mal den Code. Wenn jemand Vorschl?ge hat oder weiss wie man die smarty Tags einf?gen kann w?rde ich mich ?ber eine Antwort sehr freuen.


 require('includes/application_top.php');

 if ( file_exists(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT)) {

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

 }

 include(DIR_WS_INCLUDES . 'functions/custom_computer.php');

 $breadcrumb->add(AMD_W_NAVBAR_TITLE, tep_href_link(FILENAME_AMD_W_CUSTOM_BUILD, '', 'NONSSL'));

//start - read from database (gets the list of avalible catergories from the database and assigns them to arrays)

$tepcateg = array();

$grab = tep_db_query("SELECT ccc_cname FROM ccc Order BY ccc_id");

if (!$grab) {

 echo("<P>Error performing query: " . tep_db_error() . "</P>");

 exit();

}

while ( $stored = tep_db_fetch_array($grab) ) {

	array_push ($tepcateg, $stored["ccc_cname"]);

}

$tepitem = array();

$grab = tep_db_query("SELECT ccc_shortname FROM ccc Order BY ccc_id");

if (!$grab) {

 echo("<P>Error performing query: " . tep_db_error() . "</P>");

 exit();

}

while ( $stored = tep_db_fetch_array($grab) ) {

	array_push ($tepitem, $stored["ccc_shortname"]);

}

$pre = array();

$grab = tep_db_query("SELECT ccc_pre FROM ccc Order BY ccc_id");

if (!$grab) {

 echo("<P>Error performing query: " . tep_db_error() . "</P>");

 exit();}

while ( $stored = tep_db_fetch_array($grab) ) {

	array_push ($pre, $stored["ccc_pre"]);

}

//end - read from database

$number = count($tepitem); //counts total number of categories for parts selection

$h = array(); for ($i = 0; $i < $number; $i++) $h[] = $i; //indexing array

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<?php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

 require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

 require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?> 

 <title><?php echo TITLE ?></title>

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v1.0

?>

<?php

}

?>

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<script language="JavaScript" type="text/javascript">

<!--

window.status="Cart: <?php echo $cart->count_contents(); ?> Items <?php echo $currencies->format($cart->show_total()); ?> <?php echo $cart->show_weight() ?>Kg "

// -->

</script>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

 <tr>

  <td class="main" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

  </table></td>

<!-- body_text //-->

<?php /*Create page and draw button for enabling/disabling pictures*/

$greeting = "Build-Your-Own Custom Built Computer";

?>

   <td class="main" width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

   <tr>

    <td class="main" ><table border="0" width="100%" cellspacing="0" cellpadding="0">

  <tr>

      <td class="main"><br><?php echo $greeting;?></td>

 	<?php if ($HTTP_POST_VARS['pictures'] == 1){?>

 	<tr><form action="build.php?page=1" method="POST">

 	<input type="submit" name="submit" value="Disable Pictures"><br><small><em>note:Disabling Pictures Resets This Form</em></small>

 	<input type=hidden name="pictures" value=0>

      <?php if ($HTTP_GET_VARS['error'] != ''){?>

      <input type=hidden name="motherboard" value=<?php echo $HTTP_GET_VARS['error'];?>>

      <?php }else{?>

      <input type=hidden name="motherboard" value=<?php echo $HTTP_POST_VARS[$tepitem[0]];?>>

      <?php }?>

      </form></tr>

      <?php }else{?>

 	<tr><form action="build.php?page=1" method="POST">

 	<input type="submit" name="submit" value="Enable Pictures"><br><small><em>note:Enabling Pictures Resets This Form</em></small>

 	<input type=hidden name="pictures" value=1>

      <?php if ($HTTP_GET_VARS['error'] != ''){?>

      <input type=hidden name="motherboard" value=<?php echo $HTTP_GET_VARS['error'];?>>

      <?php }else{?>

      <input type=hidden name="motherboard" value=<?php echo $HTTP_POST_VARS[$tepitem[0]];?>>

      <?php }?>

      </form></tr>

      <?php }?>

 	<td class="main" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

     </tr>

    </table></td>

   </tr>

   <tr>

    <td class="main" ><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

   </tr>

<?php

require('java.php');

?>

<form name="builds" action='custom_checkout.php' method=post>

<table border=0 bordercolorlight="#C6C6D6" bordercolordark="#C6C6D6" bgcolor="#f8f8f9">

<?php for ($i=0; $i<$number; $i++) { /*start - for loop to draw build selection form using list of categories*/?> 

<tr>

<td class="main" width="10%"><?php echo $tepcateg[$i];?></td>

<td class="main" width="65%"><?php echo tep_get_parts_list($tepitem[$i], '', $HTTP_POST_VARS[$tepitem[$i]], $HTTP_GET_VARS['error']);?></td>

<td class="main" width="25%">

<p align="right">

<?php if ($HTTP_POST_VARS["pictures"] == 1){ 

if ($HTTP_GET_VARS['error'] != ''){?>

<img src=<?php echo DIR_WS_IMAGES . $HTTP_POST_VARS["$pre[$i],pic"];?> name="pictures" width=""height=""border="5"><br><INPUT TYPE="button" NAME="popup" VALUE="Enlarge Picture" onClick="window.open(document.builds.<?php echo $tepitem[$i];?>.options[document.builds.<?php echo $tepitem[$i];?>.selectedIndex].name, 'newWin', 'location=no, menubar=no,directories=no, scrollbars=no, resizable=no, status=no,width=, height=')">

<center><b>$</b><input type="text" name="pricing<?php echo $h[$i]?>" value=<?php echo $HTTP_POST_VARS["$pre[$i],price"];?> size="7" READONLY></center>

<?php }else{?>

<img src="images/nosel.jpg" name="pictures<?php echo $h[$i]?>" width="130"height="100"border="5"><br><INPUT TYPE="button" NAME="popup" VALUE="Enlarge Picture" onClick="window.open(document.builds.<?php echo $tepitem[$i];?>.options[document.builds.<?php echo $tepitem[$i];?>.selectedIndex].name, 'newWin', 'location=no, menubar=no,directories=no, scrollbars=no, resizable=no, status=no,width=400, height=400')">

<center><b>$</b><input type="text" name="pricing<?php echo $h[$i]?>" value="Pricing" size="7" READONLY></center>

<?php }}else{

if ($HTTP_GET_VARS['error'] != ''){?>

<center><b>$</b><input type="text" name="pricing<?php echo $h[$i]?>" value=<?php echo $HTTP_POST_VARS["$pre[$i],price"];?> size="7" READONLY></center>

<?php }else{?>

<center><b>$</b><input type="text" name="pricing<?php echo $h[$i]?>" value="Pricing" size="7" READONLY></center>

<?php } } ?>

</td>

</tr>

<?php } /*end - for loop*/?>

<?php //start - define constants and draw radio buttons for warrenty and build choice settings ?>

<tr>

<td class="main" width="10%">Extended Warranty</td>

<td class="main">

Please Select Below<br>

<?php if ($HTTP_GET_VARS['error'] != ''){

if ($HTTP_POST_VARS['warrantysel'] == 0){?>

<?php echo tep_draw_radio_field('warranty', "0.00", 'checked', "onClick=update_warranty(this.value)");?>Standard 1 Year<br>

<?php echo tep_draw_radio_field('warranty', "150.00", '', "onClick=update_warranty(this.value)");?>Extended 2 Year

<td class="main" width="25%">

<p align="right">

<center><b>$</b><input type="text" name="pricing3a" value="0" size="7" READONLY></center>

</td>

<?php }else{?>

<?php echo tep_draw_radio_field('warranty', "0.00", '', "onClick=update_warranty(this.value)");?>Standard 1 Year<br>

<?php echo tep_draw_radio_field('warranty', "150.00", 'checked', "onClick=update_warranty(this.value)");?>Extended 2 Year

<td class="main" width="25%">

<p align="right">

<center><b>$</b><input type="text" name="pricing3a" value=<?php echo $HTTP_POST_VARS['warrantysel'];?> size="7" READONLY></center>

</td>

<?php } }else{?>

<?php echo tep_draw_radio_field('warranty', "0.00", 'checked', "onClick=update_warranty(this.value)");?>Standard 1 Year<br>

<?php echo tep_draw_radio_field('warranty', "150.00", '', "onClick=update_warranty(this.value)");?>Extended 2 Year

<td class="main" width="25%">

<p align="right">

<center><b>$</b><input type="text" name="pricing3a" value="0" size="7" READONLY></center>

</td>

<?php };?>

</td>

</tr>

<tr>

<td class="main" width="10%">Building The Computer</td>

<td class="main">

<?php if ($HTTP_GET_VARS['error'] != ''){

if ($HTTP_POST_VARS['buildsel'] == 0){?>

<?php echo tep_draw_radio_field('build', "0.00", 'checked', "onClick=update_build(this.value)");?>Build Yourself<br>

<?php echo tep_draw_radio_field('build', "60.00", '', "onClick=update_build(this.value)");?>Have Us Build It

<td class="main" width="25%">

<p align="right">

<center><b>$</b><input type="text" name="pricing4a" value="0" size="7" READONLY></center>

</td>

<?php }else{?>

<?php echo tep_draw_radio_field('build', "0.00", '', "onClick=update_build(this.value)");?>Build Yourself<br>

<?php echo tep_draw_radio_field('build', "60.00", 'checked', "onClick=update_build(this.value)");?>Have Us Build It

<td class="main" width="25%">

<p align="right">

<center><b>$</b><input type="text" name="pricing4a" value=<?php echo $HTTP_POST_VARS['buildsel'];?> size="7" READONLY></center>

</td>

<?php } }else{?>

<?php echo tep_draw_radio_field('build', "0.00", '', "onClick=update_build(this.value)");?>Build Yourself<br>

<?php echo tep_draw_radio_field('build', "60.00", 'checked', "onClick=update_build(this.value)");?>Have Us Build It

<td class="main" width="25%">

<p align="right">

<center><b>$</b><input type="text" name="pricing4a" value="60.00" size="7" READONLY></center>

</td>

<?php }; //end - define constants ?>

</td>

<td class="main" width="25%">

<p align="right">

</td>

</tr>

<tr>

<td class="main" align="right"><b><font Size="3">SubTotal:</b></font></td>

<td class="main" ><b>$</b><input type="text" name="Total" value="SubTotal" size="7" READONLY><br></td>

</tr>

<tr>

<td></td>

<td class="main" ><input type=submit value='Submit Form'><input type=hidden name=motherboard value=<?php echo $tepitem[0];?>><input type=hidden name=pictures value=<?php echo $HTTP_POST_VARS["pictures"];?><input type=reset value='Reset Form'></form>

<b><br><font size=1>*Prices Subject To Change Without Notice.</font></b></td>

</tr>

</table>

<!-- body_text_eof //-->

  <td class="main" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

  </table></td>

 </tr>

</table>

<!-- body_eof //-->

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

tep_db_query habe ich bereits in xtc_db_query ge?ndert.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...