Jump to content
dreamscape

[Contribution] Cross Sell (X-Sell) Admin

Recommended Posts

It's saying PHP is out of memory on the server you're on..

 

8388608 is the default maximum file-upload/post-method-send too, dunno if that's got anything to do with it.

 

Basically you're X-SELL list has got so long that PHP runs out of memory triying to create the admin page, I would say.

 

You might be able to fix it by changing maximum memory allocated to PHP in your php.ini, if you have access to it.

 

But otherwise it's just that X-sell isn't a fantastically crafted contribution - it needs a lot of work before it's going to suit everyone and work on all installations. Hopefully the core team will sort it out :)

Share this post


Link to post
Share on other sites

Thanks Adam, I appreciate the feedback, unfortunatly I cannot change the 8MG maximum limit in my php.ini file. Is there a way to get around this?

 

Thanks

Share this post


Link to post
Share on other sites

Just an FYI, I have re-written the X-Sell Contribution and updated it at the Contribution site:

http://www.oscommerce.com/community/contributions,1415

 

Now this Contribution complies with the Separate Pricing Contribution so that the correct prices are displayed depending on the logged in customer's price level. If the visitor is not logged in it defaults to the "List" (or as some call it "Retail") price. This is a very good Contribution and another supporter has recently completely re-written the Admin end of it. Definitely worth a look.

 

PS - I also fixed an error in the code on the product_info.php page which was resulting in parse errors.

 

Thanks,

Aaron

Share this post


Link to post
Share on other sites

HI all,

 

thanks for the updates X-Sell module...

I have installed it and the admin section works much better.. though i have i small hicup in my products info page..

 

there are some products that i have not cross selled and i am getting the " We Also Recommend" Bar .. how do i just show that bar when i have products that are cross sold...

the code i have in my products_inof page is

<?php
//added for cross -sell
 if (DISPLAY_ALSO_PURCHASED_PRODUCTS_BOX == 'Enable') {
   if ( (USE_CACHE == 'true') && !defined('SID')) {
     echo tep_cache_also_purchased(3600);
     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
} else {
  include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
  echo tep_draw_separator('pixel_trans.gif', '100%', '10'); 
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }

many thanks

Share this post


Link to post
Share on other sites

HI

Please ignore above Post as i have solved it,

 

The Other Issue i am having is in the admin area once you have selected the products you want to cross sell and click update, you do not get a message saying the record has been updated, it just stays on the same page, yet it has updated..

 

Please could someone assist me with showing the messages.

 

thanks

Share this post


Link to post
Share on other sites

HI all

 

I have this beautiful contribution installed and works very well for me.

I have 1 need and I think the many other like the idea.

 

Can anybody put a together a little code to show the category on top of each group of recommended by?

ie

-- We also Recommend Products:

 

DVD

image DVD 1

image DVD 2

 

CD

image CD 1

image CD 2

 

Hope I made myself clear

 

 

Salvo

Share this post


Link to post
Share on other sites

What is the code for showing the xSell box on the product_info page only when there are actually products to be cross sold for that particualr item? As it is in the basic install, the box is always there even if it is empty.

 

Genius: Your code for the product_info page is different than mine, are you working from an older version?

 

Thanks for your help,

Aaron

Share this post


Link to post
Share on other sites

Hi Aaron,

 

My Products info is from the old module, I have managed to sort out the products not showing if they are not corss sold...

 

 

The issues i am facing are:

1. The admin section to display the success message when products have been crossed.

2. To Sort the products by name in the admin pannel rather than the product ID from the database..

 

thanks once again

Share this post


Link to post
Share on other sites

Ok guys back...

 

I have managed to create the message to show when a cross sell is updated.

 

just need to Sort the products or even have search in the contribute instead of going through all the pages... to find the product...

Share this post


Link to post
Share on other sites

Genius,

 

Email me the relevant file and I'll see if I can quickly see which bit you need to change to alter the Sort order. It should be easy since I changed it to product ID in my version :-)

 

Sorry I'm not more responsive but I'm pretty busy right now!

 

Thanks.

 

Adam

Share this post


Link to post
Share on other sites

Have installed cross sell and used michaels (admin/xsell_products.php)code to fix nothing showing up in admin except headings that was great but now in the catalog side I get the following errors messages

 

Warning: main(includes/modules/xsell_products.php): failed to open stream: No such file or directory in /home/hsphere/local/home/control/yourekidding.biz/catalog/product_info.php on line 231

 

Warning: main(): Failed opening 'includes/modules/xsell_products.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/hsphere/local/home/control/yourekidding.biz/catalog/product_info.php on line 231

 

Im no php or mysql guru and I cant figure out what the issue is here

 

the site is going live shortly and I would love to be able to use this module

 

thanks in advance


Its not a computer its a life management system!

Share this post


Link to post
Share on other sites

Hi Altec,

 

That error simply means that OSC can't find the xsell_products.php file. Have you uploaded it into the right place?

 

It's looking for it in:

 

includes/modules/xsell_products.php

 

That's likely to be /catalogue/includes/modules, but it depends where you installed OSC. So I advise checking all your paths and make sure that product_info.php can find xsell_products.php correctly.

 

Most likely you've installed the ADMIN side of xsell but not the USER side. These will be two sets of instructions in the INSTALL instructions.

 

Hope this helps.

 

Adam

Edited by Pharkie

Share this post


Link to post
Share on other sites

Hi adam

 

Thankyou very much for your speedy reply the file in my includes/modules directory is called xsell_products_buynow.php as I wanted to use the buy now version should I simply rename that without the buynow bit eg xsell_products.php

 

as to my understanding of the instructions I thought I only had to take the buy now of the end of the file as it was originally named xsell_products_buynow.php_buynow

 

thankyou


Its not a computer its a life management system!

Share this post


Link to post
Share on other sites

Thanks adam I did exactly that and all seems to run nice thankyou for your efforts

 

Lyndon


Its not a computer its a life management system!

Share this post


Link to post
Share on other sites
it was originally named xsell_products_buynow.php_buynow

 

heh .. looks like one of the contrib authors got confused at some point and added _buynow to the filename twice.

 

I presume the idea is that you rename xsell_products_buynow.php to xsell_products.php - that makes sense. A file with an extension .php_buynow makes no sense.

 

Have fun.

 

Adam

Share this post


Link to post
Share on other sites

HI all,

 

I have another task to add to this contribution to make it a bit more easier to navigate the admin page... I have set my product order by the name so mine starts with A to Z.. While working on this i thought would be easier to go the the letter page if i has some sort of alphabet on the top with a link to that page...

I would like to create something like :

A B C D E F G H I ...etc... X Y Z

on the top of the page just under the title.

 

then if i click on a letter it will take me to that page.. For instance if i wanted to go the page that begins with S the i would click on S and it would take me to that page... I do know the page number it's just figuring how it would be coded...

 

For example the letter S the page number is 172 looking at the url on top it shows like

http://domain name/catalog/admin/xsell.php?page=172

 

If someone could shed some light here would be great.

thanks

Share this post


Link to post
Share on other sites

The code that splits the results into pages is OSC core/standard. There's nothing in OSC as it is to do what you're asking, so it will be more difficult that otherwise..!

 

But maybe you could take the page splitting code, duplicate it, and take it from there..

 

A medium-difficulty job, I'd say.

 

Adam

Share this post


Link to post
Share on other sites

Thanks Pharkie,

 

I know it's a bit of a difficult one to tackle..

 

just one more on this... i know i should not use the absolute path address to a particular page. what would i used to show the link.. What i am trying to say is instead of putting the full path name like http://domain name/catalog/admin/xsell.ph?page=172

 

can i use something like

../catalog/admin/xsell.ph?page=172

Share this post


Link to post
Share on other sites

Thanks for the contribution. I installed it and it is working great.

 

However, I was hoping it would be possible to NOT show the "Customers who bought this product also purchased" box if there are cross-sell items box "We also recommend:" box?

 

Or just to eliminate the "Custoemr who bught this product also purchased" box if it is too much hassle.

 

I changed the "also purchased" to zero in the configuration section but apparently both boxes are tied to this value.

 

 

Any suggestions would be much appreciated.

 

 

Many thanks,

Shuey

Share this post


Link to post
Share on other sites

Anyone know how I can add some kind of "if" clause into the product_info.php page so the XSell table does not show up unless there are items specified in the database for the particular product being viewed? As it is now, every product has the XSell table on it, even if there are no products in the XSell database table. It just displays the header and an empty content area. Thanks in advance!!

 

-Aaron

Share this post


Link to post
Share on other sites

I seem to remember I achieved that fairly easily. Just moved a bit of PHP above the table that displays the x-sells, rather than inside it.

 

Not got the code to hand tho.. Take a look, it should be easy.

 

Hope this helps,

Share this post


Link to post
Share on other sites

OK i rummaged around and came up with this.

 

From line 246 of my product_info.php:

 

        <td>
<?php
   // Adam@CP. Added X-sell mod
if ((USE_CACHE == 'true') && empty($SID)) {
 echo tep_cache_also_purchased(3600);
 include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
   } else {
 include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
 echo '<br>';
 include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }
?>
       </td>

 

..but I'm not sure that's the bit you need. It's more likely to be the next bit.

 

 

My xsell_products.php :ph34r: :

 

<?php
/* 
$Id: xsell_products.php, v1  2002/09/11

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

Copyright (c) 2002 osCommerce 

Released under the GNU General Public License 
*/ 

if ($HTTP_GET_VARS['products_id']) { 
$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' order by xp.products_id asc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
$num_products_xsell = tep_db_num_rows($xsell_query); 
if ($num_products_xsell >= MIN_DISPLAY_ALSO_PURCHASED) { 
?> 
<!-- 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)) {
       $xsell['products_name'] = tep_get_products_name($xsell['products_id']);
       $info_box_contents[$row][$col] = array('align' => 'center',
                                              'params' => 'class="smallText" width="33%" valign="top"',
                                              '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>');
       $col ++;
       if ($col > 2) {
         $col = 0;
         $row ++;
       }
     }
     new contentBox($info_box_contents);
?>
<!-- xsell_products_eof //-->

<?php
   }
 }
?>

 

..not sure if I added the 'if' on line 17 into that. It looks like it's that that prevents it from showing if they are no cross-sold products. Replace 'MIN_DISPLAY_ALSO_PURCHASED' on that line with '1' (no quotes) if you like - I'm sure it will work the same..

 

That must answer it, since it's clearly saying "Show this box IF there's 1 or more products in the list of cross-sells', so I presume other people are missing that?

 

Let me know how you get on.. Good luck :)

Share this post


Link to post
Share on other sites

Thanks Pharkie! For the record, yes your solution worked. If I would have focused on editing xsell_products.php instead of product_info.php I may have found that myself, but regardless, thanks!!

 

For anyone else looking for the answer to this question simply change:

 

if ($num_products_xsell >= MIN_DISPLAY_ALSO_PURCHASED) {

 

to:

 

if ($num_products_xsell >= 1) {

 

 

Aaron

Share this post


Link to post
Share on other sites

I just installed the X-Sell, works great; but one problem. On the items I am not using X-Sell the bar that says ?We Also Recommend :? shows up.

How do I remove the bar on item that X-Sell is not being used in?

 

Thanks

Auto

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×