Jump to content



Photo
- - - - -

[Contribution] Cross Sell (X-Sell) Admin


  • Please log in to reply
572 replies to this topic

#61   slackbladder

slackbladder
  • Members
  • 27 posts
  • Real Name:Tony

Posted 14 May 2003 - 06:18

I made the changes and uploaded everything. It appeard to be working until I tried to add the first cross sell item: Got the following message:

Cross-Sell (X-Sell) Admin

1136 - Column count doesn't match value count at row 1

INSERT INTO products_xsell VALUES ('',30,68,1)

[TEP STOP]


Any idea what could be wrong? Was I supposed to make a modification to the table? I could use a bit of help here as it looks like I am pretty close to getting this module to work.
thanks.


I did the following from the xsell_readme.txt file:

STEP 8
If you have problems, try flushin the table with this

DROP TABLE IF EXISTS products_xsell;
CREATE TABLE products_xsell (
ID int(10) NOT NULL auto_increment,
products_id int(10) unsigned NOT NULL default '1',
xsell_id int(10) unsigned NOT NULL default '1',
sort_order int(10) unsigned NOT NULL default '1',
PRIMARY KEY (ID)
) TYPE=MyISAM;

Worked for me! /biggrin.gif' class='bbc_emoticon' alt=':D' />

#62   MurrayM

MurrayM
  • Members
  • 296 posts
  • Real Name:Murray Mintz
  • Location:Santa Monica, California

Posted 14 May 2003 - 11:53

I followed the instructions and flushed the table; Now when I click on a product, I get the following message:
Parse error: parse error in /catalog/product_info.php on line 207
Line 207 is approximately just after I pasted the change

<?php
//added for cross -sell
if ( (USE_CACHE == 'true') && !SID) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
}
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
}
?>
Being new to PHP, does this error indicate the problem lies in this file, or in the two files in catalog/includes named above.
thanks

#63   Paul_w

Paul_w
  • Members
  • 118 posts
  • Real Name:Paul Whiter
  • Gender:Male
  • Location:Northamptonshire, UK

Posted 14 May 2003 - 11:58

I followed the instructions and flushed the table; Now when I click on a product, I get the following message:
Parse error: parse error in /catalog/product_info.php on line 207
Line 207 is approximately just after I pasted the change

<?php
//added for cross -sell
if ( (USE_CACHE == 'true') && !SID) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
}
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
}
?>


I had this problem too, to fix it replace with the code below:

<?php

//added for cross -sell

   if ( (USE_CACHE == 'true') && !SID) { 

    echo tep_cache_also_purchased(3600); 

   } else { 

     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 

      include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

    }

   }

?>

On a different note, I have to say this contribution is good, BUT for someone with a large catalogue like me with over 1000 products the admin section is an absolute nightmare to use..... I'll have to look into improving it I guess!

#64   slackbladder

slackbladder
  • Members
  • 27 posts
  • Real Name:Tony

Posted 14 May 2003 - 12:33

Having the entire listing broken down into their individual categories would work for me /biggrin.gif' class='bbc_emoticon' alt=':D' />

And also being able to show the model number in the listing.

Tony

#65   blackhorse

blackhorse
  • Members
  • 8 posts
  • Real Name:Mark

Posted 14 May 2003 - 14:35

Hi!

Ive just installed the x-selling contrib.

The admin Area just look like that:

Cross-Sell (X-Sell) Admin

ID Product Name Cross Items Cross Sell Actions



E-Commerce Engine Copyright 2003 osCommerce
osCommerce provides no warranty and is redistributable under the GNU General Public License

Powered by osCommerce


There are no products shown at all! Why?? :shock:

Can anyone help?

Thank you!
Mark

#66   MurrayM

MurrayM
  • Members
  • 296 posts
  • Real Name:Murray Mintz
  • Location:Santa Monica, California

Posted 14 May 2003 - 15:41

Paul's suggestion fixed the problem and it works, however I was surprised to see that the box title appears on every category page, including those which there is not any cross selling. It would be better if it could only show up where products are suggested.

#67   slackbladder

slackbladder
  • Members
  • 27 posts
  • Real Name:Tony

Posted 14 May 2003 - 17:29

Firstly, A GREAT MOD /biggrin.gif' class='bbc_emoticon' alt=':D' /> /biggrin.gif' class='bbc_emoticon' alt=':D' />

