Re: Getting Tabbed Products Pro to work with Ultimate Cross Sell
I have just succeeded in getting the Cross Sell tab of Tabbed Products Pro to work with Ultimate Cross Sell rather than the original Cross Sell mod.
It may not the best way to do it but it as I don't claim to be a skilled PHP coder, just someone who can hack existing code to get the result needed.
In includes\modules\tabbed_products_pro.php
I replaced:
PHP Code:
//Check if CrossSell contrib is installed and enabled to create its tab data
if (file_exists(DIR_WS_MODULES . 'xsell_products.php') or file_exists(DIR_WS_MODULES . $template_dir . '/' . 'xsell_products.php')) {
$bCrossSell_Tab = strpos($proddata, "<!--#CrossSell#-->");
if ($bGblCrossSell_Tab == true && $IgnoreGlobals === false) {
$bCrossSell_Tab = 1;
}
} else {
$bCrossSell_Tab = 0;
}
With:
PHP Code:
//Check if CrossSell contrib is installed and enabled to create its tab data
if (file_exists(DIR_WS_MODULES . 'ultimate_cross_sell_products.php') or file_exists(DIR_WS_MODULES . $template_dir . '/' . 'ultimate_cross_sell_products.php')) {
$bCrossSell_Tab = strpos($proddata, "<!--#CrossSell#-->");
if ($bGblCrossSell_Tab == true && $IgnoreGlobals === false) {
$bCrossSell_Tab = 1;
}
} else {
$bCrossSell_Tab = 0;
}
And further down around line 211
replaced this:
PHP Code:
if ($bCrossSell_Tab != 0) {
$xsell_query = $db->Execute("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 = '" . $_GET['products_id'] . "'
and xp.xsell_id = p.products_id
and p.products_id = pd.products_id
and pd.language_id = '" . $_SESSION['languages_id'] . "'
and p.products_status = 1
order by xp.sort_order asc limit " . MAX_DISPLAY_XSELL);
$num_products_xsell = $xsell_query->RecordCount();
if ($num_products_xsell != 0) {
$tabstrip .= "\n" . '<li><a href="javascript:void(0)" onclick="expandcontent(\'sc'.$g.'\', this)"><span>'.$cross_sell_tab_name.'</span></a></li>' . "\n";
$g++;
}
}
With this:
PHP Code:
if ($bCrossSell_Tab != 0) {
$xsell_query = $db->Execute("select distinct p.products_id, p.products_image, pd.products_name
from " . ultimate_cross_sell_2 . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where xp.products_id = '" . $_GET['products_id'] . "'
and xp.cross_sell_id = p.products_id
and p.products_id = pd.products_id
and pd.language_id = '" . $_SESSION['languages_id'] . "'
and p.products_status = 1
order by xp.sort_order asc limit " . MAX_DISPLAY_CROSS_SELL2);
$num_products_xsell = $xsell_query->RecordCount();
if ($num_products_xsell != 0) {
$tabstrip .= "\n" . '<li><a href="javascript:void(0)" onclick="expandcontent(\'sc'.$g.'\', this)"><span>'.$cross_sell_tab_name.'</span></a></li>' . "\n";
$g++;
}
}
And finally (for this file), around line 337 replaced:
PHP Code:
// Pre-load Cross Sell
if ($bCrossSell_Tab != 0 && $num_products_xsell != 0) {
ob_start();
require($template->get_template_dir('tpl_modules_xsell_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_xsell_products.php');
$fmtXSL .= ob_get_contents();
ob_end_clean();
$fmtXSL = str_replace('class="centerBoxWrapper"', '', $fmtXSL);
if ($bShowHeaders != true) {
$fmtXSL = str_replace('class="centerBoxHeading"', 'class="centerBoxHeading" style="display: none;"', $fmtXSL);
}
}
With this:
PHP Code:
// Pre-load Cross Sell
if ($bCrossSell_Tab != 0 && $num_products_xsell != 0) {
ob_start();
require($template->get_template_dir('tpl_modules_ultimate_cross_sells.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_ultimate_cross_sells.php');
$fmtXSL .= ob_get_contents();
ob_end_clean();
$fmtXSL = str_replace('class="centerBoxWrapper"', '', $fmtXSL);
if ($bShowHeaders != true) {
$fmtXSL = str_replace('class="centerBoxHeading"', 'class="centerBoxHeading" style="display: none;"', $fmtXSL);
}
}
This when combined with enabling: TPP - Global Cross Sell Tab in Admin > Configure > Tabbed Products Pro seemed to do everything required EXCEPT the javascript bit to hide the original block and display the new tabbed version.
So on checking /includes/templates/classic/jscript/jscript_tpp.js I noted that it was looking for id "crossSell" to disable and then enabling crossSell_tab instead.
Ultimate Cross Sell uses a number after it's ID's, the box that I was using was the Upsell which I found was called crossSell2 when I checked the HTML code for a page on the live site:
HTML Code:
<!-- bof: tpl_modules_ultimate_cross_sell_products -->
<div class="centerBoxWrapper" id="crossSell2">
So my first attempt was obviously to edit jscript_tpp.js at lines 95:
Code:
hackArr[6] = document.getElementById('crossSell');
and 110:
Code:
NewArr[6] = document.getElementById('crossSell_tab');
to "crossSell2"
To my frustration this didn't work, I think it's to do with the fact that tpl_modules_ultimate_cross_sell_products.php appends the number at run time to the title.
So for me, where I only use one cross sell centreBox (I won't work properly if you have two, for example a cross sell and upsell) I did the quick and dirty fix of renaming the title on the cross sell template as follows:
Edit /includes/templates/classic/templates/tpl_modules_ultimate_cross_sell_products.php and change:
PHP Code:
<!-- bof: tpl_modules_ultimate_cross_sell_products -->
<div class="centerBoxWrapper" id="crossSell<?php echo $cross_sell ?>">
to:
PHP Code:
<!-- bof: tpl_modules_ultimate_cross_sell_products -->
<div class="centerBoxWrapper" id="crossSell">
Now it works perfectly for me. As I say the caveat is that if you use the ultimate cross sell mod to show multiple centre boxes that would normally have ID's crossSell1 crossSell2 etc this hack will call them all just crossSell and I don't know how the tab system will then show them, if at all, but it will work if you only use a single crossSell centre box (you can still show mutliple cross sell/upsell side boxes, this only affects the centre boxes.)
Hope this is of help.
Andrew
Re: Getting Tabbed Products Pro to work with Ultimate Cross Sell
Forgot to say, the way I've explained it it only works if you have "Upsells" defined.
In my second edit:
PHP Code:
if ($bCrossSell_Tab != 0) {
$xsell_query = $db->Execute("select distinct p.products_id, p.products_image, pd.products_name
from " . ultimate_cross_sell_2 . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
<SNIP>
I'm specifically checking the Upsell table: ultimate_cross_sell_2
Check: ultimate_cross_sell_1 if you want to show Cross Sells or ultimate_cross_sell_3 to show Related Products.
Making it work with all 3 at once isn't something I need to do so haven't tried.
Andrew
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
I am setting up a new site, and for the life of me I can't remember how I got the "Additional Images" to display on two lines instead of one. It looks bad on one line when other tabs I have set up of multiple words are on two lines. Can anyone help?
Thank you
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
Bump! Surely someone has an idea about this.
Thanks!
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
This is a great mod! Thanks so much!
I do have a question: is it possible to create hyperlinks to switch between the tabs?
Customers new to the website have a hard time seeing that there are tabs to select from. They will often read the "Product Description" tab for additional info and not realise that answers to some of their product questions can be found under the additional tabs, purely, because they don't see them.
I was wondering if a "hyperlink" can be created when reading info on the "Product Description" tab that will automatically switch the reader to one of the additional info tabs?
I was hoping to acheive something like this in the "Product Description" tab:
"Product xyz comes in additional sizes, please review (insert hyperlink code) additional info on sizing tab </a>."
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
Quote:
Originally Posted by
styledata
Bump! Surely someone has an idea about this.
Thanks!
I am not sure it's what you are looking for, but did you try:
Admin> Configuration> Images> Product Info - Number of Additional Images Per Row
It's what I always use :)
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
I want the same thing. I think this is what they're wanting. a bookmark on the page. for instance, when you are looking at the product description, it would be nice to be able to make the tab a hyperlink/bookmark, so the description could say something like click here for more info instead of "for more info, go to the top of page and click the "....tab". Make sense?
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
Quote:
Originally Posted by
aperfecthost
I want the same thing. I think this is what they're wanting. a bookmark on the page. for instance, when you are looking at the product description, it would be nice to be able to make the tab a hyperlink/bookmark, so the description could say something like click here for more info instead of "for more info, go to the top of page and click the "....tab". Make sense?
Yeap - just like that - an anchor bookmark! Totally forgot that's what they were called! Is this possible with Tabbed Products Pro?
Seriously, I have spoken to so many people who re-read the product description back to you over the phone and can not find the tabs. I have given exact directions on how to find them too :)
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
Quote:
Originally Posted by
Mr.Pea
Yeap - just like that - an anchor bookmark! Totally forgot that's what they were called! Is this possible with Tabbed Products Pro?
Seriously, I have spoken to so many people who re-read the product description back to you over the phone and can not find the tabs. I have given exact directions on how to find them too :)
It's software I'm sure it is possible and perhaps someone will share how to do this if they have the answer.. (Off the top of my head I don't know the answer..)
My suggestion though is that if the tabs are not obvious, then perhaps you need to look at the layout of the product page with the tabs in place.. As many times as i have used this add-on, I am trying to imagine how one would NOT see the tabs, and the only thing that makes sense is that the product page layout might need some re-vamping...
Re: Tabbed Products Pro (TPP) Contrib - Official Thread
Quote:
Originally Posted by
DivaVocals
It's software I'm sure it is possible and perhaps someone will share how to do this if they have the answer.. (Off the top of my head I don't know the answer..)
My suggestion though is that if the tabs are not obvious, then perhaps you need to look at the layout of the product page with the tabs in place.. As many times as i have used this add-on, I am trying to imagine how one would NOT see the tabs, and the only thing that makes sense is that the product page layout might need some re-vamping...
I haven't installed this mod yet (not the new one) but had it on a previous store years back and had the same issue, is there still a way to change the look of the tabs? I mean make them a different color where they stand out more to catch the customers attention?