Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[Contribution] Cross Sell (X-Sell) Admin


543 replies to this topic

#541 dvharrison

  • Community Member
  • 321 posts
  • Real Name:Deb
  • Gender:Female
  • Location:Essex, UK

Posted 23 March 2012, 11:38

@Mort-lemur

Actually on the product info adjustment, you have one to many '}' listed. So it should be

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

?>

I have taken this out and the page at least shows. I haven't a clue if the rest works as I'm still going through it.

Hope this helps.

Edited by dvharrison, 23 March 2012, 11:39.

Debbie Harrison

#542 chemist4

  • Community Member
  • 77 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Missouri

Posted 08 April 2012, 20:54

Any way I try to run the SQL I get this error:

Error
SQL query:
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 ;
MySQL said:
#1064 - 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 'TYPE=MyISAM' at line 7

This is on the latest version of MAMP. I have copied/pasted and imported and received the same error. I don't know enough about MySQL to fix it myself. Could anyone tell my what could be wrong?

#543 plumbrokeacres

  • Community Member
  • 3 posts
  • Real Name:Andrew Toms

Posted 09 May 2012, 17:10

Hi There,

I have installed X_Sell_For_2.3.1_V3.0 onto OSC 2.3.1 I can add the cross sell items in the admin but when I look at the product http://pbagraphics.com/product_info.php?cPath=22&products_id=34 I get an Error :"Error!

Unable to determine the page link!"

I have double checked all uploaded files as well as the updated files everything seems to be in order.

Does anyone have any ideas as to how I can fix it?

Thanks in advance
Andrew

#544 Gergely

  • Community Member
  • 344 posts
  • Real Name:Tóth Gergely
  • Gender:Male

Posted 23 May 2012, 13:37

@plumbrokeacres

Fix cache first:
includes/function/cache.php

Change:
// try to open file
    if ($fp = @fopen($filename, 'r')) {
// read in serialized data
	  $szdata = fread($fp, filesize($filename));
	  fclose($fp);
// unserialze the data
	  $var = unserialize($szdata);
	  $success = true;
    }

To:
// try to open file
    if ( file_exists($filename) ) {
	  if ($fp = @fopen($filename, 'r')) {
// read in serialized data
	    $szdata = fread($fp, filesize($filename));
	    fclose($fp);
// unserialze the data
	    $var = unserialize($szdata);
	    $success = true;
	  }
    }


Next step

Fix includes/modules/xsell_products.php

Change to:
<?php
/*
$Id: xsell_products.php, v1  2002/09/11
// adapted for Separate Pricing Per Customer v4 2005/02/24
osCommerce, Open Source E-Commerce Solutions
<http://www.oscommerce.com>
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
// require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_XSELL_PRODUCTS);
if ((USE_CACHE == 'true') && empty($SID)) {
// include currencies class and create an instance
require_once(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();
}
if ($HTTP_GET_VARS['products_id']) {
$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price
from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id
left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "'
and p.products_status = '1'
order by sort_order asc limit " . MAX_DISPLAY_XSELL);
  $num_products_xsell = tep_db_num_rows($xsell_query);
  if ($num_products_xsell > 0) {
?>
<!-- xsell_products //-->
<?php
	 $info_box_contents = array();
	 $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
	 new contentBoxHeading($info_box_contents);
	 $row = 0;
	 $col = 0;
	 $info_box_contents = array();
	 while ($xsell = tep_db_fetch_array($xsell_query)) {
   if (tep_not_null($xsell['specials_new_products_price'])) {
    $xsell_price =  '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>';
	    $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>';
   } else {
    $xsell_price =  $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id']));
   }
	   $text = '<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) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&product_to_buy_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_draw_button( IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $xsell['products_id']));
	   $info_box_contents[$row][$col] = array('align' => 'center',
											  'params' => 'class="smallText" width="33%" valign="top"',
											  'text' => $text) ;
    $col ++;
	   if ($col > 2) {
		 $col = 0;
		 $row ++;
	   }
	 }
new contentBox($info_box_contents);
?>
<!-- xsell_products_eof //-->
<?php
  }
}
?>

Header Footer Content Modules
SCM
V3

and some rewrites :-)