Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I make my 'bestsellers' a front page item


sheringham

Recommended Posts

...and have it as a table in its own right on the front (main page) as well as linking to it like it has been done here:

 

http://caraudiodirect.co.uk

 

any ideas how this can be done?

 

ALSO:

Is there a quick way to get the different little icons on each table as they have done in this example?

 

I have the bestsellers acting the same way,plus they are ranked only top10

the icons can be changed in one run with e.g. the contrib remove default images got that one running as well

 

need assitance? go ahead and ask ;)

dahui

Link to comment
Share on other sites

So how do I display bestsellers on the front page then?!

 

I created a standard osc-compliant site with language file and defined in filenames.php, e.g. copy of a blank privacy. than i took the code from bestellers box and modified it as follows:

 

like in most files the initial call my file is called mostsold ;)

  require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MOSTSOLD);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_MOSTSOLD));

 

that makes the query

 

<?php

 $rank = 1;
 $products_new_array = array();
 $products_new_query_raw = "select p.products_id, p.products_ordered, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, pd.products_description, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_BESTSELLERS);

?>

 

and this is the final output

          <tr>
           <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
           <td valign="top" class="main">N?<?php echo $rank++ . ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . $truncated = substr($products_new['products_description'], 0, 110) . '...<br><div align="right" style="font-size:10; font-weight: bold;">' . $products_price;?>    </div></td>
           <td align="right" valign="middle" class="main">  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
         </tr>

 

take care I truncate text to be displayed and put a rank counter counting simply up, orderd by p.products_ordered DESC before in query will bring out ranking from most ordered down

 

finally removed the next page stuff and set admin show bestsellers 10

 

thats it oh the link to call it than like in mainheader menu would be

 

<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_yrfilename, '', 'NONSSL') . '">linkname</a>' ;?>

 

and here is the working demo >>> My Webpage

 

hhope that helps if not we better try a messnger or skype.com, voice is easier ;) for me

 

dahui

Link to comment
Share on other sites

that makes the query

 

<?php

 $rank = 1;
 $products_new_array = array();
 $products_new_query_raw = "select p.products_id, p.products_ordered, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, pd.products_description, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_BESTSELLERS);

?>

 

now I remember, the query is adapted from prodouvts_new as everyone can clearly see not from bestsellers, sorry for misinformation

 

dahui

Link to comment
Share on other sites

Hi Peeeps

 

Im looking for something simular.. trying to change the front page to "what I want to sell more of" rather than the "whats new here"

 

Which way is the easiest? I have populated the site but now it shows as the last few items I did and they are not what I want there to push my site! LOL :-"

 

Can you help me by pointing me to the best contrib to change the page?

 

 

Many many thanks :blush:

 

Analiza Diaz

Link to comment
Share on other sites

Hi Peeeps

 

Im looking for something simular.. trying to change the front page to "what I want to sell more of" rather than the  "whats new here"

 

Which way is the easiest? I have populated the site but now it shows as the last few items I did and they are not what I want there to push my site! LOL :-"

 

Can you help me by pointing me to the best contrib to change the page?

Many many thanks :blush:

 

Analiza Diaz

I do not understand you right ( sorry I am italian native living in germany)

so you want to display stuff you want to push in sales ???

 

and at the moment you get out only products last modified?

 

query and sort issue, to my point of view but need more input to help, post some code snipplets

 

dahui

Link to comment
Share on other sites

Yeah spot on. When I finished populating the site I was left with products that have not much profit on. I want to change this to items of my own choice to make sure I promote the items that have more profit.

 

TIA

 

 

Diaz :rolleyes:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...