♥altoid 153 Posted July 8, 2012 After updating a shops php 5.2.* to php version 5.3.13 I am getting these errors pertaining to xsell after doing a product edit: Warning: Invalid argument supplied for foreach() in /home/myname/public_html/myshopsadmin/includes/functions/general.php on line 1292 Warning: Cannot modify header information - headers already sent by (output started at /home/myname/public_html/myshopsadmin/includes/functions/general.php:1292) in /home/myname/public_html/myshopsadmin/includes/functions/general.php on line 65 I suspect it has something to do with this in the admins general.php as follows: function tep_reset_cache_block($cache_block) { global $cache_blocks; $pid = '*'; if ($cache_block == 'xsell_products') { $pid = ''; if (isset($_GET['add_related_product_ID']) ) { $pid = $_GET['add_related_product_ID']; } if ( !$pid ) $pid = '*'; } for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) { if ($cache_blocks[$i]['code'] == $cache_block) { $glob_pattern = preg_replace('#-language.+$#', '-*', $cache_blocks[$i]['file']); foreach ( glob(DIR_FS_CACHE . $glob_pattern . '.cache' . $pid) as $cache_file ) { @unlink($cache_file); } break; } } } Specifically around here? $glob_pattern = preg_replace('#-language.+$#', '-*', $cache_blocks[$i]['file']); <--line 1291 in general.php foreach ( glob(DIR_FS_CACHE . $glob_pattern . '.cache' . $pid) as $cache_file ) { <--line 1292 in general.php with the preg_replace part. Just guessing. Any ideas? I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can. I remember what it was like when I first started with osC. It can be overwhelming. However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc. There are several good pros here on osCommerce. Look around, you'll figure out who they are. Share this post Link to post Share on other sites
♥altoid 153 Posted July 10, 2012 Any ideas? Yea...took some serious mining but @@ecartz a solution here I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can. I remember what it was like when I first started with osC. It can be overwhelming. However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc. There are several good pros here on osCommerce. Look around, you'll figure out who they are. Share this post Link to post Share on other sites
newburns 8 Posted August 8, 2012 @@Gergely Why isn't this code included into the instructions? This was the only way I could get mine to work without any errors. Thanks A LOT Share this post Link to post Share on other sites
Irin 3 Posted September 4, 2012 I'm trying to adapt this add-on for use with 2.3.2. Below is the code from my includes/modules/xsell_products.php. The only problem is that only one cross-sell product is displayed, no matter how many are specified to show in admin. Any ideas? <?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 (isset($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, 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) { $counter = 0; $col = 0; $xsell_products_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="ui-widget-content ui-corner-bottom">'; while ($xsell = tep_db_fetch_array($xsell_query)) { $counter++; if ($col === 0) { $xsell_products_content .= '<tr>'; } if (tep_not_null($xsell[$x]['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'])); } $xsell_products_content = '<td width="33%" align="center" valign="top"><br /><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')) . 'action=buy_now&product_to_buy_id=' . $xsell['products_id'], 'NONSSL')) .'</a></td>'; $col ++; if (($col > 2) || ($counter == $num_products_xsell)) { $xsell_products_content .= '</tr>'; $col = 0; } } $xsell_products_content .= '</table>'; ?> <br /><br /><br /> <div class="ui-widget infoBoxContainer" style="text-align: center"> <div class="ui-widget-header ui-corner-top infoBoxHeading" style="text-align: left"> <span><?php echo TEXT_XSELL_PRODUCTS; ?></span> </div> <?php echo $xsell_products_content; ?> </div> <?php } } ?> Share this post Link to post Share on other sites
Sardonic76 0 Posted January 18, 2013 (edited) Hi! :) I'm trying to get the x-sell products to display a certain way on the product info page, but I can't seem to figure out what I need to do. Basically I want them displayed like in the "what's new" page (have a look here: http://dory.gr/2013h/index.php). Pink boxes symmetrically divided and with spacing between them. What I am getting at the moment is this: http://dory.gr/2013h/product_info.php?cPath=26&products_id=30. Any ideas as to what I need to change??? :wacko: ------------------ Never mind!!!! I got it. Switched the file with a file that was posted in a previous post and tweaked it a little. Edited January 18, 2013 by Sardonic76 Share this post Link to post Share on other sites
tgely 262 Posted January 21, 2013 @@Sardonic76 probably you need "equalheight" script. Look after in webcontents or ask a web designer. 1 Sardonic76 reacted to this osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Share this post Link to post Share on other sites
brt32 0 Posted March 1, 2013 (edited) Hello, I want my X-Sell to show ONLY active products on list in admin... Because i have really mess here... Could anyone tell me how to do it? Sorry for my bad english, but i think that you understood ;) Thx :) Edited March 1, 2013 by brt32 Share this post Link to post Share on other sites
brough 0 Posted October 22, 2013 I have a problem in admin > Search Model Number Typically, if there are 6 or 7 products with the prefix PCV_14 it returns only three. RC2A much modified. Any suggestions? Share this post Link to post Share on other sites
dreaminggates 0 Posted November 10, 2013 This is probably a dumb question but... where do I get a "Mobile" directory? I do not have one, in my installation. v.2.3) Share this post Link to post Share on other sites
dvharrison 0 Posted December 9, 2013 (edited) Hi dremainggates I wonder if its referring to another plugin - http://addons.oscommerce.com/info/8629/v,23 I've avoided it off for the time being Hope this helps. Edited December 9, 2013 by dvharrison Debbie Harrison Share this post Link to post Share on other sites
Mort-lemur 178 Posted December 9, 2013 @@dreaminggates@@dvharrison See my posts here: http://www.oscommerce.com/forums/topic/395359-modding-up-a-new-2334-install-documented/ basically you need to ignore the references to the mobile files and delete some of the query fields from the latest version of the contribution. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Share this post Link to post Share on other sites
dvharrison 0 Posted December 9, 2013 That's good to know. Thanks Mort, I shall give that a go. Debbie Harrison Share this post Link to post Share on other sites
dvharrison 0 Posted December 11, 2013 It works! Thanks Heather. My only gripe is that I have about 5 empty lines of cross-sell data that I cannot seem to get rid of. No delete button. I can empty it via PHP MyAdmin level but how is one supposed to remove entries at user level? Debbie Harrison Share this post Link to post Share on other sites
dvharrison 0 Posted December 11, 2013 (edited) And it doesn't look right. I think I'll revert back for now. Edited December 11, 2013 by dvharrison Debbie Harrison Share this post Link to post Share on other sites
Mort-lemur 178 Posted December 11, 2013 That is not caused by cross sell - they are product Id's in your database that dont have info against them. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Share this post Link to post Share on other sites
dvharrison 0 Posted December 12, 2013 It's not just that though, the iamges weren't showing up either. I think I need to play. Thank goodness for backups :) Debbie Harrison Share this post Link to post Share on other sites
Mort-lemur 178 Posted December 12, 2013 OK - you need to look at the changes as detailed in my post on installing on 2.3.3.4 regarding changing the images directory called up in the files - as it is incorrect in the latest add-on version. I will send you a link to my development store so you can see how it looks when working. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Share this post Link to post Share on other sites
dvharrison 0 Posted December 12, 2013 (edited) I think I've worked out the problem: The folder name was coming up as DIR_WS_CATALOG_IMAGES_THUMBS.I have changed this back to DIR_WS_CATLOG_IMAGES and made sure both width and height were set. Edited December 12, 2013 by dvharrison Debbie Harrison Share this post Link to post Share on other sites
Mort-lemur 178 Posted December 12, 2013 Did you read post #23 of http://www.oscommerce.com/forums/topic/395359-modding-up-a-new-2334-install-documented/page__st__20 as I suggested: This version uses the correct 2.3 buttons etc but also assumes that you have several other contributions installed - If it does not work for you then carry out the following changes in admin/xsell.php and catalog/includes/modules/xsell_products.phpRemove all instances of p.image_display Remove all instances of p.image_folder Amend all instances of DIR_WS_IMAGES_THUMBS to read DIR_WS_IMAGES There are other necessary changes in that post as well. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Share this post Link to post Share on other sites
dvharrison 0 Posted December 16, 2013 That must have been the (only) step I missed. Oops. Debbie Harrison Share this post Link to post Share on other sites
Mort-lemur 178 Posted December 16, 2013 No Problems - I will eventually update the mod when I get my new 2.3.3.4 sites up and running. Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members. Share this post Link to post Share on other sites
CiscoCo 0 Posted March 13, 2014 Hello - I installed XSell successfully a week ago. Since then, I've added new products to my store, but the XSell section has not updated. It still only shows 40 products (out of 80). How can I fix this? Thank you! Share this post Link to post Share on other sites
kookiewookie 0 Posted October 23, 2014 Hi module works fine; we use 2.3.1 osc there is only one minor flaw or bug IF we Xsell a product that WAS a special but now as special inactive , status = 0 then the special price is still seen on the xsell box somehow. I tried many things but somehow did not get it to make it then simply show the product price and not the specials price. Share this post Link to post Share on other sites
dvharrison 0 Posted January 26, 2016 Hi Is this add-on ok to use on OScommerce 2.3.4? My hosting provider have recently upgraded as they no longer support PHP 5.4. So I have to be really careful. I welcome any advice. :lol: Debbie Harrison Share this post Link to post Share on other sites
♥14steve14 657 Posted January 27, 2016 Try this one. http://addons.oscommerce.com/info/8330 REMEMBER BACKUP, BACKUP AND BACKUP Share this post Link to post Share on other sites