Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using Xsell with STS 2.01 Help


mfreund

Recommended Posts

I am trying to get xsell working with the simple template system 2.01......I have it working but now what I want to do is use the product_info.php.html page. When I try to do this the xsell stuff doesnt show up. When I go back to the default page it works fine. How do I get the xsell into the template....? Can anyone help me on this. I need to do it so I can customize image position etc...

 

 

 

Thanks

Link to comment
Share on other sites

  • 1 year later...
Bit of a bump here - can anyone advise on this? MFreund, did you get this working in the end?

 

I'm trying to pull throught the cross selling box into my sts modified production information page. I found this code at the bottom of the sts_product_info.php file and uncommented it so it was turned on, i also replaced the last bit of code to FILENAME_XSELL_PRODUCTS.

 

// See if any "Also Purchased" items
// I suspect that this won't work yet
  if ((USE_CACHE == 'true') && empty($SID)) {
    $template['alsopurchased'] = tep_cache_also_purchased(3600);
  } else {
    $template['alsopurchased'] = include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
  }

 

The problem is the recommendation comes through at the top of the page, and i havent event added the $alsopurchased to the template page. This took immediate effect upon uploading the sts_product_info.php script... Any ideas or help???!!!!!

 

screenshot.jpg

Link to comment
Share on other sites

Would it help anybody if I pasted the code of the following pages:

 

STS_PRODUCT_INFO.PHP

PRODUCT_INFO.PHP

PRODUCT_INFO.PHP.HTML

 

I really cant understand why this is appearing at the top of the screen. I dont think it has anything to do with the other pages.

Link to comment
Share on other sites

I now have the X-Sell Box appearing in my STS product info page. But, to my annoyance, the x-sell box is still appearing at the top of every single one of my product pages as well, which looks very stupid.

 

See for yourself at the following link: Wooch Catalog

 

The User Name is: admin and the password is: perfecteye

 

I have password protected the admin area with seperate log-in's for security. The bag of blue beads within the jewellery / bracelets section is an example of a product with a cross selling product associated to it.

 

This is what I did to get to this stage:

 

I installed the STS contribution, later I installed the X-Sell contribution.

 

I inserted the following code into sts_user_code.php:

 

$sts_block_name = 'xsell';
? require(STS_START_CAPTURE);
require(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
? require(STS_STOP_CAPTURE);
? $template['xsell'] = $sts_block['xsell'];

 

I have added the following code to the bottom of my sts_product_info.php:

 

// X-Sell Contribution
if ((USE_CACHE == 'true') && empty($SID)) {
? $template['xsell'] = tep_cache_also_purchased(3600);
? include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
} else {
? $template['xsell'] = include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
? include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}

 

As per the instructions of the x-sell contribution I have added this code to the standard product_info.php page:

 

<?php
//added for cross-sell
? ?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);
? ? ?include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
? ?}
?}
?>

 

I have put the $xsell variable into my product_info.php.html page.

 

Can anyone suggest how i stop the x-sell contribution from coming through at the top of every single one of my product pages? I'm starting to loose the faith on this... :'(

Edited by Perfect Eye
Link to comment
Share on other sites

I have added the following code to the bottom of my sts_product_info.php:

 

// X-Sell Contribution
if ((USE_CACHE == 'true') && empty($SID)) {
? $template['xsell'] = tep_cache_also_purchased(3600);
? include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
} else {
? $template['xsell'] = include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
? include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}

 

Wow, i'm solving my own issues - here's how to do it if you're following this thread. This bit quoted above isnt needed - i commented it out and now the xsell box doesnt appear at the top of the page, and also, I now have the x-sell coming through in the product info template, which is nice.

 

However, new issue, how do i remove the heading/box if there are no special items? It shows on every page - would rather its only visible if there is a special. Please see a product info page for what i mean. :D

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...