Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mdscarrott

Pioneers
  • Posts

    34
  • Joined

  • Last visited

Everything posted by mdscarrott

  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??
  16. Hi All I have a weird thing happening with this contributiion. Sometimes when i go to my store page the border of some of the products in the thumbnail view of the new (i call them featured) products box are missing, but not for others. Refreshing the page eventually causes them to load but this can take three or four attempts. Has anyone else seen this behaviour? Any ideas? Site is here--> http://www.orchardstables.co.uk if you could have a look for me and tell me if you have any thoughts? Many thanks Matt
  17. Thats done it. Thank you very much. Contribution seems to be working well on my site now thanks to your help (Link) although the site is slow. Thats something i will have to work on, but at least it looks okay for now (at least i think it looks okay). Matt
  18. All is looking good. I have one more question though if you could please help. I have added the new_products file to the includes/modules folder and it displays as expected on the homepage. I have set the maximum value in admin to display just 4 products so it only shows one row (i have it set to thumbnails, 4 per row). I have also edited the file so the sort order is random. What i would like to know is how i can remove the following from the bottom of the page: "Displaying 9 to 12 (of 22 products) Result Pages: [<< Prev] 1 2 3 4 5 ... [Next >>] " I dont want this to offer additional pages, just show the 4 products i set in the maximum value. As I have it set to random it means that clicking through the pages is a silly exercise anyway as you are as likely to just see the same products time and time again as they are randomly displayed as the page loads. Please let me know if i am not clear as i know i have a habit of overcomplicating things and not expalining very clearly. Thanks Matt
  19. That worked a charm. Thank you so much for your help. :thumbsup: Matt
  20. Thanks for your patience. What i was trying to say in my last post was that you are correct, i have not completed the installation correctly. I have been unable to add the required code to the apllication top file because changes have already been made to this file by the QT Pro contribution. This means that i can not just replace the block of code shown in the installation file because i have already amended this code for the QT Pto contribution. I know that changes need to be made to the 'add_product' case but as i have an amended piece of code in here already i am not sure what changes to make. Standard osC 'add product' case looks like this: // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; and you provide great instructions for how to replace this with new code required for this contribution. My 'add product' case looks like this: // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { //++++ QT Pro: Begin Changed code $attributes=array(); if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); foreach ($attrlist as $attr) { list($oid, $oval)=explode('-',$attr); if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) $attributes[$oid]=$oval; } } if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { foreach ($HTTP_POST_VARS['id'] as $key=>$val) { if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) $attributes=$attributes + $HTTP_POST_VARS['id']; } } $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); //++++ QT Pro: End Changed Code } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; And as you can see is very different as a result of having the QT Pro contribution. I understand that i will need to make changes to this for the 'Buy Now' button to work, but i am not sure what changes to make as i am not very confident or skilled with code. Please can you help me to change my already re-worked application top file so that i can get the Buy Now button working. Matt
  21. Argh, you were right, the change hadn't been made to app top (i was sure i had) :blush: Okay - new problem , i'm afriad the change is betond me as i have the QT Pro contribution so my code for the app top section that needs changing looks like this: // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { //++++ QT Pro: Begin Changed code $attributes=array(); if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) { $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']); foreach ($attrlist as $attr) { list($oid, $oval)=explode('-',$attr); if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval) $attributes[$oid]=$oval; } } if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) { foreach ($HTTP_POST_VARS['id'] as $key=>$val) { if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val) $attributes=$attributes + $HTTP_POST_VARS['id']; } } $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); //++++ QT Pro: End Changed Code } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; I'm really sorry to be such a pain and to keep asking for help but can you provide any guidance on how i make change this QT Pro code to support the contribution? Thanks Matt
  22. Hi Sam Thanks for the quick reply. I'm sorry i didn't make myself clear. It went to the product page if options had to be set beofre i installed the contribution, since i have installed, and made the amends to application top, i find that it does not go to the product page. So in my old layout clicking buy now on t-shirts would go to the t-sirts page. Then i installed the contribution and now it just adds t-shirt to cart. I dont actually sell t-shirts, this is just a good example. What files can i perhaps show you so that you ,ight be able to check? I followed the installation instructions carefully, and did make the changes to app top as instructed. I'm getting worried now this isn't an easy fix :(
  23. Hi Sam and everyone. I'm starting to make some progress with this contribution on my test site and am delighted that SaleMAker is now supported. I downloaded the latest package and started a fresh so i was up to date. One problem i am having though is with the 'buy now' button. Previously if the product had options the buy now button would go to the product page for the user customer to select the relavant options., if theproduct had no options it would be added to cart. Now i have installed this contribution the buy now button always adds the product to the cart, regardless of if options are available. This means that customers can go ahead and order a T-Shirt for example and checkout without ever being propted for colour or size. Any advice and guidance gratefully received as always. Matt
×
×
  • Create New...