Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2


surfalot

Recommended Posts

jim, sent another message.. this time getting morepics integrated with something like related products contrib/recommended products/customers also purchased.. these will now all have be to be modded because the satndard osc image is no longer available.. let me know

Link to comment
Share on other sites

  • Replies 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

You'll have to use on of the pages modified by More Pics as a model. Pick a page that has the image size that you want, then compare it to stock osCommerce. There will be changes in the SQL and where the image is used. The changes are fairly simple to add to any well-designed page.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

You'll have to use on of the pages modified by More Pics as a model. Pick a page that has the image size that you want, then compare it to stock osCommerce. There will be changes in the SQL and where the image is used. The changes are fairly simple to add to any well-designed page.

 

Regards

Jim

 

but i have no idea how to run a database query into this below. this one is pulling the image p.products_image from an unmodded osc. dont know what to do :((( if you can, please try help:

 

$mtm= rand();

$xsell_cat_query = tep_db_query("select categories_id

from " . TABLE_PRODUCTS_TO_CATEGORIES . "

where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

 

$xsell_cat_array = tep_db_fetch_array($xsell_cat_query);

$xsell_category = $xsell_cat_array['categories_id'];

$new_limit = MAX_DISPLAY_ALSO_PURCHASED - $num_products_xsell;

$xsell_prod_query = tep_db_query("select distinct p.products_id,

p.products_image,

pd.products_name,

p.products_tax_class_id,

if(s.status, s.specials_new_products_price, p.products_price) as products_price

from " . TABLE_PRODUCTS . " p left join

" . TABLE_SPECIALS . " s on p.products_id = s.products_id,

" . TABLE_PRODUCTS_TO_CATEGORIES . " pc,

" . TABLE_PRODUCTS_DESCRIPTION . " pd

where pc.categories_id = '" . $xsell_category . "' and

pc.products_id = p.products_id and

p.products_id != '" . $HTTP_GET_VARS['products_id'] . "' and

p.products_id = pd.products_id and

pd.language_id = '" . $languages_id . "' and

p.products_status = '1'

order by rand($mtm) desc

limit " . MAX_DISPLAY_ALSO_PURCHASED);

 

while ($xsell = tep_db_fetch_array($xsell_prod_query)) {

$xsell['products_name'] = tep_get_products_name($xsell['products_id']);

 

echo '

<td width=174 valign=top style="padding-left: 3px">

<table cellspacing=0 cellpadding=0 width=160>

<tr><td height=13></td></tr>

<td width=87 valingn=top>

<table cellspacing=0 cellpadding=8>

 

<tr><td colspan=2 height=25 valign=middle align=left><a class="pr_name" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '"> ' . $xsell['products_name'] . '</a></td></tr>

<td width=73 valign=top><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'vspace=0') . '</a></td>

<tr><td><span class=ch6>only:</span> <span class=ch7>'.$currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])).'</span></td></tr>

Link to comment
Share on other sites

but i have no idea how to run a database query into this below. this one is pulling the image p.products_image from an unmodded osc. dont know what to do :((( if you can, please try help:

Like this

$xsell_prod_query = tep_db_query("select distinct p.products_id,
pi.image_filename,
pd.products_name,
p.products_tax_class_id,
if(s.status, s.specials_new_products_price, p.products_price) as products_price
from " . TABLE_PRODUCTS . " p left join
" . TABLE_SPECIALS . " s on p.products_id = s.products_id,
" . TABLE_PRODUCTS_TO_CATEGORIES . " pc,
" . TABLE_PRODUCTS_DESCRIPTION . " pd
left join " . TABLE_PRODUCTS_IMAGES . " pi on pd.products_id = pi.products_id and pi.product_page = '1' 
where pc.categories_id = '" . $xsell_category . "' and
pc.products_id = p.products_id and
p.products_id != '" . $HTTP_GET_VARS['products_id'] . "' and
p.products_id = pd.products_id and
pd.language_id = '" . $languages_id . "' and
p.products_status = '1'
order by rand($mtm) desc
limit " . MAX_DISPLAY_ALSO_PURCHASED);

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

if we modify admin/categories.php such that we can sill have the old osc image function available. that me a work around all other contribs built without morepics in mind?? like xsell.. can that be done??

Of course it could be done. It's a bad way to solve the problem, and would probably take more work than doing it right, but it could be done. Feel free to do so if you want.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Jim I tried it, it still doesn't work, my code looks like this now. What it does is it takes random products from a category and fills it into a recommended products field. the db query i'm not sure is pulling the image_filename into the code. So there's no image displayed. I tried comparing this code with also_purchased_products.php -- it seems fine. But I cannot understand why it's not displaying!!

 

This the code that will display the image (the entire code is below): <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['image_filename'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '

 

This is not getting the image from the database: tep_image(DIR_WS_IMAGES . $xsell['image_filename'],

 

FULL CODE BELOW: PLEASE HELP ME JIM.. SORRY ABOUT THE TROUBLE..

 

 

/* fill the box with all random products from the same category */

 

$mtm= rand();

$xsell_cat_query = tep_db_query("select categories_id

from " . TABLE_PRODUCTS_TO_CATEGORIES . "

where products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

 

$xsell_cat_array = tep_db_fetch_array($xsell_cat_query);

$xsell_category = $xsell_cat_array['categories_id'];

$new_limit = MAX_DISPLAY_ALSO_PURCHASED - $num_products_xsell;

$xsell_prod_query = tep_db_query("select distinct p.products_id, pi.image_filename,

pd.products_name,

p.products_tax_class_id,

if(s.status, s.specials_new_products_price, p.products_price) as products_price

from " . TABLE_PRODUCTS . " p left join

" . TABLE_SPECIALS . " s on p.products_id = s.products_id,

" . TABLE_PRODUCTS_TO_CATEGORIES . " pc,

" . TABLE_PRODUCTS_DESCRIPTION . " pd

left join " . TABLE_PRODUCTS_IMAGES . " pi on pd.products_id = pi.products_id and pi.product_page = '1'

where pc.categories_id = '" . $xsell_category . "' and

pc.products_id = p.products_id and

p.products_id != '" . $HTTP_GET_VARS['products_id'] . "' and

p.products_id = pd.products_id and

pd.language_id = '" . $languages_id . "' and

p.products_status = '1'

order by rand($mtm) desc

limit " . MAX_DISPLAY_ALSO_PURCHASED);

 

 

 

while ($xsell = tep_db_fetch_array($xsell_prod_query)) {

$xsell['products_name'] = tep_get_products_name($xsell['products_id']);

echo '

<td width=174 valign=top style="padding-left: 3px">

<table cellspacing=0 cellpadding=0 width=160>

<tr><td height=13></td></tr>

<td width=87 valingn=top>

<table cellspacing=0 cellpadding=8>

 

 

<td width=73 valign=top><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['image_filename'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>

 

</table>

Link to comment
Share on other sites

Ws thinking, maybe its a problem in admin/xsell.php -- I tried tweaking the code similar to the catalogue side for the database queries. No luck.. Need your expertise. Check the code beow for admin/xsell.php :

 

 

<?php

/* $Id$

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

xsell.php

Image Fix by Xpdream.com

Original Idea From Isaac Mualem [email protected] <mailto:[email protected]>

Complete Recoding From Stephen Walker [email protected]

*/

 

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

switch($_GET['action']){

case 'update_cross' :

if ($_POST['product']){

foreach ($_POST['product'] as $temp_prod){

tep_db_query('delete from ' . TABLE_PRODUCTS_XSELL . ' where xsell_id = "'.$temp_prod.'" and products_id = "'.$_GET['add_related_product_ID'].'"');

}

}

 

$sort_start_query = tep_db_query('select sort_order from ' . TABLE_PRODUCTS_XSELL . ' where products_id = "'.$_GET['add_related_product_ID'].'" order by sort_order desc limit 1');

$sort_start = tep_db_fetch_array($sort_start_query);

 

$sort = (($sort_start['sort_order'] > 0) ? $sort_start['sort_order'] : '0');

if ($_POST['cross']){

foreach ($_POST['cross'] as $temp){

$sort++;

$insert_array = array();

$insert_array = array('products_id' => $_GET['add_related_product_ID'],

'xsell_id' => $temp,

'sort_order' => $sort);

tep_db_perform(TABLE_PRODUCTS_XSELL, $insert_array);

}

}

$messageStack->add(CROSS_SELL_SUCCESS, 'success');

break;

case 'update_sort' :

foreach ($_POST as $key_a => $value_a){

tep_db_query('update ' . TABLE_PRODUCTS_XSELL . ' set sort_order = "' . $value_a . '" where xsell_id = "' . $key_a . '"');

}

$messageStack->add(SORT_CROSS_SELL_SUCCESS, 'success');

break;

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<style>

.productmenutitle{

cursor:pointer;

margin-bottom: 0px;

background-color:orange;

color:#FFFFFF;

font-weight:bold;

font-family:ms sans serif;

width:100%;

padding:3px;

font-size:12px;

text-align:center;

/*/*/border:1px solid #000000;/* */

}

.productmenutitle1{

cursor:pointer;

margin-bottom: 0px;

background-color: red;

color:#FFFFFF;

font-weight:bold;

font-family:ms sans serif;

width:100%;

padding:3px;

font-size:12px;

text-align:center;

/*/*/border:1px solid #000000;/* */

}

</style>

<script language="JavaScript1.2">

 

function cOn(td)

{

if(document.getElementById||(document.all && !(document.getElementById)))

{

td.style.backgroundColor="#CCCCCC";

}

}

 

function cOnA(td)

{

if(document.getElementById||(document.all && !(document.getElementById)))

{

td.style.backgroundColor="#CCFFFF";

}

}

 

function cOut(td)

{

if(document.getElementById||(document.all && !(document.getElementById)))

{

td.style.backgroundColor="DFE4F4";

}

}

</script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<td width="100%" valign="top">

<!-- body_text //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?></td>

</tr>

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15');?></td>

</tr>

</table>

 

<?php

if ($_GET['add_related_product_ID'] == ''){

?>

<table border="0" cellspacing="1" cellpadding="2" bgcolor="#999999" align="center">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" width="75"><?php echo TABLE_HEADING_PRODUCT_ID;?></td>

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

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

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

<td class="dataTableHeadingContent" colspan="2" nowrap align="center"><?php echo TABLE_HEADING_UPDATE_SELLS;?></td>

</tr>

<?php

$products_query_raw = 'select p.products_id, p.products_model, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by p.products_id asc';

$products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);

$products_query = tep_db_query($products_query_raw);

while ($products = tep_db_fetch_array($products_query)) {

?>

<tr onMouseOver="cOn(this); this.style.cursor='pointer'; this.style.cursor='hand';" onMouseOut="cOut(this);" bgcolor='#DFE4F4' onClick=document.location.href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>">

<td class="dataTableContent" valign="top"> <?php echo $products['products_id'];?> </td>

<td class="dataTableContent" valign="top"> <?php echo $products['products_model'];?> </td>

<td class="dataTableContent" valign="top"> <?php echo $products['products_name'];?> </td>

<td class="dataTableContent" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php

$products_cross_query = tep_db_query('select p.products_id, p.products_model, pd.products_name, p.products_id, x.products_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$products['products_id'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc');

$i=0;

while ($products_cross = tep_db_fetch_array($products_cross_query)){

$i++;

?>

<tr>

<td class="dataTableContent"> <?php echo $i . '.  <b>' . $products_cross['products_model'] . '</b> ' . $products_cross['products_name'];?> </td>

</tr>

<?php

}

if ($i <= 0){

?>

<tr>

<td class="dataTableContent"> -- </td>

</tr>

<?php

}else{

?>

<tr>

<td class="dataTableContent"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?></td>

</tr>

<?php

}

?>

</table></td>

<td class="dataTableContent" valign="top"> <a href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>"><?php echo TEXT_EDIT_SELLS;?></a> </td>

<td class="dataTableContent" valign="top" align="center"> <?php echo (($i > 0) ? '<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'sort=1&add_related_product_ID=' . $products['products_id'], 'NONSSL') .'">'.TEXT_SORT.'</a> ' : '--')?></td>

</tr>

<?php

}

?>

<tr>

<td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent">

<tr>

<td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

<td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td>

</tr>

</table></td>

</tr>

</table>

<?php

}elseif($_GET['add_related_product_ID'] != '' && $_GET['sort'] == ''){

$products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"');

$products_name = tep_db_fetch_array($products_name_query);

?>

<table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center">

<tr>

<td><?php echo tep_draw_form('update_cross', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_cross', 'post');?><table cellpadding="1" cellspacing="1" border="0">

<tr>

<td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%">

<tr class="dataTableHeadingRow">

<td valign="top" align="center" colspan="2"><span class="pageHeading"><?php echo TEXT_SETTING_SELLS.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_name['products_model'].') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td>

</tr>

<tr class="dataTableHeadingRow">

<td align="center"><?php echo tep_image(DIR_WS_CATALOG_IMAGES.$products_name['products_image'], 'width="100" height="100"');?></td></tr>

<tr>

<td align="center" valign="bottom"><br><?php echo tep_image_submit('button_update.gif') . '<br><br><a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>';?></td>

</tr>

</table></td>

</tr>

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" width="75"> <?php echo TABLE_HEADING_PRODUCT_ID;?> </td>

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

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

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

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

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

</tr>

<?php

$products_query_raw = 'select p.products_id, p.products_model, p.products_image, p.products_price, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by p.products_id asc';

$products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);

$products_query = tep_db_query($products_query_raw);

while ($products = tep_db_fetch_array($products_query)) {

$xsold_query = tep_db_query('select * from '.TABLE_PRODUCTS_XSELL.' where products_id = "'.$_GET['add_related_product_ID'].'" and xsell_id = "'.$products['products_id'].'"');

?>

<tr bgcolor='#DFE4F4'>

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

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

<td class="dataTableContent" align="center"> <?php echo ((is_file(DIR_FS_CATALOG_IMAGES.$products['products_image'])) ? tep_image(DIR_WS_CATALOG_IMAGES.$products['products_image'], 'width="100" height="100"') : '<br>No Image<br>');?><span class="konk2"></span>  </td>

<td class="dataTableContent"> <?php echo tep_draw_hidden_field('product[]', $products['products_id']) . tep_draw_checkbox_field('cross[]', $products['products_id'], ((tep_db_num_rows($xsold_query) > 0) ? true : false), '', ' onMouseOver="this.style.cursor=\'hand\'"');?> <label onMouseOver="this.style.cursor='hand'"><?php echo TEXT_CROSS_SELL;?></label> </td>

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

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

</tr>

<?php

}

?>

</table></form></td>

</tr>

<tr>

<td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent">

<tr>

<td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>

<td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td>

</tr>

</table></td>

</tr>

</table>

<?php

}elseif($_GET['add_related_product_ID'] != '' && $_GET['sort'] != ''){

$products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"');

$products_name = tep_db_fetch_array($products_name_query);

?>

<table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center">

<tr>

<td><?php echo tep_draw_form('update_sort', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_sort', 'post');?><table cellpadding="1" cellspacing="1" border="0">

<tr>

<td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%">

<tr class="dataTableHeadingRow">

<td valign="top" align="center" colspan="2"><span class="pageHeading"><?php echo TEXT_SETTING_SELLS.': '.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_name['products_model'].') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td>

</tr>

<tr class="dataTableHeadingRow">

<td align="right"><?php echo tep_image(DIR_WS_CATALOG_IMAGES.$products_name['products_image']);?></td>

<td align="right" valign="bottom"><?php echo tep_image_submit('button_update.gif') . '<br><br><a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>';?></td>

</tr>

</table></td>

</tr>

<tr class="dataTableHeadingRow">

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

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

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

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

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

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

</tr>

<?php

$products_query_raw = 'select p.products_id as products_id, p.products_price, p.products_image, p.products_model, pd.products_name, p.products_id, x.products_id as xproducts_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc';

$products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);

$sort_order_drop_array = array();

for($i=1;$i<=$products_query_numrows;$i++){

$sort_order_drop_array[] = array('id' => $i, 'text' => $i);

}

$products_query = tep_db_query($products_query_raw);

while ($products = tep_db_fetch_array($products_query)){

?>

<tr bgcolor='#DFE4F4'>

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

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

<td class="dataTableContent" align="center"> <?php echo ((is_file(DIR_FS_CATALOG_IMAGES.$products['products_image'])) ? tep_image(DIR_WS_CATALOG_IMAGES.$products['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : '<br>'.TEXT_NO_IMAGE.'<br>');?> </td>

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

<td class="dataTableContent" align="center"> <?php echo $currencies->format($products['products_price']);?> </td>

<td class="dataTableContent" align="center"> <?php echo tep_draw_pull_down_menu($products['products_id'], $sort_order_drop_array, $products['sort_order']);?> </td>

</tr>

<?php

}

?>

</table></form></td>

</tr>

<tr>

<td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent">

<tr>

<td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

<td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td>

</tr>

</table></td>

</tr>

</table>

<?php

}

?>

<!-- body_text_eof //-->

</td>

</tr>

</table>

<!-- body_eof //-->

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

JIM EVEN XSELL IS WORKING 100% NOW.. ALL I HAD TO DO WAS ADD A NEW PRODUCT, SO THATS' SORTED..

 

BUT I'm still having trouble with the popup..

 

I have a the main image with smaller thumbnails below it.. That works fine, but when I click a thumbnail it goes to an entire new product_info.php page for the same product. And that error message on the bottom pops up like I mentioned before.

 

However, in the More Pics settings, when I set:

 

Show original image on productinfo page >>> true

 

&

 

Use CSS Images instead of popup >>> false

 

And I then click that original image.. the popup works fine..

 

But it doesn't work when I click the smaller thumbnail icons.. I also don't get a zoom button image under the thumbnails, but I do for the ''original image'' setting under that image.

 

Not sure why it's doing this just for the thumbnails!!

Link to comment
Share on other sites

More notes..

 

With More Pics 6 Classic you could choose the image subdirectory..

 

I noticed you can't with the advanced.. All images get saves under the shop/images/ directory.. so can't have for example a shop/images/watches directory to store the images.. is there a way to incorporate subdirectories??

 

Also when creating a product and when you're previewing it. you can't preview you image obviously and it shows up as one of those empty blocks. is there a way to remove the image when previewing the product before listing. because the preview still expects the image from the old osc..

 

The main issue is the subdirectory -- if you have tons of products it would be useful if you could save images in different folders. this was possible in the standard more pics.. as you know, i'm too too good creating code etc. can you tweak it to get subdirectories??

Link to comment
Share on other sites

Tried and tried but cannot get the popup to work when the CSS thumbnails are present. Double checked the code. Its all correct:

 

<?php

if (MORE_PICS_LINK_CSS_IMAGES == 'true') {

echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, tep_get_all_get_params() . '#morepics') . '">' . tep_image (DIR_WS_IMAGES . $products_main_image, $product_info['products_name'], (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img border=0 src=images/zoom.gif></a>';

} else {

?>

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $products_main_image, addslashes($product_info['products_name']), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img border=0 src=images/zoom.gif></a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link (DIR_WS_IMAGES . $products_main_image) . '" target="_blank">' . tep_image (DIR_WS_IMAGES . $products_main_image, $product_info['products_name'], (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img border=0 src=images/zoom.gif></a>'; ?>

</noscript>

<?php

} // if (MORE_PICS_LINK_CSS_IMAGES ... else ...

// EOF: More Pics

?>

Link to comment
Share on other sites

I think maybe the popup is not supposed to work when the Image Box CSS is enabled..

 

How do I get both the popup and Image Box to work together. Like I mentioned Jim, I can't write the code. I will really appreciate your help on this!! PLEASE help me!!

Link to comment
Share on other sites

All i need is for the thumbnails to open the popup when clicked. i'm only going to use the CSS box, it will never be turned off so all I need is a popup zoom feature for the CSS box.. And I'm trying to mod it myself, i just can't get it right :(

Link to comment
Share on other sites

I think maybe the popup is not supposed to work when the Image Box CSS is enabled..

That's right. The thumbnails are supposed to make the large image appear in the image box, not the popup. If you want the popup instead, turn off the CSS box and set the Small Image size to create thumbnails on the page.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

That's right. The thumbnails are supposed to make the large image appear in the image box, not the popup. If you want the popup instead, turn off the CSS box and set the Small Image size to create thumbnails on the page.

 

Regards

Jim

 

Is there no way to get it to function as that both the CSS and popup can be used?? Because I need CSS, but some images are way too big to fit the CSS box and needs a popup.

 

Can you do this for me?? I know it takes time and effort and I'm willing to pay for it. since this function I have to have!! I have some supersized images, some 600x600!!

 

And the subdirectory thing?? I'm not sure if it helps, but MorePics Classic worls like that and that was good for not having too many images stored in the images directory especially if you have many products..

 

Let me know if you can help. Like I said, I know it's asking for your time so I will pay for it.. don't have any other option since this is the best contrib that comes with an image box :((

 

If you look at www.watchesshop.com >> they have what I need.. Popup and CSS!!

Link to comment
Share on other sites

Here is the direct link to how their watches are displayed:

 

http://www.watchesshop.com/products/AQ13.3...x-Set-6370.html

 

Mine is looking veru similar, I have the same CSS box working. Only when I click the thumbnail I can't get a popup which I desperately need for the closeups. You can see they have the same closeups which are too large for the CSS box.

 

PLEASE Jim, do this for me.. I don't have any other options. Yours is the best contrib on OSc..

Link to comment
Share on other sites

I don't have the time to code up something special just for you. Feel free to hire someone to do that for you if you want it that bad.

 

That's a poor site to be copying anyway. Bad user interface on the images and on the categories box. I'd find something that works better if you want to have a copy.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I don't have the time to code up something special just for you. Feel free to hire someone to do that for you if you want it that bad.

 

That's a poor site to be copying anyway. Bad user interface on the images and on the categories box. I'd find something that works better if you want to have a copy.

 

Regards

Jim

PLEASE CHECK UR PRIVATE MESSAGES URGENTLY!

Link to comment
Share on other sites

hi,

 

great contrib, works for me in admin and product_info page.

i dont use it elsewhere exept for product_listing where i am having the problem that my products get listed twice when i insert the querys in index.php

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1', " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' "
;

i guess i has got something to do with the left join but for some reason i cant figure it out, please help me! :blush:

 

REGARDS BERUSKA

Edited by beruska77
Link to comment
Share on other sites

There is a known bug with the Product Copy function in the Admin that can cause duplicates. I'll post a new version as soon as I can.

 

Your join is wrong because you are trying to join the Images table to the Specials table on a Products table field. Older versions of MySQL had a bug that would allow this to work under some circumstances. The newer versions will generate an error. You could try adding parentheses to group your joins, or join the Images table to another table that has the Products ID field, such as the Products Description or Products to Categories tables. Joining to the Specials table is not recommended because then only Specials would have images.

 

If you're trying to do this in the stock Product listing module, that file has already been modified and is available in the distribution. If you version is modified, try comparing your modified file to the one in the distribution.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

...

Regards

Jim

thank you for your answere...

the query is from the index file included in the latest

More Pics 2.0.7 Combined kymation 10 May 2009

 

This is a full package. It contains all of the latest versions from the partial uploads below.

 

The support thread is: http://www.oscommerce.com/forums/index.php?showtopic=182676

if i dont update the query then i dont have the images shown in product_listing :(

i am stuck with it somehow ¿¿¿ no mater how i do it, it comes out as having the product two times

or saying i dont have any products in that categorie!

 

REGARDS BERUSKA

Link to comment
Share on other sites

Go back to the original version (the one in the More Pics distribution.) Please verify for me that you see no product images in the products table for any category.

 

Next, check your Admin -> Catalog -> Product Images. Do you have one (and only one) image for each product that has the Category flag set (Green light in the listing under Category?)

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi

 

I have a slight issue and was hoping someone could help.

 

I have 16 images displayed on one product. I have the css format set to true so the thumbnails are display with one large image. This works but the thumbnails are displayed in one line and pushes my template out. Is there anyway I can have the thumbnails displaying in rows and columns? I have had a look myself but don’t really have a clue.

 

I am running More_pics_6 v2.0.3 For osC 2.2RC2a

 

I would be grateful if someone could help.

 

Thanks in advance.

Link to comment
Share on other sites

Try putting the images on the left or right side and see if you like that. If not, the code you need is Lines 121 through 145 of catalog/includes/modules/more_pics.php. You need to set up an index on that while() loop, then count how many images. Once the count is above your limit, add another copy of Line 141 followed by a copy of Line 129. This needs to be inserted around Line 138. If I'm not completely off my head here -- the anesthesia is starting to wear off.....

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...