Jump to content

mdscarrott

Members
  • Content count

    34
  • Joined

  • Last visited

Profile Information

  • Real Name
    Matt Scarrott
  1. Hi All I'm still working hard to perfect this contribution. I have managed to get almost all the elements working well, either through the kind help of Sam or from the general community support, and sometimes from just trial and error. The last area that i need help with is to get the contibution working with the Xsell addon. I have installed this successfully but would now like to get this module looking in keeping with my product listings and featured products etc. The contibution available here basicially lets you list a number of releted products on each product page by assigning relationships in the admin. The code for module is below. I have tried playing with this using the new products module and featured products modules as an example but the coding changes required are beyone me unfortunately and i just get endless errors. Please can someone take a look at the code below and let me know how to get this to use the product listing layout. Cheers all. Matt S <?php /* $Id: xsell_products.php, v1 2002/09/11 // adapted for Separate Pricing Per Customer v4 2005/02/24 osCommerce, Open Source E-Commerce Solutions <http://www.oscommerce.com> Copyright (c) 2002 osCommerce Released under the GNU General Public License */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_XSELL_PRODUCTS); if ((USE_CACHE == 'true') && empty($SID)) { // include currencies class and create an instance require_once(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); } if ($HTTP_GET_VARS['products_id']) { $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, specials_new_products_price from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_XSELL); $num_products_xsell = tep_db_num_rows($xsell_query); if ($num_products_xsell > 0) { ?> <!-- xsell_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { if (tep_not_null($xsell['specials_new_products_price'])) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&product_to_buy_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a>'; $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text) ; $col ++; if ($col > 2) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- xsell_products_eof //--> <?php } } ?>
  2. Really sorry about this - after a good nights sleep i found the info i was after. Sam - can i suggest the the module files are included in the contribution as well as the add on pages for featured products etc. It will help pepple like me out in the future. These can be found here: Modlue & Add-on Filesand although i had to make an amend to the module code for Featured Products it was a great starting point. Thanks again for this great contribution Matt
  3. Hi Spooks and Everyone Please can yuoou help me. I have trawled though loads of the 92 pages of this topic but can't find the answer to my question (thats not to say it isn't there, i just haven't found it). I have had this contribution working great on my site for a while now and it really is great. I have now installed the 'Featured Products' contribution and wanted to know how i can get the module on the index page that replaces the new products module to display with borders etc as per this contibution. I know that the latest version includes add on pages for the featured.php page, bu this doesnt help me with the index page module. Please help me out anyone??? Thanks in advance Matt S
  4. Hi Spooks/Sam I'd like to make a change to this contribution on my site www.orchardstables.co.ukrelating to the previous/next navigation bar. I would like to make a change to option 3 (display top & bottom) if possible so that there is the 'Results/Page' and 'Sort Order' box at the top only and the 'Displaying x to y (of z products)' and 'Result Pages: 1 2 3 4 [Next >>]' text at the bottom only (when required). Help much appreciated as always. Cheers Matt S
  5. Ref x-Sell COntribution. Hi Sam, The code for the xsell_products.php file that is pulled in to the product info page for this contribution is as follows. I am unfortunately not skilled enough to turn the infobox that this produces in to the same layout as elsewhere on my site where your contibution is working, so there is no surrounding infobox and header, each product has its own rounded corner border and shows a buy now and more info button and also displays salemaker and discount prices as i have elsewhere at www.orchardstables.co.uk. Is there anyway that you could help me with this. I think that the x-sell contribution is quite popular so it would surely be useful to a lot of people. Not to mention how it will keep my own site looking ace! Cheers Matt <?php /* $Id: xsell_products.php, v1 2002/09/11 // adapted for Separate Pricing Per Customer v4 2005/02/24 osCommerce, Open Source E-Commerce Solutions <http://www.oscommerce.com> Copyright (c) 2002 osCommerce Released under the GNU General Public License */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_XSELL_PRODUCTS); if ((USE_CACHE == 'true') && empty($SID)) { // include currencies class and create an instance require_once(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); } if ($HTTP_GET_VARS['products_id']) { $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, specials_new_products_price from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_XSELL); $num_products_xsell = tep_db_num_rows($xsell_query); if ($num_products_xsell > 0) { ?> <!-- xsell_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { if (tep_not_null($xsell['specials_new_products_price'])) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&product_to_buy_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a>'; $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text) ; $col ++; if ($col > 2) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- xsell_products_eof //--> <?php } } ?>
  6. Thanks for the reply. I believe it allows me to specify related products in the admin so that on the product pages there is a section at the bottom which shows related products, a little bit like the "customers also bought..." functionality. I dont think it will impact any thing exisitng but i will be keen to get the products displayed as recommended on the product pages in the same format i have across the rest of the site, in rounded corner boxes rather than the stock osc style i believe the contribution sets you up with. I will install on my local test server, havea play with it and then maybe post some of the code that needs to be played with?? Thanks Sam Matt
  7. Hey Sam I'm looking to add a cross sell contribution to my site over the next couple of days to coincide with getting a load of new products (just to create even more work for me!) and i wondered if you could advise whether any have been tested or will work with this contribution? Alternatively do you think you might be able to help me figure out the relevant code changes if i do go ahead with this. I'm looking at the moment at 'X-Sell v2-MS2 - Cross Sell for MS2' avialable here. I thought it best to ask the question now rather than making a load of changes then come looking for help when. Feeedback and support really appreciated as always. Matt www.orchardstables.co.uk
  8. Thanks Sam I really appreciate you having looked in to this for me. I hear that IE 9 will resolve a lot of these problems, run script much quicker and allow for rounded corners etc. Its not that i am a huge fan of IE but recognise that as the most used browser i have to build my site for it. One last thing if you don't mind? Now i have the line to emulate IE7 added to the relevant pages and ackowledging that something in my site means i can't handle setTimeout command, what code should i be using within the page-header-inc file? Should it be: var initFunction = function() { DD_roundies.addRule('.infoBoxProducts', '20px'); } window.onload = initFunction; ... which i came up with by stripping out the setTimeout element from the code you provided. Have i done this properly or have a i made a mess of this? Or should i use the original code for the contribution: onLoad=DD_roundies.addRule('.infoBoxProducts', '20px'); ??? Thanks Matt
  9. I understand why you say that if it has been tested okay on other sites but the error points to the line of code showing the time delay. If i remove the time delay and just enter the following: var initFunction = function() { DD_roundies.addRule('.infoBoxProducts', '20px'); } window.onload = initFunction; it works with no error. It seems to be the setTimeout element of the code you suggested that IE8 doesn't seem to like. Matt
  10. I'm still getting the error. Extract from page source is below which shows that the head meta and other code are in plave. The bottom line of the code extract is line 65 which is where IE says there is an error. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html dir="LTR" lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <title>Orchard Stables :: Buy Horse Tack and Equestrian Grooming Products Online</title> <meta name="Description" content="Orchard Stables is a dedicated online retailer selling high quality horse tack, grooming kits, stable accessories and rider-wear. We stock leading brand horse and stable essentials and discounted alternatives as well of a selection of gifts." > <meta name="Keywords" content="Orchard,Stables,grooming,horse,Oster,Equerry,set,kit,boots,gift,tack" > <meta name="robots" content="noodp" > <meta name="slurp" content="noydir" > <link rel="canonical" href="http://www.orchardstables.co.uk/index.php" > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > <!-- EOF: Header Tags SEO Generated Meta Tags --> <base href="http://www.orchardstables.co.uk/"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <link rel="shortcut icon" href="favicon.ico" > <meta name="google-site-verification" content="xXgS8kc4-2rgfvq-4CbIi412biThZYsYw804HO9_hNc" /> <style type="text/css"> .style2 { color: #8C3031; font-size: medium; font-family: Arial, Helvetica, sans-serif; } p.MsoNormal {margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:0cm; line-height:115%; font-size:11.0pt; font-family:"Calibri","sans-serif"; } .style3 { font-family: Arial, Helvetica, sans-serif; font-size: 12pt; } </style> <!-- page-header-inc.htc by Sam 12/20099 --> <style type="text/css"> <!-- span.ttip, span.ttip a, span.ttip.img { position:relative; z-index:1; } span.ttip a .large {display: none;} span.ttip a:hover img.large { z-index:30; position:absolute; display: inline; border:0px; margin:0px; margin-top:-10px; margin-left:-25px; } // --> </style> <!--[if lte IE 7]> <style type="text/css" media="screen"> span.ttip a:hover img.large { margin-left:-180px; display: block; } </style> <![endif]--> <script language="JavaScript" type="text/javascript" src="DD_roundies.js"></script> <script language="JavaScript" type="text/javascript" defer="true"> /* IE only */ var initFunction = function() { DD_roundies.addRule('.infoBoxProducts', '20px'); } window.onload = setTimeout(initFunction, 2000);
  11. I did change the code as well. I will try the new code you have proveded and report back.
  12. Hi Sam Thanks for your help. I made the changes but i am still getting the error pointing to the code you told me to use. The first time the page loaded i was also missing boxes again. So i'm still missing the occasional box and have IE giving me page error notices. Argh, it all seemed to be going so well. Matt EDIT: Also - some product images are now taking an age to load with the box remaining empty for 2-3 seconds before an image apears. Not sure it is related but I cetainly haven't had the problem in the past. I use the oscThumb contribution which caches small versions so it shouldn't be an issue :huh:
  13. Oh dear. I was wrong, it isn't doing thew trick at all. I'm getting a lot of boxes not showing across the site this morning and i have now spotted an error showing in the bottom left of the IE window saying: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Tablet PC 2.0; .NET CLR 1.1.4322; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; Media Center PC 6.0; AskTB5.6) Timestamp: Tue, 26 Jan 2010 10:40:46 UTC Message: Invalid argument. Line: 65 Char: 3 Code: 0 URI: http://www.orchardstables.co.uk/ Having looked at the page source line 65 is: onload=setTimeout(DD_roundies.addRule('.infoBoxProducts', '20px'), 2000); ... which is the line i added to try to fix the boxes problem. Any idead why this might be happening?? Any help gratefully received. Matt
  14. Thanks, that seems to have done the trick. I will keep an eye on it as it was only an occasional problem anyway. RE: Optimising, i have already turned off cat counts in admin and have had a read though some of the forum topics but there doesn't seem to be much of an idiots step by step guide, it is all rather technical. Thanks Spooks - cracking support on the contribution once again!
  15. Hi Spooks. I have just checked the fiel and that line is in there towards the end. You mentioned adding additional delays. I'm afraid i don't know what you mean by this or how to go about it.Please can you advise? Will this slow down page loads which i'm already finding quite slow??
×