osCmax v2.5 User Manual
Results 1 to 5 of 5

Difficulty adding Product description to new_products.php

This is a discussion on Difficulty adding Product description to new_products.php within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi everyone, At present I am trying to add the description of each product to the featured products section on ...

      
  1. #1
    New Member mohawk's Avatar
    Join Date
    Feb 2009
    Location
    Ireland
    Posts
    15
    Rep Power
    0


    Exclamation Difficulty adding Product description to new_products.php

    Hi everyone,

    At present I am trying to add the description of each product to the featured products section on the index.php page

    any ideas??

    I know i need to reference the database product descriptions..

  2. #2
    osCMax Development Team met00's Avatar
    Join Date
    Oct 2005
    Location
    wherever I happen to be at the moment
    Posts
    854
    Blog Entries
    2
    Rep Power
    26


    Default Re: Difficulty adding Product description to new_products.php

    I would ask "why?", but something tells me that I won't like the answer.

    Look at product_info.php and copy ho it pulls a products description out and then paste that into the location in featured products where you want to add it (actually, it's the query that will have to be changed, because...). Then understand that featured products uses the products_listing from /includes/modules to display and you will have to change how that works so it will add the description to the display (and then you will have a one-off of how you do listing for featured products).

    Really a great deal of "one off"-ing a module to do something it really wasn't designed to do.

    So, let's start with a bit of requirements definition and ask, what is the end goal that you want to achieve here? Have you considered all the potential downsides? What if the description is 250 words, do you want all of it? Just the fist 300 characters? What if the first 300 characters has an opening tag (like an opening table tag) and you display that without proper closing tags that are at character 500?

    Like I said, what you may want is not really featured products, but a way to display a subset of products on a page that is NOT in the current model, but then you had best consider how that would best be done so that you don't trip yourself up when you do display the items (limiting the size of descriptive text, and doing so without creating broken HTML).
    so endith the lesson
    <think>sometimes I just sit's and thinks</think>
    "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB

  3. #3
    New Member mohawk's Avatar
    Join Date
    Feb 2009
    Location
    Ireland
    Posts
    15
    Rep Power
    0


    Default Re: Difficulty adding Product description to new_products.php

    Thanks for your response, I haven't tried implementing the code yet this morning but I will give it a go later when I get time.
    Just to answer why do it?

    I would like to give the website visitors a quick glance opportunity at 3 products displaying randomly on the homepage(index) featured or new products area.

    In the php I would strip out the html tags from the product description and truncate it to display a certain amount of characters, about a line or 2.

    The file I am currently working on is the new_products.php located in includes/modules/new_product.php

    I'll post back later to let you know if I get it to work

    Thanks
    Last edited by mohawk; 11-12-2009 at 12:27 AM.

  4. #4
    New Member mohawk's Avatar
    Join Date
    Feb 2009
    Location
    Ireland
    Posts
    15
    Rep Power
    0


    Default Re: Difficulty adding Product description to new_products.php

    I got it working, however I do see your point, Iv'e stripped the html and limited the chars but it looks a bit messy.

    Do you know if i can place the category name for the product in this spot instead of the product description?

  5. #5
    osCMax Development Team met00's Avatar
    Join Date
    Oct 2005
    Location
    wherever I happen to be at the moment
    Posts
    854
    Blog Entries
    2
    Rep Power
    26


    Default Re: Difficulty adding Product description to new_products.php

    Sure, just do an sql query against products_to_categories and then display the results.
    so endith the lesson
    <think>sometimes I just sit's and thinks</think>
    "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB

Similar Threads

  1. Difficulty trying to integrate "Add Multi Products Revi
    By earth-friendly in forum osCmax v2 Customization/Mods
    Replies: 3
    Last Post: 08-11-2006, 10:20 AM
  2. change # of items displayed on opening page=new_products.php
    By gameparts in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 03-28-2005, 04:32 AM
  3. new_products.php - How to modify products included?
    By gameparts in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 01-27-2005, 07:39 AM
  4. Difficulty with Easy Populate Contribution
    By anfry3 in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 05-20-2004, 01:29 PM
  5. Product Description
    By telsadek in forum osCommerce 2.2 Installation Help
    Replies: 0
    Last Post: 10-03-2003, 10:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •