Forums / Templates, Stylesheets, Page Layout / Uh-oh "Add to cart" doesnt work anymore

Uh-oh "Add to cart" doesnt work anymore

Locked

Views: 1,707

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
26 Sep 2007, 10:33 AM
#2
azrahn avatar

azrahn

Zen Follower

Join Date:
Jun 2006
Location:
Koh Samui
Posts:
120
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Hi,

I tried the link to your site but i get an message that the DB is off line.

Ronald.

26 Sep 2007, 1:40 PM
#3
funkmanusa avatar

funkmanusa

New Zenner

Join Date:
Sep 2007
Posts:
38
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Thanks for looking...

I just checked it and the site is up.

Still searching for what is causing items not to go into the cart.....

:frusty:

26 Sep 2007, 1:49 PM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

You somehow deleted the form, the original code should have something like zen_draw_form.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

26 Sep 2007, 1:52 PM
#5
funkmanusa avatar

funkmanusa

New Zenner

Join Date:
Sep 2007
Posts:
38
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Any idea where I should look?

I did a search and many many page show code with zen_draw_form.

26 Sep 2007, 1:55 PM
#6
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Look at your link
main_page=product_info&products_id=2
So you should check the file tpl_products_info_display.php in your template folder.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

26 Sep 2007, 2:44 PM
#7
madmumbler avatar

madmumbler

Zen Follower

Join Date:
Dec 2005
Location:
SWFL
Posts:
450
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Sometimes it's faster to just re-upload the core files. LOL I've done that before when I've done something whacky, just started from a fresh set of files. It looks like you're still in the building stages, so it's not like you're going to take down a full site or anything. Make SURE you have back-ups of your custom files.

