Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

products viewed/purchased/conversion rate


mazza

Recommended Posts

I made this for myself to compare the views and purchases. It helps finding products that have some flaw in picture, description or something similar.

 

Open file admin/stats_products_purchased.php

 

find:

 

  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>

               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

               <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PURCHASED; ?> </td>

 

add after:

 

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VIEWED; ?> </td>

           <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CONVERSION; ?> </td>

 

find:

 

 

 

$products_query_raw = "select p.products_id, p.products_ordered, pd.products_name pd.products_viewed from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id. "' and p.products_ordered > 0 group by pd.products_id order by p.products_ordered DESC, pd.products_name";

 

replace with:

 

 $products_query_raw = "select p.products_id, p.products_ordered, pd.products_name, pd.products_viewed, ((p.products_ordered / pd.products_viewed)*100) as conversion from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id. "' and p.products_ordered > 0 group by pd.products_id order by conversion DESC, pd.products_name";

 

find:

 

    <td class="dataTableContent" align="center"><?php echo $products['products_ordered']; ?> </td>

 

add after:

 

<td class="dataTableContent" align="center"><?php echo $products['products_viewed']; ?></td>

          <td class="dataTableContent" align="center"><?php echo $products['conversion']; ?><?php echo '%'; ?></td>

 

Open admin/includes/languages/english/stats_products_purchased.php and add:

 

define('TABLE_HEADING_VIEWED', 'Viewed');

define('TABLE_HEADING_CONVERSION', 'Conversion');

 

If someone would like to build a better interface with maybe sorting capabilities and stuff and release it as a contribution, you have my blessings.

"Use no way as way, have no limitation as limitation." - Bruce Lee

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...