Jump to content



Latest News: (loading..)

RMD27

Member Since 16 Oct 2009
OFFLINE Last Active May 03 2013 11:50 AM
-----

Topics I've Started

RichSnippets - Double Entries Name & Price

13 March 2013 - 06:39 PM

Anyone using Rich Snippets?

It produces two lines for product name and the same for price.

Anyone had this experience and more importantly a solution!? :)

RC2 V2.2

Product Listing Gallery View - Whats wrong with this contribution?

01 March 2013 - 09:02 PM

I wanted the product listing in a grid format so I chose this contribution.

It does the job cosmetically but it keeps adding rows to the database when it is running. Which also gets reflected in the admin > configuration > product listing screen.

the contribution is here http://addons.oscommerce.com/info/7159

These are the install instructions



  ______ _____
/\__  _\ __   /'\_/`\ /\`\ /\   _`\
\/_/\ \//\_\ /\   \\/_/ ____ ___ ____\ \ \/\_\  
\ \ \\/\ \\ \ \__\ \   /',__\   / __`\  /',__\\ \ \/_/_
\ \ \\ \ \\ \ \_/\ \ /\__, `\ /\ \L\ \/\__, `\\ \ \_\ \
  \ \_\\ \_\\ \_\\ \_\\/\____/ \ \____/\/\____/ \ \____/
   \/_/ \/_/ \/_/ \/_/ \/___/   \/___/  \/___/   \/___/


   ____ ___ __   
  /\  _`\ /\_ \    /\ \__  __   
  \ \,\L\_\ ___\//\ \ __  __\ \ ,_\/\_\ ___ ___ ____  
   \/_\__ \   / __`\\ \ \  /\ \/\ \\ \ \/\/\ \  / __`\ /' _ `\  /',__\
/\ \L\ \/\ \L\ \\_\ \_\ \ \_\ \\ \ \_\ \ \/\ \L\ \/\ \/\ \/\__, `\
\ `\____\ \____//\____\\ \____/ \ \__\\ \_\ \____/\ \_\ \_\/\____/
  \/_____/\/___/ \/____/ \/___/   \/__/ \/_/\/___/  \/_/\/_/\/___/

http://www.tim-international.net


This contribution let's you easily list multiple products per row. Similar to
the Contribution Products List in Columns (http://addons.oscommerce.com/info/112)
but this contribution requires no modding. Just simply replace the desired listing
module in the includes/modules directory. The modules are all independent from
eachother.

* products_listing.php
  Replaces the old behavior with multipe products per row in a standard infobox.
  The infobox will hopefully satisfy the STS users =)

* new_products.php
  Makes the module conform to the Products Listing settings and look.

* also_purchased_products.php
  Makes the module conform to the Products Listing settings and look.



INSTALLATION INSTRUCTIONS
-------------------------

1) Create a full backup on your webshop's files and database.

2) Upload the files in this package that comply with your osCommerce installation.

3) Browse your webshop and make sure the contribution is working.

4) Administrate the number of columns in admin panel under:
   Configuration -> Product Listing -> Number of products per row

  (This database entry is being created automatically upon first load of any of the listing modules.)


These is the product listing file

