Jump to content

alix32

Members
  • Content count

    32
  • Joined

  • Last visited

  • Days Won

    1

alix32 last won the day on October 10

alix32 had the most liked content!

Profile Information

  • Real Name
    Alix
  • Gender
    Male
  • Location
    Bordeaux, France
  1. alix32

    2nd Product Image replaces main image

    Thanks Raiwa for the tip on the workaround! And yes I should go to Bootstrap
  2. Hi - I' just upgraded from 2.2 to 2.3.4.1 (yes I will get to the BS version eventually, I'm years behind but want to release this version into production asap before I tackle bootstrap). Anyway...I have an interesting issue with my product images on the product_info page. I'm not using the original code as I want my sub-images to display smaller beneath the main image so I found this one (slightly tweaked): <?php if (tep_not_null($product_info['products_image'])) { $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); if (tep_db_num_rows($pi_query) > 0) { ?> <div id="piGal" style="float: left;"> <nav> <ul> <?php $pi_counter = 0; while ($pi = tep_db_fetch_array($pi_query)) { $pi_counter++; $pi_entry = '<li ' . ($pi_counter != 1 ? 'style="float:left;" class="imgthumbHover"' : '') . '><a href="'; $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image'], '', 'NONSSL', false); if ($pi_counter == 1) {$piwidth = '450'; $piheight = ''; } else { $piwidth = '102'; $piheight = '200'; } $pi_entry .= '"rel="zoombox">' . tep_image(DIR_WS_IMAGES . $pi['image'], $products_name, $piwidth, null) . '</a>'; $pi_entry .= '</li>'; echo $pi_entry; } ?> </ul> </nav> </div> <?php } else { ?> <div id="piGal" style="float: left;"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image'], '', 'NONSSL', false) . '"rel="zoombox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), 450, 450, 'hspace="5" vspace="5"') . '</a>'; ?> </div> <?php } } ?> I upload my first image it displays OK (it's loaded in the products table - products_image field). But when I upload a 2nd image, it replaces the 1st image. That 2nd image is correctly loaded in the products_images table with sort #1. And then when I upload a 3rd image (sort #2 in the products_images table as expected), that 3rd image appears as the 1st thumbnail...and my 1st image is still not displaying. Understand that my expectation with 3 images is to have the main image from the products table display with 2 thumbnail images beneath (sort 1 then sort 2). The problem looks to be around the pi_counter but really can't get my head round it. Any help would be really appreciated! Thanks
  3. Uhm well Mr Phil...I hear you. Right now I'm re-building the site on 2.3.4.1 as quickly as possible. I gave the BS Edge version a shot but couldn't get my head round it. Right now I just need to get the site running on PHP 5.6 at least before my host provider turns the lights off as I'm still running on PHP 4 + it's not compatible with TLS1.2. 2.3.4.1 was the fastest option for me to be back in business. And then I'll indulge into the BS version.
  4. Of course the sort_order! That worked perfectly thanks JcMagpie! <?php if (tep_db_num_rows($pi_query) > 1) { $pi_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' and sort_order=2"); ?>
  5. Hello all! I'm in the process of re-building my very old 2.2 site on 2.3.4. On the product_info page, my main image is displaying nicely along with its sub-images below. What I'd like to do now is copy over the image display code further down the page in a product description section. In that section, I'd like to display 2nd image of the product only if there are more than 1 image linked to that product, else I'd like to display the main image again. I've been scratching my head on this one but my poor knowledge of PHP has brought me to posting my question to this forum. So here's the code I have to display my product images. The main image appears in large (width of 410) and the next images appear smaller (width of 102) below the main image <?php if (tep_not_null($product_info['products_image'])) { $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order"); if (tep_db_num_rows($pi_query) > 0) { ?> <div id="piGal" style="float: left;"> <nav> <ul> <?php $pi_counter = 0; while ($pi = tep_db_fetch_array($pi_query)) { $pi_counter++; $pi_entry = ' <li ' . ($pi_counter != 1 ? 'style="float:left;" class="imgthumbHover"' : '') . '><a href="'; if (tep_not_null($pi['htmlcontent'])) { $pi_entry .= '#piGalimg_' . $pi_counter; } else { $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image'], '', 'NONSSL', false); } if ($pi_counter == 1) {$piwidth = '410'; $piheight = ''; } else { $piwidth = '102'; $piheight = '200'; } $pi_entry .= '"rel="zoombox[vacances]">' . tep_image(DIR_WS_IMAGES . $pi['image'], $products_name, $piwidth, null) . '</a>'; if (tep_not_null($pi['htmlcontent'])) { $pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>'; } $pi_entry .= '</li>'; echo $pi_entry; } ?> </ul> </nav> </div> <?php } else { ?> <div id="piGal" style="float: left;"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image'], '', 'NONSSL', false) . '"rel="zoombox[vacances]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?> </div> <?php } ?> I understand that code will display my main image wider and above my sub-images if the product has more than 1 image, else it just displays the only image linked to that product. But how could I change this code so that only the 2nd image displays if the product has more than 1 image, else display the only image linked to that product? Hope that makes sense and someone knowledgeable is willing to take a few mns to help me out, Thanks!
  6. Hi there, I'm getting a table not found issue although I can see the table in my database. 1146 - Table 'soonlineshop.NEWSLETTER_ABONNEMENT' doesn't exist select count(*) as checkinscrits from NEWSLETTER_ABONNEMENT where abonnement_addresse_email = 'test@@test.com' I checked the name of the table in both the database and in file newsletter_abonnement.php and they match so I have no idea how I could get that error. Would someone be able to help please? Thanks
  7. Ok thanks Jack - I'll just uninstall it and install the latest version and see what that does.
  8. Hi, I built an oscommerce site a while back www.mossurfing.com with this add on and made some tweaks to have hyphen separators between my category titles (www.mysite.com/category1-category2) Example: http://www.mossurfing.com/women-snow-jackets-c-118_127.html I am currently building a new site but with a different host this time. I just copied over my previous site to this new host however my hyphen separators get wiped out (www.mysite.com/category1category2) Example: http://www.soon-line.com/hommesaccessoires-c-112_159.html I haven't changed anything so I'm thinking this is an issue on the host side but what could it be? Any help/advice would be very welcome! Many thanks
  9. Hi, I have duplicated products accross several categories. I just installed the "Specials in Categories List" however the products show as many times as they have been duplicated. Would you know how I could fix the code so that each product would show once only? Here are the instructions I followed: Step 1: Using the Admin tool create a "Specials" category at the top level of the categories tree. Do NOT put any products in this category!!!! Make a note of the category id number. You can find this out by clicking on the Specials link and looking at the URL in your browser where it says "......index.php?cPath=xx&....." the xx is the category id. +++++++++++++++++++++++++++++++ Step 2: Open up \catalog\index.php in your editor At line 15 immediately after: require('includes/application_top.php'); add: // Flag for SPECIALS category - change this number to your specials category id number if ($cPath == 30) { change 30 to xx from your URL $AHspecials = 1; } +++++++++++++++++++++++++++++++ Step 3: at about line 186 find: } else { // show the products in a given categories immediately after } else { add: if ($AHspecials == 1) { // We show all specials $listing_sql = "select " . $select_column_list . " p.products_id, pd.short_desc, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and s.status = '1' and p.products_id = p2c.products_id and p.products_id = s.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "'"; } else { +++++++++++++++++++++++++++++++++ Step 4: at about line 199 immediately after } } add: } +++++++++++++++++++++++++++++++++ save \catalog\index.php. Step 5: Add specials to your site by using the Admin tool "Catalog, Specials" Do NOT put any products in the Special category using "Catalog, Categories / Products" they will not show!!!! Thanks for your help!!
  10. Hi! Thanks a lot for taking the time to reply. Your first option is actually something I never thought of although it sounds bleeding obvious :) Well in my situation it is as I only have about 20 products on sale so great for short term solution. In the longer term I will look into this 2nd option. Thanks again
  11. Hi, In the product listing and for all products on sale, I'd like to have a "sale" written on the product's image. Has anyone got an idea of how to do this? Many thanks!
  12. alix32

    Who's Online Enhancement 1.4

    Today it's working and i haven't touched anything! No idea of what went wrong. Sorry for the waist of time Glen. Alix
  13. alix32

    Who's Online Enhancement 1.4

    Hi Glen and thanks a lot for your reply. I haven't touched the Javascript options...do you know where I should be looking at? I believe it's in my internet options / advanced? It may be my Java version? Thanks
  14. alix32

    Who's Online Enhancement 1.4

    Hi, I installed version 3.5.4 and is brilliant. However, although I haven't touched anything, my pages don't refresh anymore. It looks like this happens since I updated to IE7. has this happened to anyone too? Is there a fix to this? Thanks, Alix
  15. I've found the problem! :blush: When I moved to the new server, the options "track stock?" in the admin/products_attributes.php page had defaulted back to no. So I just had to set each of my product options in the top left hand corner of the page to yes. Sorry!
×