I'm working with phpShop and can't get any answers on their site, so I'm thinking and hoping someone here will be able to help me...
What I'm wanting is a table with 2 columns, 3 rows in it...Without the duplicating of products. Here is the code that I have:
Quote:
quote:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/*
* Special Products Module
*
* @version $Id: mod_phpshop_featureprod.php,v 1.6 2004/12/06 21:08:08 soeren_nb Exp $
* @package Mambo_4.5.1
* @subpackage mambo-phpShop
*
* @copyright (C) 2000 - 2004 Mr PHP
// W: www.mrphp.com.au
// E: [email protected]
// P: +61 418 436 690
* Conversion to Mambo and the rest:
* @copyright (C) 2004 Soeren Eberhardt
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*/
global $mosConfig_absolute_path;
/* Load the phpshop main parse code */
require_once( $mosConfig_absolute_path.'/components/com_phpshop/phpshop_parser.php' );
//maximum number of items to display
$max_items = $params->get( 'max_items', 2 );
$category_id = $params->get( 'category_id', null );
require_once ( CLASSPATH. 'ps_product.php');
$ps_product = new ps_product;
$db = new ps_DB;
if ( $category_id ) {
$q = "SELECT DISTINCT product_sku FROM #__pshop_product, #__pshop_product_category_xref, #__pshop_category WHERE ";
$q .= "(#__pshop_product.product_parent_id='' OR #__pshop_product.product_parent_id='0') ";
$q .= "AND #__pshop_product.product_id=#__pshop_product_categ ory_xref.product_id ";
$q .= "AND #__pshop_category.category_id=#__pshop_product_cat egory_xref.category_id ";
$q .= "AND #__pshop_category.category_id='$category_id'";
$q .= "AND #__pshop_product.product_publish='Y' ";
$q .= "AND #__pshop_product.product_special='Y' ";
$q .= "ORDER BY product_name ASC LIMIT 0, $max_items";
}
else {
$q = "SELECT DISTINCT product_sku FROM #__pshop_product WHERE ";
$q .= "product_parent_id='' AND vendor_id='".$_SESSION['ps_vendor_id']."' ";
$q .= "AND #__pshop_product.product_publish='Y' ";
$q .= "AND #__pshop_product.product_special='Y' ";
$q .= "ORDER BY product_name ASC LIMIT 0, $max_items";
}
$db->query($q);
$i = 1;
?>
<table align="left" width="130" rowspan="1" class="phplatest">
<tr> <?php
while($db->next_record()){
if ($i++ % 2)
$class="sectiontableentry1";
else
$class="sectiontableentry2";
?>
<td>
<?php
$ps_product->show_snapshot($db->f("product_sku"));
?>
</td>
<td> <?php
$ps_product->show_snapshot($db->f("product_sku"));
?>
</td>
</tr>
<?php
}
?>
</table>
|
Here is the link you can view it at:
http://rs347.securehostserver.com/~meemmusi/us/
Thank you for any help you can give me!!!