<?php
/*
$Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
if (!defined('PRODUCT_LIST_COLUMNS')) {
tep_db_query(
	 "insert into configuration
	 (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added)
	 VALUES ('Number of products per row', 'PRODUCT_LIST_COLUMNS', '5', 'Set the number of products per row to display?', '8', '11', now());"
);
define('PRODUCT_LIST_COLUMNS', '5');
}

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}

if (tep_not_null($_GET['manufacturers_id'])) {
$manufacturer_query = tep_db_query(
	 "select manufacturers_name
	 from " . TABLE_MANUFACTURERS . "
	 where manufacturers_id = '" . tep_db_input($_GET['manufacturers_id']) . "';"
);
$manufacturer = tep_db_fetch_array($manufacturer_query);
$info_box_header = $manufacturer['manufacturers_name'];
if (tep_not_null($_GET['filter_id'])) {
	 $category_query = tep_db_query(
	 "select cd.categories_name
	 from
		 " . TABLE_CATEGORIES . " c,
		 " . TABLE_CATEGORIES_DESCRIPTION . " cd
	 where c.categories_id = '" . tep_db_input($_GET['filter_id']) . "'
	 and cd.categories_id = '" . tep_db_input($_GET['filter_id']) . "'
	 and cd.language_id = '" . (int)$languages_id . "'"
	 );
	 $category = tep_db_fetch_array($category_query);
	 $info_box_header .= ' &gt; '. $category['categories_name'];
}
}

if (tep_not_null($current_category_id)) {
$category_query = tep_db_query(
	 "select cd.categories_name
	 from
	 " . TABLE_CATEGORIES . " c,
	 " . TABLE_CATEGORIES_DESCRIPTION . " cd
	 where c.categories_id = '" . (int)$current_category_id . "'
	 and cd.categories_id = '" . (int)$current_category_id . "'
	 and cd.language_id = '" . (int)$languages_id . "'"
);
$category = tep_db_fetch_array($category_query);
$info_box_header = $category['categories_name'];
}

$info_box_contents = array();
$info_box_contents[] = array('text' => $info_box_header);
new contentBoxHeading($info_box_contents);
$row = 0;
$col = 0;
$list_box_contents = array();
if ($listing_split->number_of_rows > 0) {
$listing_query = tep_db_query($listing_split->sql_query);
while ($listing = tep_db_fetch_array($listing_query)) {
	
	 $lc_align = 'center';
	 $lc_text = '<table cellpadding="2" cellspacing="0" border="0">' . "\r\n";
	
	 foreach ($column_list as $column) {
	 switch($column) {
	
	 // Row: Products model
		 case 'PRODUCT_LIST_MODEL':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center">'. $listing['products_model'] . '</td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
	 // Row: Product's image
		 case 'PRODUCT_LIST_IMAGE':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, (isset($_GET['manufacturers_id']) ? 'manufacturers_id=' . $_GET['manufacturers_id'] : ($cPath ? 'cPath=' . $cPath : '')) . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
		
	 // Row: Product's name
		 case 'PRODUCT_LIST_NAME':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, (isset($_GET['manufacturers_id']) ? 'manufacturers_id=' . $_GET['manufacturers_id'] : ($cPath ? 'cPath=' . $cPath : '')) . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
		
	 // Row: Manufacturer's name
		 case 'PRODUCT_LIST_MANUFACTURER':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center"><span style="color: #666666;">'. $listing['manufacturers_name'] . '</span></td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
		
	 // Row: Price
		 case 'PRODUCT_LIST_PRICE':
		 if (tep_not_null($listing['specials_new_products_price'])) {
			 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center"><s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .'</s><br><span class="productSpecialPrice">'. $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 } else {
			 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 }
		 break;
		
	 // Row: Product's quantity
		 case 'PRODUCT_LIST_QUANTITY':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center">'. TABLE_HEADING_QUANTITY .': '. $listing['products_quantity'] . '</td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
		
	 // Row: Product's weight
		 case 'PRODUCT_LIST_WEIGHT':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center">'. TABLE_HEADING_WEIGHT .': '. $listing['products_weight'] . '</td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
	 // Row: Buy now button
		 case 'PRODUCT_LIST_BUY_NOW':
		 $lc_text .= ' <tr>' . "\r\n"
					 . ' <td align="center"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td>' . "\r\n"
					 . ' </tr>' . "\r\n";
		 break;
	 }
	 }
	
	 $lc_text .= '</table>' . "\r\n";
	
	 $list_box_contents[$row][$col] = array(
	 'align' => $lc_align,
	 'params' => 'width="'. round(100/PRODUCT_LIST_COLUMNS) .'%" class="productListing-data"',
	 'text' => $lc_text
	 );
	
	 $col ++;
	 if ($col > (PRODUCT_LIST_COLUMNS-1)) {
	 $col = 0;
	 $row ++;
	 }
}

while ($col != 0 && sizeof($list_box_contents[$row]) < PRODUCT_LIST_COLUMNS) {
	 $list_box_contents[$row][$col] = array(
	 'align' => 'center',
	 'params' => 'width="'. round(100/PRODUCT_LIST_COLUMNS) .'%"',
	 'text' => '&nbsp;'
	 );
	
	 $col ++;
}

new productListingBox($list_box_contents);
} else {
$list_box_contents = array();
$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
								 'text' => TEXT_NO_PRODUCTS);
new productListingBox($list_box_contents);
}
if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}
?>

Obviously I have to remove it but opinions on the contribution and possible suggestions for fixes welcome

Columns Side by Side on Same Side

15 June 2012 - 12:56 PM

If you know what I mean,

I want to out the right and left columns on the right hand side.

I want them side by side, not one on top of the other

This is the code I used


<!-- right_navigation //-->
<tr>
<td><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?></td>
<td><?php require(DIR_WS_INCLUDES . 'column_right_pi.php'); ?></td>
</tr>
<!-- right_navigation_eof //-->

but this puts one on top of the other.

Im stumped can anyone help me out?

removing www from URL

02 June 2012 - 06:35 PM

rc2.2
seo urls

I have tried this and it breaks the links on the site

https://my.bluehost.com/cgi/help/htaccess_redirect

Any one have any ideas?

I can post my.htaccess if that helps?