Jump to content

mrjohnpc

Members
  • Content count

    18
  • Joined

  • Last visited

  1. mrjohnpc

    Newsletter products, HTML email

    Hi, This is a great contribution. Is there anyway to incorporate the send feature of the stock product_notification module into this contribution? I'd like to be able to pick the recipients of a newsletter rather than send it to everyone. Thanks again for the great contrib. John
  2. Hi Jeff, Thanks again for the reply. That contribution - Product Listing by Category is the one I added. It's my basic attempt at accomplishing this task. I'm hoping to develop, or work with someone to develop, it to include the extra functionality outlined in the previous message.
  3. Hi Jeff, Thanks for the reply. Here's the code or the contribution (so far) <?php // The really simple product listing by category box for osCommerce MS2. // by John Behan, Mr. John PCS // enquiries@mrjohnpcs.ie // www.mrjohnpcs.ie // 10-10-2006 // Take info from database // This is what calls the data from your database, there are a few parameters to set here // "&& products_to_categories.categories_id = 2" change the 2 to the category number you want to limit the list to. (You can find out the category number by opening your site in your browser and under the categories list infobox find the link to the category you need, then hover over the link with your mouse pointer, the staus bar of your browser will display the link to this category. the number you need is at the end of the link, should be something like "cPath=2". // "LIMIT 4" limits the list to 4 items, you can change this to whatever you want, if you delete this the list will include all items in that category $result = mysql_query("SELECT products_description.products_name, products_to_categories.categories_id, products_to_categories.products_id, products_description.products_id FROM products_to_categories, products_description WHERE products_to_categories.products_id=products_description.products_id && products_to_categories.categories_id = 2 ORDER BY products_viewed DESC LIMIT 4") or die(mysql_error()); // end take info from database // Heading of List // This can be removed or changed to whatever you want echo "Theatre Tickets"; echo "<br>"; // End of Heading // Keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row // This will create a nice, tableless list of products, change it as you see fit echo "<div class='tickets_list'>"; // Again the "2"on this line should be changed to match the category you are using // (If anyone knows how to change this link to link to dynamically link to each product let me know please!) echo "<a href='index.php?cPath=2'>"; echo $row['products_name']; echo "</a>"; echo "</div>"; echo "<br>"; //End of Print } ?> This is doing exactly what I need to a point. It's really very simple, but if I'd realised what was needed a few days ago I'd have saved myself a lot of time trying to hack existing contributions! What this does is create a list of the top 4 prducts from a specfic category (in this case category 2) What I'd like to add to it is- The first product listed will display it's image and name, the rest of the prducts will just display their name. I'd also like to add a "Click here for all products in this category" link at the bottom of the list. I've one other request that I forgot to mention before. I'd like to have each product in the list linking to the product rather than back to the category. At the moment they are linking to the category using a static link coded into the script. I've been trying to get this link to be dynamic created using the product_id parameter, but I haven't had any success. I feel the syntax I'm using is wrong as the way I'm trying to create the link seems to make sense, here's the code I've been trying to use - echo "<a href='product_info.php?products_id='>"; echo ['products_id']; echo $row['products_name']; echo "</a>"; Thanks again. Can you let me know if I've over-simplified the code I'm using for this? I'm afraid I may have left a gaping security hole or bug there that will come back to haunt me. Talk to you soon, John
  4. Hi, I've put together a very simple contribution that I am using on a site. It is a very basic way of listing the products from a particular category. It's available at - http://www.oscommerce.com/community/contributions,4595 I've put this together using an online tutorial and it mostly does what I need. I'd like to add a couple of things to it, so I was hoping for your input. I'd like to have the image from the first product in the list displayed, but not displayed for any of the other products listed. I'd also like to have an "All Products in this category" link at the end of the list. Any help would be greatly appreciated. Thanks, John
  5. mrjohnpc

    Include Infobox within Main Content

    Hi Bill, Thanks for the reply. I'm starting to narrow down the problem a bit, but I've gone as far with it as I can at this moment. I've changed the content within the colums of my page to reflect what I intend to do with them. I've been attempting to remove all tables from the core code of oscommerce. I'm not a php coder, so to do this I've been hacking my way through the code inching forward through trial and error. I'm almost there, but an issue still exists - If I remove all the tables from the index.php file the frontpage's main content works fine but the product page is broken (i.e. it displays no products) Conversely if leave the tables intact on the index.php file apart from the section of that file that deals with the main content, if I remove the tables here but leave the rest of the file's tables intact the frontpage's main content doesn't appear. I have a half an understanding of why this is happening, and I hope to resolve it by the time I've finished the site and hacked the tables out of the rest of the files that I am using in oscommerce. In the meantime I have found a workaround - remove most of the tables from the section of index.php that deals with the frontpage's main content but leave it wrapped in a table tag (also add a <td> <tr> wrap so firefox recognises it as a table and accepts table formatting in the css file) Now how this issue relates to the current problem I'm having - The file I wish to call is in the boxes folder and is called 'products.php' I've added an STS tag for this and it is being called in the left-most column of the page, (it's the scroll-list with Products as a title). I've tried using the php include in index.php and the result is a blank screen when page loading is attempted. I've played around with this and I'm certain the correct file is being called. At this stage I'm lost as to the reason for this problem and how to fix it. I'll send you a zip file containing the site's index.php file, the template, the products.php file, and a draft design jpg of what I am hoping to achieve on this page. Thanks again for all your help. Talk to you soon, John
  6. Hi, I'm working on this site - http://www.mrjohnpcs.org/index.php I'm using STS to template the thing, and so far everythings working out fine. I've added a few other components and using the sts_inc/sts_user_code.php file I've been able to incorporate them into the template's mainpage. I'm trying to incorporate another component - Product Listing Infobox. It will work fine when called from the main template page - \includes\sts_templates\..\template.html But I want it to be embedded in the main content of the page, i.e. under the $content call to \index.php. As you can see from the site, this component is working fine in the left most column which is calling it from the template file, but I can't get it to work in the middle three columns which are calling their content from index.php. (the right most of the three central columns is using php echo at the moment). I hope this makes sense. I've little knowledge of php, it's top of a long list of things to learn, so I may be going about this the wrong way. Any help would be greatly appreciated. John
×