www.in.no Posted December 27, 2012 Share Posted December 27, 2012 I am using AllProducts_SEO_v_1.3.zip as is the latest version in your package, with the price_list.php code posted here. Only other addons that are installed is HT SEO and USU both yours.. I have only modified the design to use more standard OSC design, have not touched any of the functions inside. The strange thing is that all-products is showing correct prize, but price_list is not. And if all was correct they both should show the same. Here is the content of the includes/functions/all-products.php file <?php /* $Id: all-products.php,v 1.6 2010/01/03 by Jack_mcs osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Portions Copyright 2009 oscommerce-solution.com Released under the GNU General Public License */ // group have products? function AP_CheckProducts($id_group){ $products_price_query = tep_db_query("select products_to_categories.products_id FROM products_to_categories where products_to_categories.categories_id = ".$id_group." LIMIT 0,1"); if ($products_price = tep_db_fetch_array($products_price_query)) { return true; } return false; } // list products determined group function AP_GetProducts($id_group, $width) { global $currencies, $languages_id; $query = ""; if(ALL_PRODUCTS_SEO_PRICE_SHOW_OUT_OF_STOCK == 'false') { $query = " and p.products_status = 1"; } $where = GetDisabledCats($where); $quotes = (defined('QUOTES_CATEGORY_NAME')) ? " and p.customers_email_address = '' and p.quotes_email_address = '' " : ''; $listing_sql = "select distinct pd.products_name, p.products_quantity, p.products_price, p.products_model, p2c.products_id, p2c.categories_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price FROM " . TABLE_PRODUCTS . " p inner join " . TABLE_PRODUCTS_DESCRIPTION ." pd on p.products_id = pd.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id inner join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id = p.products_id where p2c.categories_id = " . (int)$id_group . $query . $where . $quotes . " and pd.language_id = '" . $languages_id . "' order by pd.products_name"; $products_query = tep_db_query($listing_sql); $x=0; while ($products = tep_db_fetch_array($products_query)) { $cell = tep_get_products_special_price($products_price['products_id']); if($cell == 0) { $cell = $products['products_price']; } if ($x==1) { $rowBkgnd = ''; $x = 0; } else { $rowBkgnd = 'alt'; $x++; } echo '<tr class="' . $rowBkgnd . '">'; echo '<td align="left" width="' . $width . '%"> </td>'; if(ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') { echo '<td width="' . $width . '%" align="left" class="productListing-data"> (' . $products['products_quantity'] . ')</td>'; } if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') { echo '<td width="' . $width . '%" align="left" class="productListing-data">' . $products['products_model'] . '</td>'; } echo '<td width="' . $width . '%" class="productListing-data"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $products['products_id']) . '">' . str_replace(" ", " ", strip_tags($products['products_name'])) . '</a></td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') { echo '<td width="' . $width . '%" align="right" class="productListing-data">'; if (tep_not_null($products['specials_new_products_price'])) { echo '<span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</span> '; } else { echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . ' '; } } echo '</tr>'; } } // get all groups function AP_GetGroup($id_parent, $position){ global $languages_id; $groups_price_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id where c.parent_id = " . (int)$id_parent . " and cd.language_id = " . (int)$languages_id . " order by c.sort_order"); $titleShown = false; $cols = 2; if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') $cols++; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') $cols++; if (ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') $cols++; $width = floor(100/$cols); echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">'; while ($groups_price = tep_db_fetch_array($groups_price_query)) { $catpad = ""; $catPad = str_replace(" ", " ", str_pad($catPad, ($position * 3), " ", STR_PAD_LEFT)); //pad str wont accept so prefill and replace if($position == 0 && ! $titleShown) { $titleShown = true; echo '<tr><td colspan="' . $cols . '" width="100%" class="allCategoryPriceSubHdr"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_CATEGORY . '</td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') { echo '<td align="left" width="' . $width . '%"> ' . PRICE_HEADING_STOCK . '</td>'; } if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') { echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_MODEL . '</td>'; } echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_PRODUCT . '</td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') { echo '<td align="right" width="' . $width . '%">' . PRICE_HEADING_PRICE . ' </td>'; } echo '</tr></table></td></tr></table>'; } echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">'; if (AP_CheckProducts($groups_price['categories_id']) || $position == 0){ echo '<tr><td colspan="' . $cols . '" width="100%" class="allproductPriceSubHdr">' . $catPad . $groups_price['categories_name'] . '</td></tr>'; AP_GetProducts($groups_price['categories_id'], $width); } AP_GetGroup($groups_price['categories_id'],$position+1); } echo '</table>'; } function GetDisabledCats($where) { global $languages_id; $ap_query = tep_db_query("select * from " . TABLE_ALL_PRODUCTS_SEO . " where language_id = " . (int)$languages_id); $ap = tep_db_fetch_array($ap_query); $parts = explode(",",trim($ap['disabled_categories'], ",")); if (tep_not_null($parts[0])) { //at least one disabled category exists for ($p = 0; $p < count($parts); ++$p) { $catIDS .= " c.categories_id != $parts[$p] and "; } $catIDS = substr($catIDS, 0, -4); $where .= (tep_not_null($where)) ? " and $catIDS " : " where $catIDS "; } return $where; } function GetCategoryTree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) { global $languages_id; if (!is_array($category_tree_array)) $category_tree_array = array(); if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_ALL_CATEGORIES); if ($include_itself) { $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'"); $category = tep_db_fetch_array($category_query); $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']); } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']); $category_tree_array = GetCategoryTree($categories['categories_id'], $spacing . ' ', $exclude, $category_tree_array); } return $category_tree_array; } ?> Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 27, 2012 Author Share Posted December 27, 2012 Other than non-price related code, that is the same as what I use here. Try this. Find this line in that file: echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . ' '; and add this line immediately above it echo 'PRICE: '. $products['products_price'] .'<br>'. $products['products_tax_class_id'] .'<br>' . tep_get_tax_rate($products['products_tax_class_id']) . '<br>'; That will display all of the parts of the price and will, hopefully, show where the problem is at. Please post the result here if it doesn't help you find the problem. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 27, 2012 Share Posted December 27, 2012 Hi, What it output is this: PRICE: 100.0000 0 KR 100.0000 Looks like the tax id is not there, but i dont know what causing it as it display prices with tax all other places except from the price_list.php Is there any checking for the configuration value from config stating "Display Prices with Tax" Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 27, 2012 Share Posted December 27, 2012 The products_tax_class_id is set to 1 in the db. And the rate with same id is set to 25% Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 27, 2012 Share Posted December 27, 2012 (edited) For info: If you want to breake the line in all-products.php with letters and numbers into 2 seperate lines you can add this to the. In cataloge/all-products.php Find if (ALL_PRODUCTS_SEO_DISPLAY_NUMBERS == 'true') { Add over this if (ALL_PRODUCTS_SEO_BREAKE_2LINES == 'true') { $firstletter_let .= '<br>'; } and in phpmyadmin you can add INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'All Products break letters Numbers into 2 lines', 'ALL_PRODUCTS_SEO_BREAKE_2LINES', 'true', 'If set to true, breake letters and numbers into 2 lines', 279, 55, '', '', NULL, 'tep_cfg_select_option(array(''true'', ''false''), '); Then you can turn on off in admin under all-products. Edited December 27, 2012 by www.in.no Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 27, 2012 Author Share Posted December 27, 2012 Looks like the tax id is not there, but i dont know what causing it as it display prices with tax all other places except from the price_list.php Is there any checking for the configuration value from config stating "Display Prices with Tax" In that same file, find this line $listing_sql = "select distinct pd.products_name, p.products_quantity, p.products_price, p.products_model, p2c.products_id, p2c.categories_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price FROM " . and change it to $listing_sql = "select distinct pd.products_name, p.products_quantity, p.products_price, p.products_model, p2c.products_id, p2c.categories_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_tax_class_id FROM " . Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 27, 2012 Share Posted December 27, 2012 :) Thanks Jack. That worked.. Have not checked the changes you made yet as it is to late. Was it error in the script or the different in my shop..? Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 28, 2012 Author Share Posted December 28, 2012 The error was in my code. I don't know why it is working here though since I use the same code. It must be some difference in how the shop is setup, cache or the like. The correct way is with the change I posted and will be included in the next update. Thank you for bringing it to my attention. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 28, 2012 Share Posted December 28, 2012 (edited) I just updated my ALL-Products with some changes in the design so that the price list look more like stock osc. Feel free to use or include in a future version. There are 4 files to update/change. cataloge/price_list.php Removed a lot of tables code and changed it to use div's allready used in OSC. Added the continue button. Screenshot: Attached as files <?php /* $Id: price_list.php, v 1.0 All Products SEO v1.0 by Jack_mcs, http://www.oscommerce-solution.com osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 osCommerce Portions Copyright 2012 oscommerce-solution.com Released under the GNU General Public License */ require('includes/application_top.php'); include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALLPRODS_SEO); require(DIR_WS_FUNCTIONS . FILENAME_ALLPRODS_SEO); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } $print = (isset($_GET['print']) ? $_GET['print'] : 'no'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); $breadcrumb->add(TITLE_PRICE, tep_href_link(FILENAME_ALLPRODS_SEO_PRICE_LIST)); require(DIR_WS_INCLUDES . 'template_top.php'); ?> <div class="ui-widget infoBoxContainer"><br> <div class="ui-widget-header ui-corner-top infoBoxHeading"> <?php echo TITLE_PRICE . ' ' . date("Y") . ' '; ?> <?php // print function and edit remove by willross if ($print == "yes") { echo '<a class="smallText" style="font-size:10px;" title="Printable version" href="' . tep_href_link(FILENAME_ALLPRODS_SEO_PRICE_LIST, '', 'NONSSL') . '">' . "[full view]" . '</a>'; } else { echo '<a class="smallText" style="font-size:10px;" title="Printable version" href="' . tep_href_link(FILENAME_ALLPRODS_SEO_PRICE_LIST, 'print=yes', 'NONSSL') . '">' . "[printable version]" . '</a>'; } ?> </div> <div class="ui-widget-content ui-corner-bottom productListTable"> <?php AP_GetGroup(0,0); ?> </div><br> <!-- body //--> <div class="buttonSet"> <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?></span> </div> </div> <?php if ($print != "yes") { require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); } ?> /includes/functions/all-products.php Changed some of the code to use div's and moved all table generation into this file. The corrections above regarding TAX is included. <?php /* $Id: all-products.php,v 1.6 2010/01/03 by Jack_mcs osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Portions Copyright 2009 oscommerce-solution.com Released under the GNU General Public License */ // group have products? function AP_CheckProducts($id_group){ $products_price_query = tep_db_query("select products_to_categories.products_id FROM products_to_categories where products_to_categories.categories_id = ".$id_group." LIMIT 0,1"); if ($products_price = tep_db_fetch_array($products_price_query)) { return true; } return false; } // list products determined group function AP_GetProducts($id_group, $width) { global $currencies, $languages_id; $query = ""; if(ALL_PRODUCTS_SEO_PRICE_SHOW_OUT_OF_STOCK == 'false') { $query = " and p.products_status = 1"; } $where = GetDisabledCats($where); $quotes = (defined('QUOTES_CATEGORY_NAME')) ? " and p.customers_email_address = '' and p.quotes_email_address = '' " : ''; $listing_sql = "select distinct pd.products_name, p.products_quantity, p.products_price, p.products_model, p2c.products_id, p2c.categories_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_tax_class_id FROM " . TABLE_PRODUCTS . " p inner join " . TABLE_PRODUCTS_DESCRIPTION ." pd on p.products_id = pd.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id inner join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id = p.products_id where p2c.categories_id = " . (int)$id_group . $query . $where . $quotes . " and pd.language_id = '" . $languages_id . "' order by pd.products_name"; $products_query = tep_db_query($listing_sql); $x=0; while ($products = tep_db_fetch_array($products_query)) { $cell = tep_get_products_special_price($products_price['products_id']); if($cell == 0) { $cell = $products['products_price']; } if ($x==1) { $rowBkgnd = ''; $x = 0; } else { $rowBkgnd = 'alt'; $x++; } echo '<tr class="' . $rowBkgnd . '">'; echo '<td align="left" width="' . $width . '%"> </td>'; if(ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') { echo '<td width="' . $width . '%" align="left" class="productListing-data"> (' . $products['products_quantity'] . ')</td>'; } if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') { echo '<td width="' . $width . '%" align="left" class="productListing-data">' . $products['products_model'] . '</td>'; } echo '<td width="' . $width . '%" class="productListing-data"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $products['products_id']) . '">' . str_replace(" ", " ", strip_tags($products['products_name'])) . '</a></td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') { echo '<td width="' . $width . '%" align="right" class="productListing-data">'; if (tep_not_null($products['specials_new_products_price'])) { echo '<span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</span> '; } else { echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . ' '; } } echo '</tr>'; } } // get all groups function AP_GetGroup($id_parent, $position){ global $languages_id; $groups_price_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id where c.parent_id = " . (int)$id_parent . " and cd.language_id = " . (int)$languages_id . " order by c.sort_order"); $titleShown = false; $cols = 2; if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') $cols++; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') $cols++; if (ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') $cols++; $width = floor(100/$cols); echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">'; while ($groups_price = tep_db_fetch_array($groups_price_query)) { $catpad = ""; $catPad = str_replace(" ", " ", str_pad($catPad, ($position * 3), " ", STR_PAD_LEFT)); //pad str wont accept so prefill and replace if($position == 0 && ! $titleShown) { $titleShown = true; echo '<tr><td colspan="' . $cols . '" width="100%" class="allCategoryPriceSubHdr"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_CATEGORY . '</td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') { echo '<td align="left" width="' . $width . '%"> ' . PRICE_HEADING_STOCK . '</td>'; } if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') { echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_MODEL . '</td>'; } echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_PRODUCT . '</td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') { echo '<td align="right" width="' . $width . '%">' . PRICE_HEADING_PRICE . ' </td>'; } echo '</tr></table></td></tr></table>'; } echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">'; if (AP_CheckProducts($groups_price['categories_id']) || $position == 0){ echo '<tr><td colspan="' . $cols . '" width="100%" class="allproductPriceSubHdr">' . $catPad . $groups_price['categories_name'] . '</td></tr>'; AP_GetProducts($groups_price['categories_id'], $width); } AP_GetGroup($groups_price['categories_id'],$position+1); } echo '</table>'; } function GetDisabledCats($where) { global $languages_id; $ap_query = tep_db_query("select * from " . TABLE_ALL_PRODUCTS_SEO . " where language_id = " . (int)$languages_id); $ap = tep_db_fetch_array($ap_query); $parts = explode(",",trim($ap['disabled_categories'], ",")); if (tep_not_null($parts[0])) { //at least one disabled category exists for ($p = 0; $p < count($parts); ++$p) { $catIDS .= " c.categories_id != $parts[$p] and "; } $catIDS = substr($catIDS, 0, -4); $where .= (tep_not_null($where)) ? " and $catIDS " : " where $catIDS "; } return $where; } function GetCategoryTree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) { global $languages_id; if (!is_array($category_tree_array)) $category_tree_array = array(); if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_ALL_CATEGORIES); if ($include_itself) { $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'"); $category = tep_db_fetch_array($category_query); $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']); } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']); $category_tree_array = GetCategoryTree($categories['categories_id'], $spacing . ' ', $exclude, $category_tree_array); } return $category_tree_array; } ?> /includes/language/xxxx/all-products.php Just added one more so the heading is more correct. define('PRICE_HEADING_CATEGORY', 'KATEGORI'); define('PRICE_HEADING_PRODUCT', 'PRODUKT'); /style.css Just changes some of the properties and removed some that i dont use anymore as i have changed to styles already in OSC. /*** Begin All Products SEO ***/ .allproductsBox { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ffce00; padding:0px 3} a.allproductsBox { color: #ff0000; } a.allproductsBox:hover { color: #00cc00; } .allproductPriceHdr { font-family: Verdana, Arial, sans-serif; font-size: 14px; background: #bbc3d3; color: #000; font-weight : bold; } .allproductPriceSubHdr { font-family: Verdana, Arial, sans-serif; font-size: 12px; background: #A6C9E2; color: #FFF; font-weight : bold; } .allCategoryPriceSubHdr { border: 1px solid #4297d7; background: #5c9ccc; color: #ffffff; font-weight: bold; } h2 { font-size: 14px; font-weight: normal; margin-bottom: 0; padding-bottom: 5px; } /*** End All Products SEO ***/ Edited December 28, 2012 by www.in.no Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 28, 2012 Author Share Posted December 28, 2012 Thanks for posting the changes. The code for those are already changed in 1.4 but I haven't had time to upload them. But I will compare them to yours before doing that in case I missed something. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 28, 2012 Share Posted December 28, 2012 Just had a second look, would it help SEO wise to also have the modell as a text link to the product also. On both price_list and onn all-products. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 28, 2012 Author Share Posted December 28, 2012 If the model number is a branded model number, like if you sold hard drives and the model number of the drive was something commonly searched for and was mentioned on the product page, then it would help. But if it was just a made up number it probably wouldn't help much. Although, in general, any link will help a little so it wouldn't hurt. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 28, 2012 Share Posted December 28, 2012 (edited) Then it could be made as a turn on/off function from admin. And you could use it in many ways. BRAND-001 BRAND-001 ... BRAND2-001 etc... Edited December 28, 2012 by www.in.no Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 29, 2012 Author Share Posted December 29, 2012 I don't understand what you mean by use it in many ways but there is already an option to turn the model display on and off in the product listing settings. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 Turn on/off is ok, i was more thinking off text links where you can put brand name/ one main keyword as part of the text link. Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 Just a quick addon to the code posted with redesign. The code in bm_xxxxfiles must also be altered to remove the styles so it use stock osc style insted. Just so it is complete if someone want to change over. catalog/includes/modules/boxes/bm_categories.php /**** BEGIN ALL PRODUCTS SEO ****/ $categories_string .= '<div><a href="' . tep_href_link(FILENAME_ALLPRODS_SEO, '', 'NONSSL') . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_CATEGORIES . '">' . BOX_INFORMATION_ALLPRODS_SEO_CATEGORIES . '</a></div>'; if (ALL_PRODUCTS_SEO == 'true' && ALL_PRODUCTS_SEO_DISPLAY_PRICE_LIST == 'true') { $categories_string .= '<div><a href="' . tep_href_link(FILENAME_ALLPRODS_SEO_PRICE_LIST, '', 'NONSSL') . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_PRICE_LIST . '"><nobr>' . BOX_INFORMATION_ALLPRODS_SEO_PRICE_LIST . '</nobr></a></div>'; } /**** END ALL PRODUCTS SEO ****/ catalog/includes/modules/boxes/bm_specials.php /**** BEGIN ALL PRODUCTS SEO ****/ ' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br /><del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span></div>' . ' <a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_SPECIALS . '"><nobr>' . BOX_INFORMATION_ALLPRODS_SEO_SPECIALS . '</nobr></a></div>' . /**** END ALL PRODUCTS SEO ****/ catalog/includes/modules/boxes/bm_whats_new.php /**** BEGIN ALL PRODUCTS SEO ****/ ' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price . '</div>' . ' <a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_WHATSNEW . '"><nobr>' . BOX_INFORMATION_ALLPRODS_SEO_WHATSNEW .'</nobr></a></div>' . /**** END ALL PRODUCTS SEO ****/ Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 SOME copy and past issues in the last one. Just a quick addon to the code posted with redesign. The code in bm_xxxxfiles must also be altered to remove the styles so it use stock osc style insted. Just so it is complete if someone want to change over. catalog/includes/modules/boxes/bm_categories.php /**** BEGIN ALL PRODUCTS SEO ****/ $categories_string .= '<div><a href="' . tep_href_link(FILENAME_ALLPRODS_SEO, '', 'NONSSL') . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_CATEGORIES . '">' . BOX_INFORMATION_ALLPRODS_SEO_CATEGORIES . '</a></div>'; if (ALL_PRODUCTS_SEO == 'true' && ALL_PRODUCTS_SEO_DISPLAY_PRICE_LIST == 'true') { $categories_string .= '<div><a href="' . tep_href_link(FILENAME_ALLPRODS_SEO_PRICE_LIST, '', 'NONSSL') . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_PRICE_LIST . '"><nobr>' . BOX_INFORMATION_ALLPRODS_SEO_PRICE_LIST . '</nobr></a></div>'; } /**** END ALL PRODUCTS SEO ****/ catalog/includes/modules/boxes/bm_specials.php /**** BEGIN ALL PRODUCTS SEO ****/ ' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br /><del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>' . ' <a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_SPECIALS . '"><nobr>' . BOX_INFORMATION_ALLPRODS_SEO_SPECIALS . '</nobr></a></div>' . /**** END ALL PRODUCTS SEO ****/ catalog/includes/modules/boxes/bm_whats_new.php /**** BEGIN ALL PRODUCTS SEO ****/ ' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price . ' <br><br><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '" title="' . BOX_INFORMATION_ALLPRODS_SEO_WHATSNEW . '"><nobr>' . BOX_INFORMATION_ALLPRODS_SEO_WHATSNEW .'</nobr></a></div>' . /**** END ALL PRODUCTS SEO ****/ Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 Just a tip for the <nobr> tag used in the boxes. In case you havent already included it in next release use in code this <span class="nobr"> and add this to css. .nobr { white-space:nowrap; } Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 FOR INFO: CSS error in styelsheet after validating. Missing px at end /*** Begin All Products SEO ***/ .allproductsBox { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ffce00; padding:0px 3} should be /*** Begin All Products SEO ***/ .allproductsBox { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ffce00; padding:0px 3px} Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 There are one validating error in the code i made with moving all table to the all-products.php file.: There is need for one table in the /price_list.php file as the function is called upon itself inside /include/functions/all-products.php file <?php echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">'; AP_GetGroup(0,0); echo '</table>'; ?> And the all-products.php file with indications on whitch line to remove, function AP_GetGroup($id_parent, $position){ global $languages_id; $groups_price_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on c.categories_id = cd.categories_id where c.parent_id = " . (int)$id_parent . " and cd.language_id = " . (int)$languages_id . " order by c.sort_order"); $titleShown = false; $cols = 2; if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') $cols++; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') $cols++; if (ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') $cols++; $width = floor(100/$cols); //CUT FROM HERE TABLE echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">'; while ($groups_price = tep_db_fetch_array($groups_price_query)) { $catpad = ""; $catPad = str_replace(" ", " ", str_pad($catPad, ($position * 3), " ", STR_PAD_LEFT)); //pad str wont accept so prefill and replace if($position == 0 && ! $titleShown) { $titleShown = true; echo '<tr><td colspan="' . $cols . '" width="100%" class="allCategoryPriceSubHdr"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_CATEGORY . '</td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_QTY == 'true') { echo '<td align="left" width="' . $width . '%"> ' . PRICE_HEADING_STOCK . '</td>'; } if (ALL_PRODUCTS_SEO_PRICE_SHOW_MODEL == 'true') { echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_MODEL . '</td>'; } echo '<td align="left" width="' . $width . '%">' . PRICE_HEADING_PRODUCT . '</td>'; if (ALL_PRODUCTS_SEO_PRICE_SHOW_PRICE == 'true') { echo '<td align="right" width="' . $width . '%">' . PRICE_HEADING_PRICE . ' </td>'; } echo '</tr></table></td></tr></table>'; } echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">'; if (AP_CheckProducts($groups_price['categories_id']) || $position == 0){ echo '<tr><td colspan="' . $cols . '" width="100%" class="allproductPriceSubHdr">' . $catPad . $groups_price['categories_name'] . '</td></tr>'; AP_GetProducts($groups_price['categories_id'], $width); } AP_GetGroup($groups_price['categories_id'],$position+1); } //CUT END FROM HERE echo '</table>'; } Quote Link to comment Share on other sites More sharing options...
www.in.no Posted December 29, 2012 Share Posted December 29, 2012 The /all-products.php file does also have some errors. There are used a uppercase </A> tag, And the tep_draw_form had wrong parameter order. It was <?php echo tep_draw_form('allproducts_cat', FILENAME_ALLPRODS_SEO, '', 'post') and should be <?php echo tep_draw_form('allproducts_cat', FILENAME_ALLPRODS_SEO, 'post', '') all-products.php Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 30, 2012 Author Share Posted December 30, 2012 The <A> is not a problem. HTML is not case-sensitve. Thanks for mentioning the form error. It still works due to how the function formats it but it isn't correct so I will change it. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
www.in.no Posted December 30, 2012 Share Posted December 30, 2012 HTML is not case-sensitve, but validation at W3 looks like it is. :-) Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 30, 2012 Author Share Posted December 30, 2012 It might be but validation doesn't make any differeence for the most part. Unless there is a broken link, or something like that that causes a failure, getting a site to pass validation is just busy work, in my opinion. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
♥iTea Posted April 11, 2013 Share Posted April 11, 2013 We're considering your add-on for a wholesale shop but were wondering if you have some ideas about including attribute-prices in the pricelist. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.