Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

000---000

Pioneers
  • Posts

    99
  • Joined

  • Last visited

Profile Information

  • Real Name
    Matt
  • Gender
    Male
  • Location
    UK

000---000's Achievements

  1. Another way I've found of doing it... <?php class foo { var $arr = array('134', '538', '553', '386', '538', '552', '134', '430', '545', '553', '548', '538', '553', '550', '538', '548', '550', '546', '548', '349', '348', '545', '538', '364', '552', '348', '349', '545', '364', '546', '386', '134'); } $foo = new foo(); $arr = 'arr'; $productid = $foo->{$arr}[date("d")]; $date_product_info_query = tep_db_query("select p.products_id, pd.products_url, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = $productid and pd.products_id = $productid"); $fproduct_info = tep_db_fetch_array($date_product_info_query); $products_price = $currencies->display_price($fproduct_info['products_price'], tep_get_tax_rate($fproduct_info['products_tax_class_id'])); echo '<table width=100% bgcolor="#ddddff" border=0><tr><td><h1>Todays featured product:</h1></td><tr><tr><td>'; echo '<table width=100% bgcolor="#eeeeff" CELLPADDING=5><tr> <td valign="top"> <table width=100% bgcolor="#eeeeff" height="100%"><tr><td valign="Top"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid) . '" width="100" height="100"><h1>' . $fproduct_info['products_name'] . '</h1></a><br><br>' . $products_price . ' </td></tr> <tr><td vvalign="bottom"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid) . '" width="100" height="100">' . tep_image(DIR_WS_IMAGES . $fproduct_info['products_image'], addslashes($fproduct_info['products_name']), 200, 200, 'hspace="5" vspace="5"') . '</a>' . '</td> </td></tr></table> <td bgcolor="#ffffff">'; $prod_link2 = tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid); function custom_echo($x) { if(strlen($x)<=2000) { echo $x; } else { $y=substr($x,0,2000) . '...more...'; echo $y; } } echo custom_echo($fproduct_info['products_description']) . '</td></tr></table>'; echo '</td></tr></table>'; ?> The last bit shortens the product listing/description to 2000 characters. File listed in filenames.php and then called into position via "require('whateveryousavedthisfileas.php');"
  2. @@burt I finally managed to work something out. By placing the following on the index page: <?php require('includes/daterotate.php');?> And then creating the following daterotate.php file, DEFINED in filenames.php too: <?php switch (date("d")) { case 1: $productid = 134; break; case 2: $productid = 538; .... case 31: $productid = 386; break; } $date_product_info_query = tep_db_query("select p.products_id, pd.products_url, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = $productid and pd.products_id = $productid"); $fproduct_info = tep_db_fetch_array($date_product_info_query); $products_price = $currencies->display_price($fproduct_info['products_price'], tep_get_tax_rate($fproduct_info['products_tax_class_id'])); echo '<table width=100% bgcolor="#eeeeee"><tr><td><h1>' . $fproduct_info['products_name'] . '</h1><br><br>' . $products_price . '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . (int)$productid) . '" width="100" height="100">' . tep_image(DIR_WS_IMAGES . $fproduct_info['products_image'], addslashes($fproduct_info['products_name']), 200, 200, 'hspace="5" vspace="5"') . '</a></td><td>' . $fproduct_info['products_description'] . '</td></tr></table>'; ?> Result: I created a table on the index page, which allows me to link a daily products, as per the case variable. Just thought I'd share it. I'm sure this is quite easy for some. Thanks for the help. Matt
  3. Fantastic. That's put me on the right lines. However, to recall the other product properties, as I realise that I may change a price in one place and not pick it up on the front page, how would I continue this code on? To call the image, description and price... As I think I just need to change the format around and not have a specific product image per day that relates to the product directly. FILENAME_PRODUCT_INFO brings up the "product_info.php/" part etc and the remainder of tep_href_link is the product link... I get that (I hope). DIR_WS_IMAGES gives me the image directory etc, but how do I call the product image from $productid? I've tried all sorts, the most logical seem to be... echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$productid) . '">' . tep_image(DIR_WS_IMAGES . $products_image . (int)$productid) . '</a>'; ?> or echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$productid) . '">' . tep_image(DIR_WS_IMAGES . $productsid['products_image']) . '</a>'; ?> But neither work. I've spent a few hours pulling apart other product listing code to try and give me the correct results. The best I've got is <img src="image/$productsid=963"> Am I misinterpreting the use of $productid here?
  4. I'm trying to create an info box where by each day of the month shows a different product. Just something to keep the site fresh (ish) and controllable. I'm no genius programmer, although I do have a vague idea of what goes on. I've set up a page so far which works out the day of the month, pretty easy. I now want to use that mechanism to define a different product and lay it out. Initially I have... <?php $today=date(d); if($today==1){ echo "<img src='images-by-date/1.jpg'>"; } elseif($today==2){ echo "<img src='images-by-date/2.jpg'>"; } ...and so on. This simply allows me to select a pre chosen image etc. My query is, I want to replace the echo image line with something like &productid=342 and then below the above 31 php elseif statements have an extra section which lays out the data according to that product id. I know how to layout the bottom section once I have a suitable variable to call from, I'm just not sure exactly how I specify the product. For example, I tried something like: if($today==1){ $productid=963; } But this just produced images-by-date/9 ??? When calling/using $productid further down. ie Using: <?php echo $product_info['products_image'] ?> How do I define that on the 1st of the month it always show product 963 for example? Thanks
  5. Hi, can someone advise of a contribution that shows the sub-categories in the menu all the time and allows nice formatting of layout. Like: Main Category Sub 1 Sub 2 Sub 3 Another main category Sub 4 sub 5 sub 6 sub 7 Main cat 4 Sub 8 sub 9 and so on... Thanks Matt
  6. refer to: http://www.oscommerce.com/forums/topic/103320-contribution-nochex-apc-payment-module/page__st__300__gopid__1536682entry1536682
  7. I've had problems with this for 2.2rca and just fixed them/it. (Am off dancing around the office now!!!) The solution to my problems appeared to be the need to remove some extra lines (white space) at the end of a file, after the ?php> closing tags. Check if any of the nochex files have unnecessary lines at the end of the file - after the php closing tag. My source of the info: http://www.geeklog.net/faqman/index.php?op=view&t=38 Also, I had me server guys set the server to display php errors as suggested by this guy in another post of mine: http://www.oscommerce.com/forums/topic/365067-testing-output/page__pid__1536632__st__0entry1536632 I don't know if this is of any use to anyone, as I think my editor may have added the blank space at the end of the file. I was using contib: p://www.oscommerce.com/community/contributions,2280 as advised by NOCHEX... Good luck Matt :D
  8. 000---000

    Testing output

    Hi, I'm self taught on the whole OSC idea, and I can edit and change site, install add-ons (usually), design etc all fairly well. However, how do you go about testing a site? I've installed a NOCHEX payment module and now need to test the output that it's sending to NOCHEX/the next page as it keeps freezing (comes up with blank page, URL says still /checkout_nochex.php, this is after Order Confirmation page, so should be loading through to NOCHEX site for payment.) Do I need some software to create or view the output? All I can check is the page that loads, which if I view the source, shows only a blank page. Thanks
  9. If I remove (change extension to phpx instead of php) the file nochex_apc_handler.php then the whole admin page shows, but the payment option won't show to the end user as an option.????
  10. Hi, I've recently installed the NOCHEX API payment modules on one of my OSC stores, but for some reason, there's an error in the admin when I try to install it. I have had Nochex working with one of my other websites and having duplicated the site over to this one, I know it should work. However, because I'm using a different site with the same NOXHEX account, I have set up a new payment page. For this, NOCHEX requires a different download in order to cope with using a MerchantID (can only have one email per NOCHEX account). I've followed the install, to the point of "installing" via the admin section of OSC, but cannot get any further. The admin page stops loading at the point of printing the text for the API module. Whereas usually you get the options on the right to install etc, here, there's nothing. Can anyone give me some pointers as to where to start looking please. I'm guessing something isn't correct with the language file link for starters as [** define('MODULE_PAYMENT_NOCHEXAPC_TEXT_TITLE', 'Secure (SSL) Payment via Nochex'); **] the text line should be 'Secure (SSL) Payment via Nochex' and not 'MODULE_PAYMENT_NOCHEX_APC_TEXT_TITLE' I don't have a backup prior to installing the initial NOCHEX (email only) module, which I feel may have something to do with it. Any help appreciated. Thanks Matt
  11. Also, I cannot view the reviews individually. I can write a review, it stores the image name in the data base review_images, i don't think the image is uploaded though. I can only view the full list of all reviews. Clicking on the product image within the review or clicking on the review name just brings up a blank page. There is an SEO add on, but turning that off only breaks the product_info page too.
  12. Hi, I have a site where the review images has stopped working a while ago, and it has only recently been pointed out to me. I get the following error when trying to upload an image or view the products review page. 1054 - Unknown column 'r.reviews_id' in 'on clause' select count(*) as total from reviews r, reviews_description rd left join reviews_images ri on r.reviews_id = ri.reviews_id and ri.reviews_status = '1' where r.products_id = '1278' and r.reviews_id = rd.reviews_id and rd.languages_id = '1' [TEP STOP] Can anyone help?
  13. I keep getting an error "syntax error1" when submitting the credit card details. Does anyone know what this error means. Thanks Matt PS I think I've solved the above login problems, although I had to use a redirect to send the user back to the non SSL site after login.
  14. SSL Login / HSBC XML API Module 2nd domain for SSL [Duplicated message - more appropraitely placed here rather than general install / config area] I have recently added SSL for my site, which I thought was working fine, until I have come to test it with the HSBC XML API module. Further more, to reduce the costs from my ISP I am sharing the secure area with another domain. Site www.firstsite.com redirects over to www.secondsite.com/hsbc-payment-area-for-firstsite/ to take the payment, login and account details. Although I haven't fully got the API module working yet, I think it is ok. The problem I was/am having is that the login did not redirect to a valid page (once SSL installed) despite the URL showing what should be a valid page. Instead I got a 404 error. I fixed this by editing catalog/includes/functions/general.php and changing function tep_redirect($url) { if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL } } header('Location: ' . $url); tep_exit(); } to function tep_redirect($url) { if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url $url = HTTP_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL } } header('Location: ' . $url); tep_exit(); } This edit resulted in the login page going back to the index.php page and showing the welcome screen rather than an error 404 page which seemed fine. However, when coming to test the payment section, I give 3 choices. Cheque, Paypal or Credit Card via HSBC XML API. The first two work fine. But the HSBC module redirects me back to the login, where even when the correct u&p are entered it simply reloads the login page. I'm assuming the HSBC module should not redirect me to the login page when I'm already logged in?? Changing the HTTPS to HTTP is not the cause of the issue as have tested the payment area with and without the extra "S". I am inclined to think that the login page issue I originally had with regards to the error 404 page may have something to do with this error as they both centre around the login.php page. Any idea greatfully received. Thanks Matt
  15. You need to specify something in the english.php maybe. Have a look through the contirbution notes to see if you missed something to do with that file.
×
×
  • Create New...