Mamie Posted April 18, 2008 Posted April 18, 2008 this is my first time to post, but I've searched the forum for an answer to my problem and haven't found one. While there are several posts about the 'continue shopping' button to take shoppers back to the product added to their cart, my continue shopping button doesn't work at all. My site isn't up yet, because it is inoperable ... any help would be greatly appreciated. thanks, Mamie <?php /*----------------- -----------------*/ require('includes/shared.inc.php'); $htmltemplates_sub = htmltemplates . '/shopping_cart/'; require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART); $SUBS['TITLE'] = TITLE; $SUBS['CHARSET'] = CHARSET; $SUBS['HTML_PARAMS'] = HTML_PARAMS; $SUBS['BASE'] = (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; $SUBS['SEPARATOR_BODY'] = tep_draw_separator('pixel_trans.gif', '100%', '5'); $SUBS['TEP_DRAW_SEPARATOR10'] = tep_draw_separator('pixel_trans.gif', '10', '1'); $SUBS['TEXT_INFORMATION'] = TEXT_INFORMATION; $SUBS['TEP_HREF_LINK_FILENAME_DEFAULT'] = tep_href_link(FILENAME_DEFAULT); $SUBS['TEP_IMAGE_BUTTON'] = tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE);$SUBS['TEP_IMAGE_SUBMIT_BUTTON_UPDATE'] = tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); if(WARN_INSTALL_EXISTENCE == 'true') if(file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/install')) $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); // check if the configure.php file is writeable if(WARN_CONFIG_WRITEABLE == 'true') if((file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/configure.php'))) $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); // check if the session folder is writeable if(WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true'){ if(STORE_SESSIONS == ''){ if(!is_dir(tep_session_save_path())) $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); elseif(!is_writeable(tep_session_save_path())) $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } // check session.auto_start is disabled if((function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true')) if(ini_get('session.auto_start') == '1') $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); if((WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true')) if(!is_dir(DIR_FS_DOWNLOAD)) $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); if($messageStack->size('header') > 0) $SUBS['WARNING_MESSAGES'] .= $messageStack->output('header'); /*NEW*/ require('includes/new.php'); /*NEW*/ $SUBS['FILENAME_DEFAULT'] = tep_href_link(FILENAME_DEFAULT); $SUBS['FILENAME_ACCOUNT'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); $SUBS['HEADER_CART'] = tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS); $SUBS['FILENAME_CHECKOUT_SHIPPING'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); $SUBS['HEADER_TITLE_CHECKOUT_GRAPH'] = tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT); $SUBS['HEADER_TITLE_MY_ACCOUNT'] = HEADER_TITLE_LOGIN; if(tep_session_is_registered('customer_id')){ $SUBS['LOG_OFF_LINK'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL'); $SUBS['LOG_OFF_MESSAGE'] = HEADER_TITLE_LOGOFF; $SUBS['HEADER_TITLE_MY_ACCOUNT'] = HEADER_TITLE_MY_ACCOUNT; } $SUBS['FILENAME_ACCOUNT_LINK'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); $SUBS['HEADER_TITLE_CART_CONTENTS'] = HEADER_TITLE_CART_CONTENTS; $SUBS['HEADER_TITLE_CHECKOUT'] = HEADER_TITLE_CHECKOUT; if(isset($_GET['error_message']) && tep_not_null($_GET['error_message'])){ $SUBS['err_mess'] = htmlspecialchars(urldecode($_GET['error_message'])); $SUBS['ERROR_MESSAGES'] = fileParse($htmltemplates.'error_message_on_index.htmlt'); } if(isset($_GET['info_message']) && tep_not_null($_GET['info_message'])){ $SUBS['inf_mess'] = htmlspecialchars($_GET['info_message']); $SUBS['INFO_MESSAGES'] = fileParse($htmltemplates.'info_message_on_index.htmlt'); } // prepare left column include(DIR_WS_INCLUDES . 'column_left.php'); require(DIR_WS_INCLUDES . 'column_right.php'); // left column is done $SUBS['HEADING_TITLE'] = HEADING_TITLE; $SUBS['TEP_IMAGE_SPECIALS'] = tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE/*, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT*/); $SUBS['BOX_WIDTH'] = BOX_WIDTH; $SUBS['TEP_DRAW_FORM_SHOPPING_CART'] = tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); if($cart->count_contents() > 0){ $info_box_contents = array(); $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_REMOVE); $info_box_contents[0][] = array('params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_PRODUCTS); $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_QUANTITY); $info_box_contents[0][] = array('align' => 'right', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_TOTAL); $any_out_of_stock = 0; $products = $cart->get_products(); for($i=0, $n=sizeof($products); $i<$n; $i++){ // Push all attributes information in an array if(isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])){ while(list($option, $value) = each($products[$i]['attributes'])){ $SUBS['TEP_DRAW_HIDDEN_FIELD'] = tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $products[$i]['id'] . "' and pa.options_id = '" . $option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '".$languages_id."' and poval.language_id = '" . $languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name']; $products[$i][$option]['options_values_id'] = $value; $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name']; $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price']; $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; } } } for($i=0, $n=sizeof($products); $i<$n; $i++){ if(($i/2) == floor($i/2)) $info_box_contents[] = array('params' => 'class="productListing-even"'); else $info_box_contents[] = array('params' => 'class="productListing-odd"'); $cur_row = sizeof($info_box_contents) - 1; $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'])); $SUBS['TEP_HREF_LINK_FN_SHOPPING_CART'] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']); $SUBS['TEP_IMAGE_SHOPPING_CART'] = tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); $SUBS['PRODUCTS_NAME_SHOPPING_CART'] = $products[$i]['name']; $products_name = fileParse($htmltemplates_sub.'shoping_cart_product_name.htmlt'); if(STOCK_CHECK == 'true'){ $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if(tep_not_null($stock_check)){ $any_out_of_stock = 1; $products_name .= $stock_check; } } if(isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])){ reset($products[$i]['attributes']); while(list($option, $value) = each($products[$i]['attributes'])){ $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>'; } } $products_name .= '</td></tr></table>'; $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"', 'text' => $products_name); $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>'); } $productlistingbox = new productListingBox($info_box_contents); $SUBS['PROD_LISTING_BOX'] = $productlistingbox->output; $SUBS['CURRENCIES_FORMAT'] = $currencies->format($cart->show_total()); $SUBS['SUB_TITLE_SUB_TOTAL'] = SUB_TITLE_SUB_TOTAL; if($any_out_of_stock == 1){ if(STOCK_ALLOW_CHECKOUT == 'true') $SUBS['ANY_OUT_OF_STOCK'] = OUT_OF_STOCK_CAN_CHECKOUT; else $SUBS['ANY_OUT_OF_STOCK'] = OUT_OF_STOCK_CANT_CHECKOUT; $SUBS['ANY_OUT_OF_STOCK'] = fileParse($htmltemplates_sub . 'shoping_cart_any_out_of_stock.htmlt'); } $back = sizeof($navigation->path) - 2;if(isset($navigation->path[$back])){ $SUBS['TEP_IMAGE_BUTTON_CONTINUE_SHOPPING'] = tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING); $SUBS['TEP_HREF_LINK_NAVIGATION'] = tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']); $SUBS['TEP_NAVIGATION_BACK'] = fileParse($htmltemplates_sub . 'shoping_cart_navigation_back.htmlt'); } $SUBS['TEP_IMAGE_BUTTON_CHECKOUT'] = tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT); $SUBS['SHOPPING_CART_CONTENTS'] = fileParse($htmltemplates_sub . 'shoping_cart_not_empty.htmlt'); } else { $emptycarttextobj = new infoBox(array(array('text' => TEXT_CART_EMPTY)), 'specials'); $SUBS['EMPTY_CART_TEXT'] = $emptycarttextobj->output; $SUBS['SHOPPING_CART_EMPTY_CONTENTS'] = fileParse($htmltemplates_sub . 'shoping_cart_empty.htmlt'); } require(DIR_WS_INCLUDES . 'footer.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); echo fileParse($htmltemplates_sub . 'index_shopping_cart.htmlt'); ?>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.