What happens if you switch to the custom template? Does it still not work then? (It's worth a shot but might not help.) Try that first -- if the add to works then, you'll know it's something in your custom template files.

You can also download all your store files and compare them to a fresh install on your computer with WinMerge or something like that and see what's different and work from there.

HTH,

Lesli in SW Florida ~ writer, teacher, and dodging hurricanes!

26 Sep 2007, 6:40 PM
#8
funkmanusa avatar

funkmanusa

New Zenner

Join Date:
Sep 2007
Posts:
38
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Thanks for your help guys!

Well I dumped the entire template and slowly pieced it backed together with my original files..... :yuck:

It seems for reason the tpl_header.php file of all things is causing the issue, but I dont see why.

Heres what I have.....

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_header.php 4066 2006-08-06 05:50:06Z ajeh $
 */
?>
<!--[if IE]>
<link href="<?=DIR_WS_TEMPLATE?>css_ie/style_ie.css" rel="stylesheet" type="text/css">
<![endif]-->
	<div class="dt main_bord" >
		<div class="dr">
			<div class="dc" >
				<div class="dt main">
					<!--header -->
					<div class="dt header" >
						<div class="dr">
							<div class="dc header_c1" ></div>
							<div class="dc header_c2" >
								<div class="margin">
									<div class="dt" >
										<div class="dr">
											<div class="dc header_c2_r1_c1" ></div>
										  <div class="dc header_c2_r1_c2" >
										    <div class="dc header_c2_r1_c1" >
										      <table width="753" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                  <td width="92" rowspan="3"><a href="<?=zen_href_link(FILENAME_DEFAULT)?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/logo.gif'); ?></a></td>
                                                  <td><table width="452" border="0" align="right" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                      <td width="128"> </td>
                                                      <td width="333"><div align="right"><a href="<?=zen_href_link(FILENAME_PRIVACY)?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/spacer.gif','','1px','11px'); ?>
                                                                <?=BOX_INFORMATION_PRIVACY?>
                                                          </a>|
                                                        <?php if ($_SESSION['customer_id']) { ?>
                                                          <a href="<?=zen_href_link(FILENAME_ACCOUNT)?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
                                                          <?php
      } else {
        if (STORE_STATUS == '0') {
?>
                                                          <a href="<?=zen_href_link(FILENAME_CREATE_ACCOUNT)?>"><?php echo HEADER_TITLE_CREATE_ACCOUNT; ?></a> | <a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>
                                                          <?php } } ?>
                                                      </div></td>
                                                    </tr>
                                                  </table>
                                                  <div align="right"></div></td>
                                                </tr>
                                                <tr>
                                                  <td width="704"><div align="right"><?php echo zen_image(DIR_WS_TEMPLATE.'images/spacer.gif','','100px','1px'); ?><?php echo HEADER_TITLE_CART_CONTENTS; ?><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"> <?php echo zen_image(DIR_WS_TEMPLATE.'images/cart.jpg'); ?></a></div></td>
                                                </tr>
                                                <tr>
                                                  <td><div align="right">
                                                    <?=zen_draw_form('currencies', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get')?>
                                                    <?

    if (isset($currencies) && is_object($currencies)) {

      reset($currencies->currencies);
      $currencies_array = array();
      while (list($key, $value) = each($currencies->currencies)) {
        $currencies_array[] = array('id' => $key, 'text' => $value['title']);
      }

      $hidden_get_variables = '';
      reset($_GET);
      while (list($key, $value) = each($_GET)) {
        if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
          $hidden_get_variables .= zen_draw_hidden_field($key, $value);
        }
      }
    }

?>
                                                    <?=zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'class="form_1" onchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id()?>
                                                  </div></td>
                                                </tr>
                                              </table>
									        </div>
									      </div>
									  </div>
								  </div>
								  <span class="dc header_c2_r1_c2"><div class="dc header_c2_r1_c1" ></div>
								  </span></div>
							</div>
						</div>
					</div>
					<a href="<?=zen_href_link(FILENAME_PRODUCTS_NEW)?>"><?php echo zen_image(DIR_WS_TEMPLATE.'images/header_bg.jpg'); ?></a><br>
					<div><a href="<?=zen_href_link(FILENAME_DEFAULT)?>"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l1.jpg')?></a><a href="<?=zen_href_link(FILENAME_SPECIALS)?>"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l2.jpg')?></a><a href="<?=zen_href_link(FILENAME_PRODUCTS_NEW)?>"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l3.jpg')?></a><a href="index.php?main_page=products_all"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l4.jpg')?></a><a href="<?=zen_href_link(FILENAME_REVIEWS)?>"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l5.jpg')?></a><a href="<?=zen_href_link(FILENAME_CONTACT_US)?>"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l6.jpg')?></a><a href="<?=zen_href_link(FILENAME_GV_FAQ)?>"><?=zen_image(DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/menu/l7.jpg')?></a></div>
					<!--header end-->
					<?php

###############################################################################################################


//templatemonster functions

//global
define('MAX_TM_DESC',80);

function tm_listing_start()
{

 echo '';
}
function tm_listing_end()
{

 echo '';
}

function tm_listing2($href, $img, $name, $desc, $price, $cols = 0, $row = 0)
{
	if(!empty($href)){

						$price = 	preg_replace('/(Save: \d+%\soff)/i', '', $price);
						$price = 	preg_replace('/(<span class="normalprice">)/i', '<span class="ee">', $price);
						//$price = 	preg_replace('/(<br)/i', '<font', $price);
						//$price = 	preg_replace('/(<span class="productPriceDiscount"><br>)/i', '<span>', $price);
						
							echo '<div class="dt" >
										<div class="dr">
											<div class="dc main_cell_c1" ><a href="'.$href.'">'.$img.'</a></div>
											<div class="dc main_cell_c2" ></div>
											<div class="dc main_cell_c3" >'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
												<span class="h1_text">'.$name.'</span><br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '15px').'<br>
												'.$desc.'<br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '20px').'<br>
												<div class="dt" >
													<div class="dr">
														<div class="dc price_block_c1" ><span class="price_text">'.$price.'</span></div>
														<div class="dc price_block_c2" ><a href="'.$href.'"><img alt="" src="'.DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/button_details.gif"></a></div>
													</div>
												</div>
											</div>
										</div>
									</div>';
						
		if (!empty($cols) or $cols == 0)
										{
										 if ($cols == (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS -1 ))
										 {
										  if ($row != (MAX_DISPLAY_SEARCH_RESULTS_FEATURED -1))
										   {
										   
										   echo zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '45px').'<br>';
										  }
										 } 
										 else
										 {
										  echo '';
										 }
										 
										}
										 $cols++;
}
else
{
	echo '<div class="content" style="margin:10px; font-size:12px;">'.TEXT_NO_PRODUCTS.'</div>';
}

}

