Jump to content

Archived

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

clippers

Admin Catagories Table extra column

Recommended Posts

Hi

im trying to put a extra column in the Catagories table in the admin (for a quick glance)

Ive managed to do it with Cost price, Original quantity and stock location but im having trouble doing the Special Price,

Ive been using the "datatablecontent" section and checked my SQL to see what the table is called but all i get is zero or blank even if they have specials.

 

i added code the to sections of $sql_data_array and dataTableHeadingContent

 

I nearly got it right lol Can anybody point me to the right direction

 

here a snippet of the code, (i removed my attempts at placing it) but this should give you the general idea where i want to special price feed to show.

 

Thanks,

 

 

		    <td class="dataTableContent"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products['products_image'], $products['products_name'], 40, 40); ?></td>
<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td>
<td class="dataTableContent"><?php echo $products['products_original_quantity']; ?><td class="dataTableContent"><?php echo $products['products_locate']; ?><td class="dataTableContent"><?php echo $products['products_model']; ?></td><td class="dataTableContent"><?php echo $products['products_weight']; ?></td><td class="dataTableContent"><?php echo $products['products_quantity']; ?></td></td><td class="dataTableContent"><?php echo $currencies->format($products['products_cost']); ?></td>
<td class="dataTableContent"><?php echo $currencies->format($products['products_price']); ?></td>
		    <td class="dataTableContent" align="center">
<?php
  if ($products['products_status'] == '1') {
    echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
  } else {
    echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
  }
?></td>

Share this post


Link to post
Share on other sites

Im still having no joy, ive managed to put in Date Added by using this (putting them in the right areas)

 

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

 

<td class="dataTableContent"><?php echo $products['{roducts_date_added']; ?></td>

 

 

but it wont work like that with special prices

 

My products sql doesnt have a special price column so im assuming it is the Specials table in the SQL i need to use

 

In my head im thinking i need to connect specials_id with Product_id and the somehow connect the specials_new_products_price and then put that in the datatablecontent section of the catagories.php

 

So far my Headers in Admin Catagories i have :

 

Image, Catagories/Product, Date Added, Original Quantity, Location, Barcode, Weight, Quantity, Cost Price, Price, Special Price, Status, Sort Order

 

all infomation from the database is showing except the special price

 

any idea on how to do this? all i want it to have a quick glance in the admin section of Catagories/products

 

 

thank you

Share this post


Link to post
Share on other sites

Check through the specials.php page and see what the sql query is and see if you can add this to your area. How you do this I have no idea.


REMEMBER BACKUP, BACKUP AND BACKUP

Share this post


Link to post
Share on other sites

thanks for your relpy Steve :D

Thats what ive been trying, so far ive tried using this

 

<td class="dataTableContent"><?php echo $currencies->format($specials['specials_new_products_price']); ?></td>

 

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

 

but all it does is show 0.00 even if it has a special price, no errors showing or anything to give me an idea on where im going wrong. :(

Share this post


Link to post
Share on other sites

Hi

I've managed to do it with some help from Burt (mega star he is) I now have Specials showing in my category pages

lol ieven managed to have it in red too

 

 

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

 

 

<td class="dataTableContent"><span class="specialPrice"><?php echo $currencies->format($products['specials_new_products_price']); ?></td>

 

and added red bit to the second $products_query = tep_db_query under $products_count = 0; if (isset($HTTP_GET_VARS['search'])) {

 

} else {

 

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_quantity, s.specials_new_products_price, p.products_image, p.products_weight, p.products_price, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_original_quantity, p.products_locate, p.products_status, p.products_sort_order from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

 

Thank you so much to everyone who help me, im posting this fix as i allways think it better not to leave a post unfinished (w00t)

 

Emma

Share this post


Link to post
Share on other sites

×