Jump to content

Historian

Members
  • Content count

    215
  • Joined

  • Last visited

Profile Information

  • Real Name
    David Willson
  • Gender
    Male
  • Location
    Suffolk, UK
  1. Historian

    Price List - HTML

    I was after a simple price list printed from our shop. I saw contribution 1705 and thought it could be what i wanted. However, although it appears to be fairly simple, I couldn't get it to work! I can't make it print properly. I have checked the HTML, which looks OK, but I haven't enough knowledge to check the PHP. Can anyone help please? The "working" file (before improving HTML) is as follows (apologies for such a long file): <?php require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRICELIST); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRICELIST)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <style type="text/css"> <!-- td.priceListWidth{ width:<?php echo WIDTH_PRICE_LIST; ?>px; } td.priceListIndent { background-color:<?php echo INDENT_PRICE_LIST_COLOR; ?>; width:<?php echo INDENT_PRICE_LIST; ?>; } --></style> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <?php // print function and edit remove by willross if ($print=="yes"){?> <!-- column_left disabled for print //--> <?php } else {?> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <?php }?> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="pageHeading"><?php echo TITLE_PRICE_LIST ?> <?php echo date(DATE_PRICE_LIST); ?><sup> <?php // print function and edit remove by willross if ($print=="yes"){?> <font style="font-size:10px"><a href="pricelist.php">[<?php echo FULL_VIEW ?>]</a></font> <?php } else {?> <font style="font-size:10px"><a href="pricelist.php?print=yes">[<?php echo PRINT_VIEW ?>]</a></font> <?php }?></sup> </td> </tr> <tr> <td> <? // groups have products? function check_products($id_group){ $products_price_query = tep_db_query("select products_to_categories.products_id FROM products_to_categories where products_to_categories.categories_id = ".$id_group." LIMIT 0,1"); if($products_price = tep_db_fetch_array($products_price_query)){ return true; } return false; } // list products determined group function get_products($id_group){ global $currencies; $query = ""; if(!SHOW_MARKED_OUT_STOCK){ $query = " and products.products_status = 1"; } $products_price_query = tep_db_query("select products_description.products_name, products.products_quantity, products.products_price, products.products_model, products_to_categories.products_id, products_to_categories.categories_id FROM products, products_description, products_to_categories where products.products_id = products_description.products_id and products.products_quantity <> 0".$query." and products.products_id = products_to_categories.products_id and products_to_categories.categories_id = ".$id_group); $x=0; while ($products_price = tep_db_fetch_array($products_price_query)){ $cell = tep_get_products_special_price($products_price['products_id']); if($cell == 0) $cell = $products_price['products_price']; if($x==1) { $col = "#F8F8F9"; $x = 0; }else{ $col = "#FFFFFF"; $x++; } $quantity = ""; $model = ""; if(SHOW_QUANTITY) $quantity = "<td align=\"right\" class=\"productListing-data\"> (".$products_price['products_quantity'].")</td>"; if(SHOW_MODEL) $model = "<td align=\"LEFT\" class=\"productListing-data\">".$products_price['products_model']."</td>"; print "<tr bgcolor=\"".$col."\"><td class=\"productListing-data\"><table align=\"LEFT\" cellpadding=\"1\" cellspacing=\"0\" ><tr><td class=\"priceListIndent\" ></td><td class=\"productListing-data\" > </td></tr></table></td>".$model."<td class=\"productListing-data\" ><a href=" . tep_href_link( FILENAME_PRODUCT_INFO, "products_id=" . $products_price['products_id']) . "> ".$products_price['products_name']."</td><td align=\"right\" class=\"productListing-data\"> " . (($products_price['products_price'] > 0) ? $currencies->display_price($cell,TAX_INCREASE) : NO_PRICE ) ."</td>".$quantity."</tr>"; } } // get all groups function get_group($id_parent,$position){ $qty_text = ""; if(SHOW_QUANTITY) { $qty_text = "".QUANTITY_TEXT.""; }else{ $qty_text = " "; } $groups_price_query = tep_db_query("select categories.categories_id, categories_description.categories_name from categories, categories_description where categories.categories_id = categories_description.categories_id and categories.parent_id = ".$id_parent); while ($groups_price = tep_db_fetch_array($groups_price_query)){ $str = ""; for($i = 0; $i < $position; $i++){ $str = $str . "<table align=\"LEFT\" cellpadding=\"0\" cellspacing=\"0\" ><tr><td class=\"priceListIndent\" ></td><td class=\"productListing-heading\" > </td></tr></table>"; } $class = "productListing-heading"; if($position == 0) { $class = "headerNavigation"; print "<tr><td colspan=\"5\" class=\"priceListWidth\"><table align=\"right\" cellpadding=\"0\" cellspacing=\"0\" ><tr><td class=\"productListing-data\">".$qty_text."</td></tr></table></td></tr>"; // dónnr? nndîer } if(check_products($groups_price['categories_id']) || $position == 0){ print "<tr><td colspan=\"5\" class=\"".$class."\"><strong><font color=\"#FFFFFF\">".$str.$groups_price['categories_name']."</font></strong></td></tr>"; get_products($groups_price['categories_id']); } get_group($groups_price['categories_id'],$position+1); // nëläótur? adóddr } } ?> <table width="100%" border="0" cellspacing="1" cellpadding="0"> <? get_group(0,0); ?> <tr> <?php // print function and edit remove by willross if ($print=="yes"){?> <!-- column_right disabled for print //--> <?php } else {?> <td colspan="5"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table> </td> </tr> </table></td> <!-- body_text //--> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <?php }?> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Instead of the correct printout, the printout starts as follows: What it's doing is printing out part of the PHP file from the end of line 138 !! I was wondering whether it was written in PHP4 - It's now running in PHP5. Can anyone please help me and say what is going on and what is wrong?
  2. Historian

    Address Format Change

    I have just tried contribution 4952 which allows you to change the address format in the database. Can someone please explain to what has changed? I've looked at various documents, but nothing seems to have changed!
  3. Historian

    Testing PayPal / Sandbox

    I haven't been able to get the PayPal Sandbox to work! I have put various comments in various forums as well as emailing PayPal, but I haven't been able get any answers from anyone! I can get the price to be transferred but nothing else. Then I get comments such as "This invoice has already been paid." No emails ever get sent in the Sandbox. I am on the point of giving up! I'm so frustrated! Paypal blame osCommerce/Modules and the forum experts blame PayPal.
  4. Historian

    Official PayPal IPN Support Thread

    I have looked through the file above and found the link to the sandbox server is: https://www.sandbox.paypal.com/cgi-bin/webscr Paypal have suggested this is wrong. I'm awaiting their reply giving me another link. I don't think I have copied any code from a non-IPN version. I don't know if it's me, PayPal, the Module, osCommerce or PHP5 ! It's probably me, but I just don't know what is wrong! Seems like a good idea. If I ever get PayPal working properly! Why can't you just change the length of the $var field in the database? Don't ask me how to do it though! Can you change it to "TEXT" then it can be as long as you like?
  5. Historian

    Official PayPal IPN Support Thread

    PayPal Despair! Totally lost using the Sandbox I am trying to use Terra's PayPal IPN Contribution and I am really struggling. I have set up a Sandbox account on PayPal, but I am not getting anywhere. I have been on to PayPal to get some help, but I'm still getting nowhere. This is their last email to me: I have no idea where these values are coming from! As far as I know, I have none of the values mentioned viz. paypal tester, Omaha etc. don't appear on my website!! I don't understand how I fit all the variables mentioned in the PayPal link into the contribution. These are my settings in Admin: Enable PayPal IPN Module: True Gateway Server: Testing Email address: The e-mail address to use for the PayPal IPN service Sort order of display: 0 Transaction Currency: Selected Currency Payment Zone: none Force shipping address: False Set Preparing Order Status: default Set PayPal Acknowledged Order Status: default Set PayPal Completed Order Status: default Transaction Type: Aggregate Move tax to total amount: True Page Style: blank Debug E-Mail Address: as above Enable Encrypted Web Payments: false Your Private Key: blank Your Public Certificate blank PayPals Public Certificate: blank Your PayPal Public Certificate ID: blank Working Directory: blank OpenSSL Location: /usr/bin/openssl The site is not yet live and has no SSL etc. yet. Should I delete the default "OpenSSL Location"? Can someone please help me and point me in the right direction? I apologise if the answer is somewhere in the forum, but 140 pages takes a long time to read!
  6. I have a problem with the Airmail for overseas shipping. How do I increase the 2kg maximum weight? I have inserted some higher weights in includes/modules/shipping/airmail.php, but checkout will still not go above 2kg. Obviously I can change the words in includes/languages/english/modules/shipping/airmail.php, but which file sets the 2kg maximum figure? Can anyone help please?
  7. Historian

    Automatic Thumbnail Creator (no.1484)

    I am using: MySQL client version 5.0.22 PHP server version 5.0.27-community-nt Does either of these clash with Automatic Thumbnail Creator?
  8. I have been trying to use Automatic Thumbnail creator (No.1484) I have tried the following: 1. Replacing html_output.php using "image cache thumbnail-2006-07-11.zip" (SAYAD 21 Feb 2007) 2. Replacing html_output.php using "automatic_thumbnail-2006-07-11.zip" (olaf_noehring 11 Jul 2006) 3. Altering html_output.php using "automatic_thumbnail.zip" (yesudo 9 Jun 2006) I haven't moved/created/changed anything else. In every case I then get the header, left hand column and virtually nothing else! No centre boxes, no text, no right column etc. When I change back to my old (original) version of html_output.php. then everything is back as it was before. Can anyone please tell me what I am doing wrong or what I need to do?
×