mattevans Posted April 17, 2007 Posted April 17, 2007 Hi, Can anyone help me to explain why I have two shopping carts appearing...? I have installed this gift coupon contribution, its excellent, except, it has added 2X shopping carts to my website. Can anyone explain? Below is my code... <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART); // new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); // ############ Added CCGV Contribution ########## // CREDIT CLASS script moved by Rigadin in v5.13 for compatibility with STS $cart_contents_string =" <script language=\"javascript\"> function couponpopupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l eft=150') } //--></script>"; // $cart_contents_string = ''; // ############ End Added CCGV Contribution ########## // $cart_contents_string = ''; if ($cart->count_contents() > 0) { // ############ Added CCGV Contribution ########## $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; $cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; // Modified in v5.13 by Rigadin for STS compatibility // ############ End Added CCGV Contribution ########## //$cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cart_contents_string .= '<tr><td>Shopping Cart '; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= '<span class="green">' . $products[$i]['quantity'] . ' x items</span></span></td><td> | <a href="shopping_cart.php?'.tep_session_name().'='.tep_session_id().'">Checkout »</a></td>'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= '</span></a></td></tr>'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { tep_session_unregister('new_products_id_in_cart'); } } $cart_contents_string .= '</table>'; } else { $cart_contents_string .= 'Shopping Cart | <span class="green">' . BOX_SHOPPING_CART_EMPTY . '</span>'; } $info_box_contents = array(); $info_box_contents[] = array('text' => $cart_contents_string); // if ($cart->count_contents() > 0) { // $info_box_contents[] = array('text' => tep_draw_separator()); // $info_box_contents[] = array('align' => 'right', // 'text' => $currencies->format($cart->show_total())); // } // ############ Added CCGV Contribution ########## if (tep_session_is_registered('customer_id')) { $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'"); $gv_result = tep_db_fetch_array($gv_query); if ($gv_result['amount'] > 0 ) { $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>'); $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>'); } } if (tep_session_is_registered('gv_id')) { $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'"); $coupon = tep_db_fetch_array($gv_query); $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>'); } /*if (tep_session_is_registered('cc_id') && $cc_id) { $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="java script:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>'); }*/ /* Serialio.com Edit Begin */ if (tep_session_is_registered('cc_id') && $cc_id) { $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'"); $coupon = tep_db_fetch_array($coupon_query); $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_id . "' and language_id = '" . $languages_id . "'"); $coupon_desc = tep_db_fetch_array($coupon_desc_query); $text_coupon_help = sprintf("%s",$coupon_desc['coupon_name']); $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="infoBoxContents">' . CART_COUPON . $text_coupon_help . '<br>' . '</td></tr></table>'); } /* Serialio.com Edit End */ // ############ End Added CCGV Contribution ########## new infoBox($info_box_contents); ?> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.