Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sell a product on the home page


landlordaccounting

Recommended Posts

Posted

I want to advertise one product on the home page, instead of the new, featured, or soon to arrive items sections. Can I add a specific Product Info page with a "buy now" or "add to cart" button on the homepage? I know how to move boxes, but what about put in a product for sale on the home page?

 

thanks!

 

Jonathan

Posted
I want to advertise one product on the home page, instead of the new, featured, or soon to arrive items sections. Can I add a specific Product Info page with a "buy now" or "add to cart" button on the homepage? I know how to move boxes, but what about put in a product for sale on the home page?

 

thanks!

 

Jonathan

 

 

this is kinda a simple problem, or so i think. I must just be overlooking something... ?

Posted
this is kinda a simple problem, or so i think. I must just be overlooking something... ?

 

go to includes/modules

 

copy the file new_products.php and rename it to myfeatured_product.php

 

adjust the call to show that file in index php,

find this (it's way down, line 312 if vanilla)

          <tr>
           <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
         </tr>
<?php
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

 

change to

          <tr>
           <td><?php include(DIR_WS_MODULES . 'myfeatured_product.php'); ?></td>
         </tr>
<?php
  // include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

 

open that newly created file myfeatured_product.php

find this:

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
   $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
   $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 

replace by this and add the products_id of the product you want to feature:

    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_id = 'herecomesyours' ");

 

then you need to change the header of the box:

find this:

  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

replace by this and do not forget to add a new define in the language file for index.php:

  $info_box_contents[] = array('text' => TABLE_HEADING_MYFEATURED);

 

of course this will create a cell only 1/3 of the page, but you can make further adjustments if you want to show a big pic and full width

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...