Secondly, within admin is it possible to show the model field as well as or instead of the product description?

I have a lot of products that have the same description/title and its difficult to tell which one is which! :shock:

Any help would be much appreciated.

Thx
Tony


OK - I've figured it out /biggrin.gif' class='bbc_emoticon' alt=':D' />

This will sort by and display the model number/code:

Tony /smile.gif' class='bbc_emoticon' alt=':)' />



<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2002 osCommerce

Released under the GNU General Public License

cross.sale.php created By Isaac Mualem im@imwebdesigning.com <mailto:im@imwebdesigning.com>

Modified by Andrew Edmond (osc@aravia.com)
Sept 16th, 2002

add: Multi Languages Fix, 02/28/2003
(mail@michaelding.net)
*/

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();


?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<title><? echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<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 //-->
<? include(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->


<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>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo "Cross-Sell (X-Sell) Admin"; ?></td>
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>

<!-- body_text //-->
<td width="100%" valign="top">
<!-- Start of cross sale //-->

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td align=center>
<?php
/* general_db_conct($query) function */
/* calling the function: list ($test_a, $test_/cool.gif' class='bbc_emoticon' alt='B)' /> = general_db_conct($query); */
function general_db_conct($query_1)
{
$result_1 = tep_db_query($query_1);
$num_of_rows = mysql_num_rows($result_1);
for ($i=0;$i<$num_of_rows;$i++)
{
$fields = mysql_fetch_row($result_1);
$a_to_pass[$i]= $fields[$y=0];
$b_to_pass[$i]= $fields[++$y];
$c_to_pass[$i]= $fields[++$y];
$d_to_pass[$i]= $fields[++$y];
$e_to_pass[$i]= $fields[++$y];
$f_to_pass[$i]= $fields[++$y];
$g_to_pass[$i]= $fields[++$y];
$h_to_pass[$i]= $fields[++$y];
$i_to_pass[$i]= $fields[++$y];
$j_to_pass[$i]= $fields[++$y];
$k_to_pass[$i]= $fields[++$y];
$l_to_pass[$i]= $fields[++$y];
$m_to_pass[$i]= $fields[++$y];
$n_to_pass[$i]= $fields[++$y];
$o_to_pass[$i]= $fields[++$y];
}
return array($a_to_pass,$b_to_pass,$c_to_pass,$d_to_pass,$e_to_pass,$f_to_pass,$g_to_pa
ss,$h_to_pass,$i_to_pass,$j_to_pass,$k_to_pass,$l_to_pass,$m_to_pass,$n_to_pass,$
o_to_pass);
}//end of function

// first major piece of the program
// we have no instructions, so just dump a full list of products and their status for cross selling

if (!$add_related_product_ID )
{
/* Multiple Language fix --- mail@michaelding.net <mailto:mail@michaelding.net> */

$query = "SELECT
b.language_id,a.products_id, b.products_name, b.products_description,a.products_quantity, a.products_model, a.products_image,b.products_url, a.products_price
FROM
products a,products_description b WHERE b.products_id = a.products_id AND b.language_id = 1
ORDER BY a.products_model;";



list ($LANGUAGE_id,$PRODUCTS_id, $PRODUCTS_name, $PRODUCTS_description , $PRODUCTS_quantity , $PRODUCTS_model , $PRODUCTS_image , $PRODUCTS_url , $PRODUCTS_price ) = general_db_conct($query);

?>

<table border="0" cellspacing="1" cellpadding="2" bgcolor="#999999">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" nowrap>ID</td>
<td class="dataTableHeadingContent">Model</td>
<td class="dataTableHeadingContent">Product Name</td>
<td class="dataTableHeadingContent" nowrap>Cross Items</td>
<td class="dataTableHeadingContent" colspan=3 nowrap>Cross Sell Actions</td>
</tr>
<?php
$num_of_products = sizeof($PRODUCTS_id);
for ($i=0; $i < $num_of_products; $i++)
{
/* now we will query the DB for existing related items */
$query = "select b.language_id, b.products_name, a.xsell_id from " . TABLE_PRODUCTS_XSELL . " a, products_description b WHERE b.products_id = a.xsell_id and b.language_id = 1 and a.products_id ='".$PRODUCTS_id[$i]."' ORDER BY sort_order";
list ($Language_id, $Related_items, $xsell_ids) = general_db_conct($query);

echo "<tr onMouseOver="cOn(this);" onMouseOut="cOut(this);" bgcolor='#DFE4F4'>";
echo "<td class="dataTableContent" valign="top">&nbsp;".$PRODUCTS_id[$i]."&nbsp;</td>n";
echo "<td class="dataTableContent" valign="top">&nbsp;".$PRODUCTS_model[$i]."&nbsp;</td>n";
echo "<td class="dataTableContent" valign="top">&nbsp;".$PRODUCTS_name[$i]."&nbsp;</td>n";
if ($Related_items)
{
echo "<td class="dataTableContent"><ol>";
foreach ($Related_items as $display)
echo '<li>'. $display .'&nbsp;';
echo"</ol></td>n";
}
else
echo "<td class="dataTableContent">--</td>n";
echo '<td class="dataTableContent" valign="top">&nbsp;<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, 'add_related_product_ID=' . $PRODUCTS_id[$i], 'NONSSL') . '">Add</a>&nbsp;</td><td class="dataTableContent" valign="top">&nbsp;<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, 'add_related_product_ID=' . $PRODUCTS_id[$i], 'NONSSL') . '">Remove</a>&nbsp;</td>';

if (count($Related_items)>1)
{
echo '<td class="dataTableContent" valign="top">&nbsp;<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, 'sort=1&add_related_product_ID=' . $PRODUCTS_id[$i], 'NONSSL') . '">Sort</a>&nbsp;</td>';
} else {
echo "<td class="dataTableContent" valign=top align=center>--</td>";
}
echo "</tr>n";
unset($Related_items);
}
?>

</table>
<?
} // the end of -> if (!$add_related_product_ID)

if ($_POST && !$sort)
{
if ($_POST[run_update]==true)
{
$query ="DELETE FROM " . TABLE_PRODUCTS_XSELL . " WHERE products_id = '".$_POST[add_related_product_ID]."'";
if (!tep_db_query($query))
exit('could not delete');
}
if ($_POST[xsell_id])
foreach ($_POST[xsell_id] as $temp)
{
$query = "INSERT INTO " . TABLE_PRODUCTS_XSELL . " VALUES ('',$_POST[add_related_product_ID],$temp,1)";
if (!tep_db_query($query))
exit('could not insert to DB');
}
echo '<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, '', 'NONSSL') . '">Click Here to add a new cross sale</a><br>' . "n";
if ($_POST[xsell_id])
echo '<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, 'sort=1&add_related_product_ID=' . $_POST[add_related_product_ID], 'NONSSL') . '">Click here to sort (top to bottom) the added cross sale</a>' . "n";
}

if ($add_related_product_ID && ! $_POST && !$sort)
{ ?>
<table border="0" cellpadding="2" cellspacing="1" bgcolor="#999999">
<form action="<?php tep_href_link(FILENAME_XSELL_PRODUCTS, '', 'NONSSL'); ?>" method="post">
<tr class="dataTableHeadingRow">
<?php

$query = "select b.language_id, a.products_id, b.products_name, b.products_description, " .
"a.products_quantity, a.products_model, a.products_image, " .
"b.products_url, a.products_price from products a, products_description b where b.products_id = a.products_id and b.language_id = 1 and a.products_id = '".$add_related_product_ID."'";
list ($language_id, $PRODUCTS_id, $PRODUCTS_name, $PRODUCTS_description , $PRODUCTS_quantity , $PRODUCTS_model , $PRODUCTS_image , $PRODUCTS_url , $PRODUCTS_price ) = general_db_conct($query);
?>

<td class="dataTableHeadingContent">&nbsp;</td>
<td class="dataTableHeadingContent" nowrap>Item #</td>
<td class="dataTableHeadingContent">Model</td>
<td class="dataTableHeadingContent">Item Name</td>
<td class="dataTableHeadingContent">$Price</td>
</tr>

<?

$query = "select b.language_id, a.products_id, b.products_name, b.products_description, " .
"a.products_quantity, a.products_model, a.products_image, " .
"b.products_url, a.products_price from products a, products_description b where b.products_id = a.products_id and b.language_id = 1 and a.products_id != '".$add_related_product_ID."' order by a.products_model";

list ($language_id, $PRODUCTS_id, $PRODUCTS_name, $PRODUCTS_description , $PRODUCTS_quantity , $PRODUCTS_model , $PRODUCTS_image , $PRODUCTS_url , $PRODUCTS_price ) = general_db_conct($query);
$num_of_products = sizeof($PRODUCTS_id);
$query = "select * from " . TABLE_PRODUCTS_XSELL . " WHERE products_id = '".$add_related_product_ID."'";
list ($ID_PR, $PRODUCTS_id_PR, $xsell_id_PR) = general_db_conct($query);
for ($i=0; $i < $num_of_products; $i++)
{
?><tr bgcolor='#DFE4F4'>
<td class="dataTableContent">

<input <?php /* this is to see it it is in the DB */
$run_update=false; // set to false to insert new entry in the DB
if ($xsell_id_PR) foreach ($xsell_id_PR as $compare_checked)if ($PRODUCTS_id[$i]===$compare_checked) {echo "checked"; $run_update=true;} ?> size="20" size="20" name="xsell_id[]" type="checkbox" value="<?php echo $PRODUCTS_id[$i]; ?>"></td>

<? echo "<td class="dataTableContent" align=center>".$PRODUCTS_id[$i]."</td>n"
."<td class="dataTableContent">".$PRODUCTS_model[$i]."</td>n"
."<td class="dataTableContent">".$PRODUCTS_name[$i]."</td>n"
."<td class="dataTableContent">".$currencies->display_price($PRODUCTS_price[$i], tep_get_tax_rate($product_info_values['products_tax_class_id']))."</td></tr>n";
}?>
<tr>
<td colspan="4">

<input type="hidden" name="run_update" value="<?php if ($run_update==true) echo "true"; else echo "false" ?>">
<input type="hidden" name="add_related_product_ID" value="<?php echo $add_related_product_ID; ?>">
<input type="submit" name="Submit" value="Submit"></td>
</tr>
</form>
</table>
<? }

// sort routines
if ($sort==1)
{
// first lets take care of the DB update.
$run_once=0;
if ($_POST)
foreach ($_POST as $key_a => $value_a)
{
tep_db_connect();
$query = "UPDATE " . TABLE_PRODUCTS_XSELL . " SET sort_order = '".$value_a."' WHERE xsell_id= '$key_a' ";
//$query ="DELETE FROM " . TABLE_PRODUCTS_XSELL . " WHERE products_id = '".$key_a."'";
if ($value_a != 'Update')
if (!tep_db_query($query))
exit('could not UPDATE DB');
else
if ($run_once==0)
{
echo '<b>The Database was updated <a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, '', 'NONSSL') . '">Click here to back to the main page</a></b><br>' . "n";
$run_once++;
}

}// end of foreach.
?>
<form method="post" action="<?php tep_href_link(FILENAME_XSELL_PRODUCTS, 'sort=1&add_related_product_ID=' . $add_related_product_ID, 'NONSSL'); ?>">
<table cellpadding="2" cellspacing="1" bgcolor=999999 border="0">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" width="75">Product ID</td>
<td class="dataTableHeadingContent">Model</td>
<td class="dataTableHeadingContent">Name</td>
<td class="dataTableHeadingContent" width="150">Price</td>
<td class="dataTableHeadingContent" width="150">Order (1=Top)</td>
</tr>
<?
$query = "select * from " . TABLE_PRODUCTS_XSELL . " WHERE products_id = '".$add_related_product_ID."'";
list ($ID_PR, $PRODUCTS_id_PR, $xsell_id_PR, $order_PR) = general_db_conct($query);
$ordering_size =sizeof($ID_PR);
for ($i=0;$i<$ordering_size;$i++)
{

$query = "select b.language_id, a.products_id, b.products_name, b.products_description, " .
"a.products_quantity, a.products_model, a.products_image, " .
"b.products_url, a.products_price from products a, products_description b where b.products_id = a.products_id and b.language_id = 1 and a.products_id = ".$xsell_id_PR[$i]." order by a.products_model";

list ($language_id, $PRODUCTS_id, $PRODUCTS_name, $PRODUCTS_description , $PRODUCTS_quantity , $PRODUCTS_model , $PRODUCTS_image , $PRODUCTS_url , $PRODUCTS_price ) = general_db_conct($query);

?>
<tr class="dataTableContentRow" bgcolor='#DFE4F4'>
<td class="dataTableContent"><?php echo $PRODUCTS_id[0]; ?></td>
<td class="dataTableContent"><?php echo $PRODUCTS_model[0]; ?></td>
<td class="dataTableContent"><?php echo $PRODUCTS_name[0]; ?></td>
<td class="dataTableContent"><?php echo $currencies->display_price($PRODUCTS_price[0], tep_get_tax_rate($product_info_values['products_tax_class_id'])); ?></td>
<td class="dataTableContent"><select name="<?php echo $PRODUCTS_id[0]; ?>">
<? for ($y=1;$y<=$ordering_size;$y++)
{
echo "<option value="$y"";
if (!(strcmp($y, "$order_PR[$i]"))) {echo "SELECTED";}
echo ">$y</option>";
}
?>
</select></td>
</tr>
<? } // the end of foreach ?>
<tr>
<td colspan="4" bgcolor='#DFE4F4'><input name="runing_update" type="submit" id="runing_update" value="Update"></td>
</tr>
</table>
</form>

<?php }?>


</td>
</tr>
</table>
<!-- End of cross sale //-->
</td>
<!-- products_attributes_eof //-->
</tr></table>
<!-- body_text_eof //-->
<!-- footer //-->
<? include(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<? include(DIR_WS_INCLUDES . 'application_bottom.php');?>

#68   slackbladder

slackbladder
  • Members
  • 27 posts
  • Real Name:Tony

Posted 14 May 2003 - 17:43

/sad.gif' class='bbc_emoticon' alt=':(' />
OOPS sorry - forgot the code tags! I can't edit the post above

#69   blackhorse

blackhorse
  • Members
  • 8 posts
  • Real Name:Mark

Posted 14 May 2003 - 17:45

okay ... its fixed!

just changed the language id in line 130 /admin/xsell_products.php. it worx! /biggrin.gif' class='bbc_emoticon' alt=':D' />

best regards
mark

#70   MurrayM

MurrayM
  • Members
  • 296 posts
  • Real Name:Murray Mintz
  • Location:Santa Monica, California

Posted 14 May 2003 - 18:24

/sad.gif' class='bbc_emoticon' alt=':(' />
OOPS sorry - forgot the code tags! I can't edit the post above


I am just learning PHP, so I'm a bit unclear by what you mean by the above. What code tags? Also, I have just installed x-sell and it is working, does your change replace it, or just modify the latest modifications in v1.1.
thanks

#71   slackbladder

slackbladder
  • Members
  • 27 posts
  • Real Name:Tony

Posted 14 May 2003 - 18:50

I am just learning PHP, so I'm a bit unclear by what you mean by the above. What code tags? Also, I have just installed x-sell and it is working, does your change replace it, or just modify the latest modifications in v1.1.
thanks


Hi,

Sry the CODE TAG is what I should have used to sumbit the 'code' in the this forum - like this:

$run_once=0; 

if ($_POST) 

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

{ 

tep_db_connect();

The code above is the entire code from /admin/xsell_products.php

I guess you can just cut'n'paste it in to a new document - remember BACKUP your version of xsell_products.php

There are only a couple of changes to the orginal code but they are placed around the whole script - so I thought it would be easier to paste the whole thing.

Cheers

#72   MurrayM

MurrayM
  • Members
  • 296 posts
  • Real Name:Murray Mintz
  • Location:Santa Monica, California

Posted 14 May 2003 - 19:22

Sry the CODE TAG is what I should have used to sumbit the 'code' in the this forum - like this:

$run_once=0; 

if ($_POST) 

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

{ 

tep_db_connect();

The code above is the entire code from /admin/xsell_products.php

I guess you can just cut'n'paste it in to a new document - remember BACKUP your version of xsell_products.php

I want to be sure I understand this correctly. The remarked out area at the top of the code calls the file cross.sale.php -- Am I correct in assuming that I can cut and paste the code into a new document and rename it /admin/xsell_products.php before uploading? Of course I would rename the current working version something else as a precaution.
thanks


There are only a couple of changes to the orginal code but they are placed around the whole script - so I thought it would be easier to paste the whole thing.

Cheers[/quote]

#73   slackbladder

slackbladder
  • Members
  • 27 posts
  • Real Name:Tony

Posted 14 May 2003 - 20:39

Yep /biggrin.gif' class='bbc_emoticon' alt=':D' />

This is the admin script for cross sell. The modification I have made to the file will allow for the model number to be shown and sorted. I have a lot of products that are the same name or similar - so not seeing the model number was a real pain.

Let me know how you get on. /smile.gif' class='bbc_emoticon' alt=':)' />

#74   mreveready

mreveready
  • Members
  • 29 posts
  • Real Name:Thomas Law
  • Location:UK

Posted 02 July 2003 - 23:59

I have read this thread several times looking for the solution to the posted issue 'nothing shows up on the catalog page' as I have the same problem.

I have no errors whatsoever from either the admin or catalog install, it simply does not display related xsell products on the live site even though the same selected product has been configured in the cross sell admin module to be cross sold with other items?

I can confirm that I am calling the X-Sell include from catalog/product_info.php.

Any thoughts / pointers would be appreciated.

Thanks
The pleasure has been all mine.

#75   bluephoenix

bluephoenix
  • Members
  • 636 posts
  • Real Name:benjamin

Posted 03 July 2003 - 07:50

Try this in phpmy admin on your database
Of course, backup first
ALTER TABLE products_xsell ADD ID int(10) NOT NULL auto_increment, ADD PRIMARY KEY (ID) first;


I did not write the admin part of this code and it does well for my needs but doe to all the e-mails I will look at it when time permits to see if the Interface can be revamped.
Or if someone has done that already, then please upload or send me the files
Winsome
"If you rundown your shadow, you will never catch it"
Bob Marley

#76   mreveready

mreveready
  • Members
  • 29 posts
  • Real Name:Thomas Law
  • Location:UK

Posted 03 July 2003 - 08:07

Thanks for that.
I have cut 'n' pasted the query into the appropriate db but it returns the following error!
Is this a clue?
Appreciate your help.

Error

SQL-query :

ALTER TABLE products_xsell ADD ID int( 10 ) NOT NULL AUTO_INCREMENT ,
ADD PRIMARY KEY ( ID ) FIRST

MySQL said:


You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FIRST' at line 2
Back
The pleasure has been all mine.

#77   bluephoenix

bluephoenix
  • Members
  • 636 posts
  • Real Name:benjamin

Posted 07 July 2003 - 08:17

Check your mysql and see if you need to place the default first or the not null.
I have noticed in 2 shops I work on that one has the default appearing first and the other has the null field first
"If you rundown your shadow, you will never catch it"
Bob Marley

#78   mreveready

mreveready
  • Members
  • 29 posts
  • Real Name:Thomas Law
  • Location:UK

Posted 07 July 2003 - 09:39

Appreciate your reply!
Let me explain, I am extremely new to this.
If you have time can you explain with a little more detail and in basic terms what I need to do and just as important the effect so I do not need to ask again, hopefully!
For clarification I have included the table info.

Field-------------Type------Attributes--Nul---Default---Extra Action
ID----------------int(10)--------------------No-------------auto_increment
products_id----int(10)----UNSIGNED---No----1
xsell_id---------int(10)----UNSIGNED---No----1
sort_order------int(10)---UNSIGNED---No-----1

I hope this helps.
The pleasure has been all mine.

#79   mreveready

mreveready
  • Members
  • 29 posts
  • Real Name:Thomas Law
  • Location:UK

Posted 13 July 2003 - 21:49

To anyone who has:
-Installed Cross (X) Sell and Cross (X) Sell admin.
-Not received any errors.
-Had the admin package seemingly grouping products OK and holding the setting
-BUT has not had the products that were selected in Cross (X) Sell admin display on the live site.

-Then resolved the problem and now has a fully functioning site.

Please, please respond to this thread.
My site is going live next week, I have performed 4 installations each time onto a clean restored from backup site to no avail.
Have scoured this and any related thread.

I would really appreciate some pointers.

Thanks in advance.
The pleasure has been all mine.

#80   mreveready

mreveready
  • Members
  • 29 posts
  • Real Name:Thomas Law
  • Location:UK

Posted 15 July 2003 - 08:48

A massive thanks to Strider42 who responded to the above posting with a solution which resolved the X Sell products not showing on the live site.

Happy day /biggrin.gif' class='bbc_emoticon' alt=':D' />

Posting as received:

Hi,

I had the same problem and the fix was to turn off the cache in admin:

Configuration:Cache - set this to false.

Worked for me.

The code in catalogproduct_info.php reads:

Code:
<?php
if ( (USE_CACHE == 'true') && !SID) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
}
?>



check the if statement.
The pleasure has been all mine.