X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to add tabs to product page? (https://forum.x-cart.com/showthread.php?t=57226)

burak.82 12-24-2010 11:56 AM

How to add tabs to product page?
 
Hi,

I would like to add " detailed description " of a product to the product tabs so that i show the customers short description next to the product picture and they see full description below at the tabs section

is this possible?

tia

burak

cflsystems 12-24-2010 03:00 PM

Re: How to add tabs to product page?
 
Yes that is possible but you will have to edit the php and template files responsible for the tabs to achieve this

e-best1 12-24-2010 04:11 PM

Re: How to add tabs to product page?
 
what kinds of php and template files have to be edited ?

cflsystems 12-24-2010 07:51 PM

Re: How to add tabs to product page?
 
include/product_tabs.php is the php file
you may or may not need to skin/common_files/customer/tabs.tpl

burak.82 12-25-2010 02:10 AM

Re: How to add tabs to product page?
 
i dont have any knowladge of php right at the moment so in order to insert the "detailed description" of a product to product tabs, i need to first create a moduie from the admin panel and write a script to the product_tabs.php file ?

cflsystems 12-25-2010 07:50 AM

Re: How to add tabs to product page?
 
You can either modify the php file so you don't have to modify the template or you can modify the template only which will require you to have smarty, html and css knowledge (no php knowledge). If you don't know any of them I would success to you to hire a professional to help you.

Sunray Sales 12-26-2010 04:54 AM

Re: How to add tabs to product page?
 
Hi, I would like to do the same, as OP, create an additional tab called Detailed Description. Then then fill that tab with text.

I have looked at the include/product_tabs.php and skin/common_files/customer/tabs.tpl

I know html, css, javascript, but I don't know PHP but do roughly understand whats going on in the product_tabs.php.

@cflsystems you mentioned that you could use html and css to add a tab, my question is wouldn't that be hard coding it? What file would I use to hardcode this new tab?

Thanks!

cflsystems 12-26-2010 06:14 AM

Re: How to add tabs to product page?
 
Yes you hard coded in skin/customer/ui_tabs.tpl.

Sunray Sales 12-26-2010 10:36 AM

Re: How to add tabs to product page?
 
Oh ok great thanks, I actually figure it out.

I used this product_tabs.php.

I then created my own template file.

I know this is just a jerry-rigged way of doing it, but it does work.
Can you help me with the first line of code?
PHP Code:

if ($config['Appearance']['send_to_friend_enabled'] == 'N') { 


As you can see I just copied the send to friend code and replaced a few things, most importantly I change Enabled == 'N', because I will not enable this.

PHP Code:

if ($config['Appearance']['send_to_friend_enabled'] == 'N') {
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_details'),
'tpl' => 'customer/main/p-details.tpl'// 'modules/Customer_Reviews/vote_reviews.tpl'
'anchor' => 'details'
);
}
 
if (
$config['Appearance']['send_to_friend_enabled'] == 'Y') {
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_send_to_friend'),
'tpl' => 'customer/main/send_to_friend.tpl',
'anchor' => 'send2friend'
);



To see the final outcome, have a look at this one particular product.
http://www.sunraysales.com/xcart/product.php?productid=11382&cat=174&page=1

PS: I have over 11,000 products, so the extra product details have only been applied to the first 500 products.

Please let me know what you think?

Thanks.

burak.82 12-28-2010 02:46 AM

Re: How to add tabs to product page?
 
link is not working, i would like to see an example

Sunray Sales 12-28-2010 04:30 AM

Re: How to add tabs to product page?
 
Hi sorry about that, I was reloading products into the database, so that link above is dead.

Here's a new link and the link above will be fixed as well.

http://www.sunraysales.com/xcart/product.php?productid=11382&cat=174&page=1

EDIT: I have just modified the code a bit more, remove the first line if statement. So it is not bound to the config, meanining it will always appear.

Code:

{
    $product_tabs[] = array(
        'title'  => func_get_langvar_by_name('lbl_details'),
        'tpl'    => 'customer/main/p-details.tpl',
        'anchor' => 'details'
    );
}


This is all that you need to create a tab, once again the tab name is defined by the 2nd line with 'title', from my testing the name of the tab can't be too long otherwise it won't work (don't know why). I suggest a short name for the tab.

Cheers.


All times are GMT -8. The time now is 03:07 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.