Jump to content

Simmi0505

Members
  • Content count

    8
  • Joined

  • Last visited

Profile Information

  1. Hi I have installed this great contribution but am having a minor problem with my shopping cart box, due to another mod. The shopping cart box in column_right has the ability to change quantity but obviously I would like to prevent that happening for carrots. Could someone help me with this code for catalog/includes/boxes/shopping cart.php Many Thanks Simon <?php /* $Id: (advanced) shopping_cart.php,v 1.1 2005/08/31 beer monster Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART); ?> <!-- shopping_cart //--> <script type="text/javascript" src="includes/boxes/rollovers.js"></script> <script type="text/javascript"> <!-- function decrement(index) { if(document.forms["cart_box"].elements["cart_quantity[]"][index].value >1) { document.forms["cart_box"].elements["cart_quantity[]"][index].value--; document.cart_box.submit(); } } function increment(index) { document.forms["cart_box"].elements["cart_quantity[]"][index].value++; document.cart_box.submit(); } function mark(pid) { document.forms["remove_product"].elements["cart_delete[]"][0].value=pid; document.forms["remove_product"].elements["products_id[]"][0].value=pid; document.remove_product.submit(); } var sURL = document.URL.toString(); if (sURL.indexOf("?") > 0){ urlsplitter = ''; } else { urlsplitter = '?'; } document.write('<form '); document.write(' name="remove_product" '); document.write(' action="' + document.URL + urlsplitter + '&action=update_product"'); document.write(' method="post">'); //one element is not an array so add 2 of each! document.write('<input type="hidden" name="products_id[]">'); document.write('<input type="hidden" name="cart_delete[]">'); document.write('<input type="hidden" name="products_id[]">'); document.write('<input type="hidden" name="cart_delete[]">'); document.write('</form>'); document.write('<form '); document.write(' name="cart_box" '); document.write(' action="' + document.URL + urlsplitter + '&action=update_product"'); document.write(' method="post">'); //--> </script> <body onLoad="MM_preloadImages('images/btn-up.gif','images/btn-dn.gif','images/btn-up-ov.gif', 'images/btn-dn-ov.gif')"></body> <tr id="colright"> <td id="shopcartbox"> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART); new infoBoxHeading($info_box_contents, true, true, tep_href_link(FILENAME_SHOPPING_CART)); if ($cart->count_contents() > 0) { $info_box_contents = array(); $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'])) { echo 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']; } } } //Build the infobox... for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cur_row = sizeof($info_box_contents); if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $style_text = '<span class="newItemInCart">'; } else { $style_text ='<span class="infoBoxContents">'; } //Product Details First... $products_name = ' <tr>' . // uncomment this line to get micro thumbnails! ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], '30') . ' </a></td>' . ' <td colspan="4" class="infoBoxContents" valign="top"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . $style_text . $products[$i]['name'] . '</span></a>'; //--Add any attributes... 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>'; //Now build the Quantity form... //--Make sure we have a form array...one element is not an array and //--javascript doesn't like elements with [] so add some extra fields if there is only one product in the cart! if (sizeof($products)==1){ $j =$i+1; $extra_elements = tep_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']) . tep_draw_hidden_field('products_id[]', $products[$i]['id']); } else { $j =$i; $extra_elements = ''; } $products_form =' <tr>' . ' <td>Qty </td>' . ' <td> ' . $extra_elements . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'class="quantitybox"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . '</td>' . ' <td><a href="java script:void(increment('. $j . '));" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'document.up' . $i . '\',\'document.up' . $i . '\',\'images/btn-up-ov.gif\')" ><img name="up' . $i . '" src="images/btn-up.gif" border="0" width=21 height=11></a><br><a href="java script:void(decrement('. $j . '));" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'document.dn' . $i . '\',\'document.dn' . $i . '\',\'images/btn-dn-ov.gif\')" ><img name="dn' . $i . '" src="images/btn-dn.gif" border="0" width=21 height=11></td>' . ' <td width="100%" align="right"><b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b></td>' . ' </tr>'. ' <tr><td colspan="5" align="right" width="100%" class="infoBoxContents"><a href="java script:void(mark(\'' . $products[$i]['id'] . '\'));"><span class="removeProduct">' . TABLE_HEADING_REMOVE . ' <img src="images/remove.gif" border="0" height="8" width="8"> </span></a></td></tr>' . ' <tr><td colspan="5" width="100%">' . tep_draw_separator('pixel_silver.gif') . '</td></tr>'; $cart_contents .= $products_name . $products_form; } //Finally, add the total... //--If we are already at the checkout, don't show the checkout button! if (preg_match("/checkout/", $PHP_SELF)) { $co_link = ''; } else { $co_link = '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout_small.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; } $total = ' <tr height="20">' . ' <td colspan="3" align"left">' . $co_link . '</td>' . ' <td colspan="1" align="right" width="100%" class="infoBoxContents"><b>' . $currencies->format($cart->show_total()) . '</b></td>' . ' </tr>'; $cart_contents .= $total; $info_box_contents = array(); $info_box_contents[] = array('text' => $cart_contents); new cartBox($info_box_contents); } else { new infoBox(array(array('text' => BOX_SHOPPING_CART_EMPTY))); } ?> </form> </tr> </td> <!-- shopping_cart_eof //-->
  2. Simmi0505

    eway order status not updating

    Hi I have installed the new eway contribution. I have it working and passing transactions through eway but the orders are not updated with a status and are left as pending. I have updated the admin to set order status to "Awaiting post" but still have the problem. Can anyone please give me some guidance on where to look. Thanks Simon
  3. I am new to this and also had the above problem. There have been several questions in this thread about this problem which didnt resolve it for me - probably because it is so obvious to those more experienced. Anyway for future newbies, the solution to my problem was: In step 5 the file downloaded from http://www.maxmind.com/app/geoip_country is GeoIP.dat.gz - which is a compressed file. It must be decompressed with WinAce or similar and the decompressed file (GeoIP.dat) uploaded to the /catalog/includes folder.
×