View Single Post
  #2  
Old 05-11-2012, 03:43 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: Is it possible to have your own tabs

It is easy to do this but you have to edit one php file for creating/arranging tabs and creating also a few template files to add in your tabs the following content:

- tab_description.tpl = showing short + long description
- tab_techinfo.tpl = if you use product classes
- tab_videos.tpl = attaching videos to your product
- tab_accessories.tpl = products you can buy for using with that product
- tab_awards.tpl = if you products has been rewarded who a logo, text, image scanned
- tab_technologies.tpl = for example you can specify in long product description a detail about a fabric, a short one. but here you can explain in detail the fabric with images (e.g. GORE-TEX)
- ...

Personally I will take out the Send to Friend form from tabs. I will create a list with icons like these:

- Ask a question
- Send to a Friend
- Alert price decrease (if product price goes down)
- Back in stock notification (if product is out of stock)
- Pre-order (if product is enable in advance)
- Price match policy

Files to start digging the code:

[XC_Dir]/include/product_tabs.php (for creating/arranging actual/new tabs)
[XC_dir]/skin/common_files/customer/tabs.tpl (for 2 columns and ideal_comfort skin there are other files)

In product_tabs.php you can insert a new tab like this:

Code:
$product_tabs[] = array( 'title' => 'Videos', 'tpl' => 'customer/main/tab_videos.tpl', 'anchor' => 'videos'

For title you can also use a language variable. Call it in php file like this 'title' => func_get_langvar_by_name('lbl_tab_videos').

Note that in $product_tabs array the first record means the first tab, the last one the last tab. Of course the script could be changed to rearrange position of the tabs in an elegant way (with a new filed called for example "pos").

Now create a template file in [XC_Dir]/skin/common_files/customer/main/tab_videos.tpl containing your videos (you can upload as many as you need using Extra Fields and call the Extra Fields array in your tab content.

If you use YouTube videos, they have an image allocated by default. For example if you check any video image on YouTube it has a URL like this http://i3.ytimg.com/vi/F8PDtxMZhe0/default.jpg. "F8PDtxMZhe0" is the video name you see in your Address Bar. This is an elegant way to use images instead of embedding the video code which will show large images with YouTube content.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote