Results 1 to 3 of 3

New Fields for Product Info...

This is a discussion on New Fields for Product Info... within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; I am currently working on a website that will contain nothing but clearanced items from the owner's other websites. Right ...

      
  1. #1
    New Member
    Join Date
    Oct 2003
    Posts
    7
    Rep Power
    0


    Default New Fields for Product Info...

    I am currently working on a website that will contain nothing but clearanced items from the owner's other websites.

    Right now, I am currently entering some html code in all of the product descriptions to change the font colors and boldness to show:

    Regular Price: xx.xx
    Clearance Price: xx.xx
    You Save: xx.xx


    I am interested in adding new fields to the product category in the database in order to expedite this process a little bit, since I am constantly adding new items to the site. BUT I NEED HELP PLEASE!

    I know that the new fields need to be added to the database (MySQL), but I'm not really sure which table and I don't know how to make them show up in the site admin page or on the website. It would be nice to have it automatically calculate the difference for me, but I'm not that picky.

    Does anyone have any ideas?

  2. #2
    Stu
    Stu is offline
    New Member
    Join Date
    Oct 2003
    Posts
    5
    Rep Power
    0


    Default

    You could just put everything on special which would take care of the original / clearance price and then you could just do some quick math in the product info page to subtract the difference between the two and figure the percentage savings. Then it's just a matter of formatting the necessary pages.

    Something like:


    $savings = ($product_info['products_price']) - $new_price;
    $percent_savings = ($savings / $product_info['products_price']) * 100;

    $products_price = 'Regular Price: <s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <br><span class="productSpecialPrice">Clearance Price: ' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '<br>You Save: <i>' . round($percent_savings) . '%!</i></span>';
    It's not clean code but I hope it gives you a start. If you want a dollar figure instead of a percentage, just substitute $savings for the round($percent_savings) bit. That $product_price line is just 1 line but could easily be broken up to make it more readable.

    Stu

  3. #3
    New Member
    Join Date
    Oct 2003
    Posts
    7
    Rep Power
    0


    Default

    Thanks for your response...

    I actually did think about that because I loved the strike through feature. The problem is that we have just enough parts to be too many to throw them all in there and I didn't see (although I may have overlooked) a way to create subcategories under the specials.

    But the code will be helpful... Thanks!

Similar Threads

  1. can osCMax v2 do custom product fields?
    By chint in forum osCmax v1.7 Discussion
    Replies: 11
    Last Post: 07-26-2005, 09:42 AM
  2. Custom Product Fields
    By ryanmhubbard in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 09-10-2004, 04:23 PM
  3. Additional Product Fields...
    By RichRodgers.net in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 05-15-2004, 05:46 PM
  4. Product Info Layout Changes, Add Fields To Database To Displ
    By Mibble in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 01-28-2004, 10:33 AM
  5. new product text fields
    By Rodland in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 04-11-2003, 03:29 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
  •