function tm_listing($href, $img, $name, $desc, $price, $cols = 0, $row = 0)
{
if(!empty($href)){

						$price = 	preg_replace('/(Save: \d+%\soff)/i', '', $price);
						$price = 	preg_replace('/(<span class="normalprice">)/i', '<span class="ee">', $price);
						//$price = 	preg_replace('/(<br)/i', '<span', $price);
						$price = 	preg_replace('/(<span class="productPriceDiscount"><br)/i', '<span', $price);
						
							echo '<div class="dt" >
										<div class="dr">
											<div class="dc main_cell_c1" ><a href="'.$href.'">'.$img.'</a></div>
											<div class="dc main_cell_c2" ></div>
											<div class="dc main_cell_c3" >'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
												<span class="h1_text">'.$name.'</span><br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '15px').'<br>
												'.$desc.'<br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '20px').'<br>
												<div class="dt" >
													<div class="dr">
														<div class="dc price_block_c1" ><span class="price_text">'.$price.'</span></div>
														<div class="dc price_block_c2" ><a href="'.$href.'"><img alt="" src="'.DIR_WS_TEMPLATE.'buttons/'.$_SESSION['language'].'/button_details.gif"></a></div>
													</div>
												</div>
											</div>
										</div>
									</div>';
						
		if (!empty($cols) or $cols == 0)
										{
										 if ($cols == (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS -1 ))
										 {
										    echo zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '45px').'<br>';
										 } 
										 else
										 {
										   echo '';
										 }
										 
										}
										 $cols++;
}

else
{
echo '<div class="content" style="margin:10px; font-size:12px;">'.TEXT_NO_PRODUCTS.'</div>';
}
}



function tm_head($text)
{
 								echo '<div class="margin">
									<span class="h_text">'.$text.'</span><br>';
}
function tm_head_end()
{
 echo '</div>';
}

function tm_box_head($text, $link = false, $style = 'deff')
{
 if (!empty($link))
 {
  $text = $text.' (<a href="'.zen_href_link($link).'" class="rr">more</a>)';
 }
 switch ($style)
 {
 	case 'style1':
	{
		$ret = '<div class="m21">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '38px').'<br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '8px', '1px').'<span class="title">'.$text.'</span><br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '18px').'<br>
										';
	break;
	}
	case 'style2':
	{
	 	$ret = '<div class="dt roundT4_in1">
								<div class="dt roundT4_in2">
									<div class="dt roundT4_in3">
										<div class="dt roundT4_in4">
											<div class="dr">
												<div class="dc">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '9px').'<br>
													<div class="M13"><span class="title2">'.$text.'</span><br>
													</div>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>';
	break;
	}
	case 'style3':
	{
	 	$ret = '<div class="dt r_col_t3_in1">
							<div class="dt r_col_t3_in2">
								<div class="dt r_col_t3_in3">
									<div class="dt r_col_t3_in4">
										<div class="dr">
											<div class="dc">
												<div class="b_m3">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '15px').'<br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '8px', '1px').'<span class="tt3_txt">'.$text.'</span><br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '12px').'<br>
													';
	break;
	}
	case 'noborder':
	{
	 	$ret = '';
	break;
	}
	default:
	{
		
		$ret = '<div class="margin">
									<span class="h_text">'.$text.'</span><br>
									<br style="line-height:20px;">';
	 break;
	}
 }
 return $ret;
}
function tm_box_cont($text,$style = 'deff')
{ 
 switch ($style){
	 case 'style1':
	 {
	 $ret = $text;
	  break;

	 break;
	 }
	 case 'style2':
	 {
	  $ret = $text.'</div>
												</div>
											</div>
										</div>';
	break;
	 }		
	 case 'style3':
	 {
	  $ret = $text.''.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '11px').'<br>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>';
	break;
	 }		
	 case 'noborder':
	 {
	  $ret = $text;
	break;
	 }
	 default:
	 {
	 	$ret = $text.'</div>';
	  break;
	 } 
	
 } 
 return $ret;
}


###############################################################################################################



  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}



?>
					<?php
if (CATEGORIES_TABS_STATUS == '1') {
  require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php');
}
?>
<!--eof-optional categories tabs navigation display-->

<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->

Any thoughts?

26 Sep 2007, 7:02 PM
#9
funkmanusa avatar

funkmanusa

New Zenner

Join Date:
Sep 2007
Posts:
38
Plugin Contributions:
0

Re: Uh-oh "Add to cart" doesnt work anymore

Well I dont know why, but this is what caused it not to work.

<?=zen_draw_form('currencies', zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '', $request_type, false), 'get')?>

I removed it from my currency form in the header.
Will the currency form still work without this file?
I dont even know what it does....just copy and pasting.

Also it caused my "all products" link not to work.

Thanks