Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Custom tabs for product details

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-15-2015, 04:40 PM
 
DBK Web Builder DBK Web Builder is offline
 

Advanced Member
  
Join Date: Apr 2014
Location: NJ
Posts: 67
 

Question Custom tabs for product details

We want to change the product tabs in the product detail page

I started this a while back .. and Phil - helped me add some code to the includes/product_tabs.php file

The code adds the additional tab ... but the information that is supposed to go in that tab appears underneath the text box for the first tab

see this

http://www.i-fiberoptics.com/xcart/product.php?productid=18028&cat=

How do I get that info to hide - until you click on the second tab ?

thanks

Donna-NJ
__________________
4.6.2 and 4.6.3
http://www.DBKWebBuilder.com
Reply With Quote
  #2  
Old 05-16-2015, 11:39 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Custom tabs for product details

Donna,
What did you name your second tab?

I see in the code: id="product-tabs-second tab"

This is wrong, you can't have a space in your id. Put a dash there instead, and see if that has an effect. Whatever you have done, it is causing an error in jQuery UI, I can see that from the console.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 05-18-2015, 07:48 AM
 
DBK Web Builder DBK Web Builder is offline
 

Advanced Member
  
Join Date: Apr 2014
Location: NJ
Posts: 67
 

Default Re: Custom tabs for product details

ahh - yes - that seemed to make the tabs right

I"m still trying to sort out what info I can put in there

I tried to pull in pricing info - but that didn't work. I guess I'll just stick with the extra field info for now.

I started this a while ago- and forgot how to get the info !

Thanks

Donna-NJ
__________________
4.6.2 and 4.6.3
http://www.DBKWebBuilder.com
Reply With Quote
  #4  
Old 05-20-2015, 07:28 AM
 
DBK Web Builder DBK Web Builder is offline
 

Advanced Member
  
Join Date: Apr 2014
Location: NJ
Posts: 67
 

Default Re: Custom tabs for product details

What if I want different tabs for different categories ?

Can I create them all in the include/product_tabs.php file

then do some sort of if {$product.categoryid eq 23 } do this ... But that will change the content - but not the tab

I dont think I can put the $product.categoryid != 23 in the file that creates the tabs - cause it won't know yet will it ?
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_tab2'),
'tpl' => 'modules/Extra_Fields/tab2.tpl',
'anchor' => 'Information'
);
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_tab3'),
'tpl' => 'modules/Extra_Fields/tab3.tpl',
'anchor' => 'Pricing'
);

if($product_categoryid == 23) { add this tab ... else add a different tab ?

I suppose I should just go try it !
__________________
4.6.2 and 4.6.3
http://www.DBKWebBuilder.com
Reply With Quote
  #5  
Old 05-20-2015, 07:50 AM
 
DBK Web Builder DBK Web Builder is offline
 

Advanced Member
  
Join Date: Apr 2014
Location: NJ
Posts: 67
 

Default Re: Custom tabs for product details

Hmm - this did not work

if($product.categoryid == '49') {
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_tab1cat'),
'tpl' => 'modules/Extra_Fields/tab1cat1.tpl',
'anchor' => 'Data'
);
}
__________________
4.6.2 and 4.6.3
http://www.DBKWebBuilder.com
Reply With Quote
  #6  
Old 05-20-2015, 09:06 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Custom tabs for product details

For individual product tabs - https://www.cflsystems.com/custom-product-tabs-for-x-cart-classic.html
There is another module for global tabs by Smack Digital
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
DBK Web Builder (05-21-2015)
  #7  
Old 05-20-2015, 09:35 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Custom tabs for product details

Quote:
Originally Posted by DBK Web Builder
Hmm - this did not work

if($product.categoryid == '49') {
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_tab1cat'),
'tpl' => 'modules/Extra_Fields/tab1cat1.tpl',
'anchor' => 'Data'
);
}
Remember the difference between PHP and Smarty. You can't use Smarty style code in a PHP file!!

if($product.categoryid == '49')

Should be:

if($product['categoryid'] == 49)

That is, if it is even assigned or available in the context you are in.

One of the modules Steve mentioned might really help.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
DBK Web Builder (05-21-2015)
  #8  
Old 05-21-2015, 09:23 AM
 
DBK Web Builder DBK Web Builder is offline
 

Advanced Member
  
Join Date: Apr 2014
Location: NJ
Posts: 67
 

Default Re: Custom tabs for product details

Yes - you are right - that technically fixes the php ... but it doesn't know the categoryid at that stage.

I better look at those mods

thanks
__________________
4.6.2 and 4.6.3
http://www.DBKWebBuilder.com
Reply With Quote
  #9  
Old 05-21-2015, 09:26 AM
 
DBK Web Builder DBK Web Builder is offline
 

Advanced Member
  
Join Date: Apr 2014
Location: NJ
Posts: 67
 

Default Re: Custom tabs for product details

Steve - can that be made to work by category ?

I have too many products (I'm importing by bulk with sql) - to set the tabs for each product...

If I could set them by category - that module will work.

Thanks

Donna
__________________
4.6.2 and 4.6.3
http://www.DBKWebBuilder.com
Reply With Quote
  #10  
Old 05-21-2015, 09:54 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Custom tabs for product details

Not really, it work on products. But you can populate its table with sql directly.

Making work on category (and show on all of its products) will require basically creating it as a new module for categories. Which of course is also possible...
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:28 PM.

   

 
X-Cart forums © 2001-2020