Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

anywho

Pioneers
  • Posts

    12
  • Joined

  • Last visited

Profile Information

  • Real Name
    skip

anywho's Achievements

  1. I installed this addon and thought it went rather smoothly. But now when I try to run a test order I get "There has been an error processing your credit card". It was working fine before the addon. Anyone have a similar experience and fix?
  2. I've followed the instructions to make the images smaller in the cart (they're HUGE) but they are still the same after I made the changes. What am I doing wrong? I posted my includes/modules/2gether.php file here. <?php // This file is /includes/modules/2gether.php v2.04 + now SPPC compatible (credit to Jan Zonjee) + show images as links instead of popup the image if (!$together_id) $together_id = (int)$_GET['products_id']; // added (int) if ($together_id) { include(DIR_WS_LANGUAGES . $language . '/2gether.php'); $show_money_savings = true; // show money savings $show_percentage_savings = true; // show percentage savings $show_original_prices = true; // show origibal prices of the products $show_images_as_links = true; // show images as links instead of popup the image ?> <tr> <td> <div id="gether"> <?php $together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where (product_1_id = '" . $together_id . "' or product_2_id = '" . $together_id . "') and status = 1"); $num_together = tep_db_num_rows($together_query); if ($num_together > 0) { $record = tep_db_fetch_array($together_query); $discount = $record['discount']; $discount_type = $record['type']; if ($record['product_1_id'] == $together_id) { $aq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'"; $bq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'"; } else { $aq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'"; $bq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'"; } // BOF SPPC $list_of_prdct_ids = array($record['product_1_id'], $record['product_2_id']); if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } // EOF SPPC $product_a_query = tep_db_query($aq); $product_a = tep_db_fetch_array($product_a_query); $product_b_query = tep_db_query($bq); $product_b = tep_db_fetch_array($product_b_query); $product_a_price = $product_a['products_price']; $product_b_price = $product_b['products_price']; // BOF SPPC - specials // get all customers_group_prices for products with the particular customer_group_id // however not necessary for customer_group_id = 0 if ($customer_group_id != '0') { $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '".$customer_group_id."'"); while ($pg_array = tep_db_fetch_array($pg_query)) { $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => ''); } for ($x = 0; $x < 2; $x++) { // replace products prices with those from customers_group table if(!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if ($product_a['products_id'] == $new_prices[$i]['products_id'] ) { $product_a_price = $new_prices[$i]['products_price']; } if ($product_b['products_id'] == $new_prices[$i]['products_id'] ) { $product_b_price = $new_prices[$i]['products_price']; } } // end for ($i = 0; $i < count($new_prices); $i++) { } // end if(!empty($new_prices) } // end for ($x = 0; $x < count($new_prices); $x++)} } // end if ($customer_group_id != '0') // an extra query is needed for all the specials $specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and status = '1' and customers_group_id = '" .$customer_group_id. "' "); while ($specials_array = tep_db_fetch_array($specials_query)) { $new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price']); } // replace products_price with the correct specials_new_products_price if(!empty($new_s_prices)) { for ($x = 0; $x < 2; $x++) { for ($i = 0; $i < count($new_s_prices); $i++) { if ($product_a['products_id'] == $new_s_prices[$i]['products_id'] ) { $product_a_price = $new_s_prices[$i]['specials_new_products_price']; } if ($product_b['products_id'] == $new_s_prices[$i]['products_id'] ) { $product_b_price = $new_s_prices[$i]['specials_new_products_price']; } } // end for ($i = 0; $i < count($new_s_prices); $i++) { } // end for ($x = 0; $x < 2; $x++) { } // end if(!empty($new_s_prices) // EOF SPPC - specials if (DISPLAY_PRICE_WITH_TAX) { $product_a_price = tep_add_tax($product_a_price,tep_get_tax_rate($product_a['products_tax_class_id'])); $product_b_price = tep_add_tax($product_b_price,tep_get_tax_rate($product_b['products_tax_class_id'])); } if ($discount > 0) { $together_image = '<img src=' . DIR_WS_IMAGES . 'save-icon_blink.gif alt="$" title="$">'; $together_text = TOGETHER_HEADING_TEXT_SPECIAL_OFFER . '<br>'; if (($show_money_savings) or ($show_percentage_savings)) { $together_savings_string = TOGETHER_TEXT_YOU_SAVE; } else { $together_savings_string = ''; } if ($discount_type == 'p') { $together_price = tep_round(($product_a_price + $product_b_price) * (1-($discount/100)), 1); if ($show_money_savings) { $together_savings = $product_a_price + $product_b_price - $together_price; $together_savings_string .= $currencies->format($together_savings); } if ($show_percentage_savings) { $together_savings_string .= ' ' . $discount . '%'; } } else { $together_price = tep_round($product_a_price + $product_b_price - $discount,1); if ($show_money_savings) { $together_savings = $product_a_price + $product_b_price - $together_price; $together_savings_string .= $currencies->format($together_savings); } if ($show_percentage_savings) { $together_percentage = ($discount /($product_a_price + $product_b_price))*100; $together_savings_string .= ' ' . $together_percentage . '%'; } } } else { $together_price = tep_round(($product_a_price + $product_b_price), 1); $together_savings_string = ''; $together_image = '<img src=' . DIR_WS_IMAGES . 'info_blue_small.jpg alt="i" title="i">'; $together_text = '<font color="orange"><span class="getslogan">'.TOGETHER_HEADING_TEXT_SUGGESTION . '</span></font><br>'; } $together_string = $currencies->format($together_price); echo '<table width="99%" class="borderGray" cellpadding="2" align="center">' . '<tr> <td valign="top" width="1px" align="left">' . $together_image . '</td>' . '<td colspan="5" class="gettitolo">' . $together_text . TOGETHER_TEXT_BUY . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_a['products_id']) . '">' . str_replace('\'','`',$product_a['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a> ' . TOGETHER_TEXT_AND . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_b['products_id']) . '">' . str_replace('\'','`',$product_b['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a></td>' . '</tr> <tr> <td></td>' . '<td width="80px" align="center">' ;?> <?php // show images as link ... if ($show_images_as_links) { echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_a['products_id']) . '">' . ' ' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; } else { //... instead of popup the image ?> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_a['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), 'hspace="5" vspace="5"') . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), 'hspace="5" vspace="5"') . '</a>'; ?> </noscript> <?php } echo tep_draw_form('together', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); if ($show_original_prices) echo '<br><span class="prezzo">'.$currencies->format($product_a_price); //Jader $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$product_a['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$product_a['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.options_values_price, pa.products_attributes_id"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$product_a['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$product_a['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php echo '<br>' . $products_options_name['products_options_name'] . ':'; ?><br> <?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?><br> <?php } //-Jader echo '</span></td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' . '<td width="80px" align="center">' ;?> <?php if ($show_images_as_links) { echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_b['products_id']) . '">' . ' ' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; } else { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_b['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?> </noscript> <?php } if ($show_original_prices) echo '<br><span class="prezzo">'.$currencies->format($product_b_price); //Jader $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$product_b['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$product_b['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.options_values_price, pa.products_attributes_id"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$product_b['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$product_b['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <?php echo '<br>' . $products_options_name['products_options_name'] . ':'; ?><br> <?php echo tep_draw_pull_down_menu('id_b[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?><br> <?php } //-Jader echo '</span></td><td width="2%"></td>'. '<td align="middle" nowrap valign="middle" class="getprezzo">' . TOGETHER_TEXT_TOGETHER . ' ' . '<br><font color=#00><b>'.$together_string . '</b></font><br><br>'; //echo tep_draw_form('together', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('quantity',1) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW); echo '</form>'; echo '<table>'; if ($discount > 0) echo '<tr><td class="getrisparmio" nowrap align="center"><br><font color="red">' . $together_savings_string . '</font></td></tr><tr><td class="vsmalltext" nowrap align="center">('. TOGETHER_TEXT_RECEIVE_CHECKOUT . ')</td></tr>'; echo '</table>'; echo '</td></tr>'; echo '</table>'; echo '</div></td></tr><tr><td class="spazio"></td></tr>'; } } ?> Thank you!
×
×
  • Create New...