Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support thread for Product info description_tabs CE


Recommended Posts

A simple add-on to let you automatically place a Product Information Tabs dynamically on your product info page.

Again totally standalone with no core code change. Simply copy all files of the into relevant sections and go to admin modules /content and install.

Has been tested on CE BS4 and CE BS3

 

image.png.48b70737948e2d85cba144d23de9733c.png

image.png.9ce6910fe6b0da2c3d5531d922565fea.png

image.png.16d99380ad6dcc4acf10106cf412416e.png

 

Link to comment
Share on other sites

  • Replies 104
  • Created
  • Last Reply
58 minutes ago, JcMagpie said:

Well it's your code all I did was add a few lines. 😊

Cool, just thought it was a bit strange to see my name in your addon, but as it's a derivative work I guess it has to be.  You  need to add in your details to that copyright, eg;

Copyright (c) 2018, Z Iqbal based on code Copyright (c) 2018, G Burton

(or something broadly equivalent to the above) ... and then make clear that any support requests must come here or elsewhere if you prefer them elsewhere (as I do support for my stuff off forum and wouldn't want people contacting me about it)..

Link to comment
Share on other sites

Optional improvements to dynamic tabs.  Can be seen on test site

https://chilleddisplays.co.uk/product_info.php/cPath/1_9/products_id/29

The tabs are deliberately a no core or DB change add-on. It uses information already in the DB from stock CE. For most people this is all that is needed.

If how ever you need additional then there is a small change you can make to add 2 additional tabs.

Stock osC has 2 fields in product info that can be used. The first is

1) Product Meta Description for SEO:

You should be using this to put a brief description of each product. If you are then use this as the product info tab input. It will give your page a nice clean look.

You can then use the main product description box to add additional tech info on the product. So all the detail stuff can go in that.

2) Product Meta Keywords for SEO:

This is obsolete for most people so why not use it. You could use it to add warranty info for each product or anything else you require.

I’m not going to include this in the add-on as its not the best solution. However if you must have the additional tabs then these are the changes needed.

Backup first.

In product_info.php find areound line 38

$product_info_query = tep_db_query("select p.products_id, pd.products_name,pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_gtin from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    

and replace with this

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_seo_keywords, pd.products_seo_description, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_gtin from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    

Then in /includes/modules/content/product_info/cm_pi_description_tabs.php find line,

$manufacturers_image = stripslashes($manufacturer['manufacturers_image']);

and add after it,

$products_seo_description = stripslashes($product_info['products_seo_description']);
$products_seo_keywords = stripslashes($product_info['products_seo_keywords']);

 

Then open includes/modules/content/product_info/templates/tpl_cm_pi_description_tabs.php  and find

<ul class="tabs">

and add the new tabs in the order you need them for examle

<li><a href="#tab-1">Product Info</a></li>
    <li><a href="#tab-2">Tech Info</a></li>
    <li><a href="#tab-3">Stock</a></li>
    <li><a href="#tab-4">QR Codes</a></li>
    <li><a href="#tab-5">Shipping</a></li>
    <li><a href="#tab-6">Privacy</a></li>
    <li><a href="#tab-7">Warranty</a></li>

Then find

<div id="tab-1">

and again add the tabs as required.

<div id="tab-1">
      <?php echo $products_seo_description; ?>
    </div>


<-----your other tabs renumbered as required-------------->



<div id="tab-7">
      <?php echo $products_seo_keywords; ?>
    </div>

That's about it Enjoy.

image.png.af0741c13fd62daa174af88504dae650.png

image.png.0018968a64ac77268800f982c07840a1.png

 

Link to comment
Share on other sites

Yes defiantly something not right on your site. It’s only been tested on CE BS3 and CE BS4

I just don’t have the time to make them for every version. It’s working on both my test sites.

Check you error log and see what is being reported.

 

Link to comment
Share on other sites

Has been updated to V1.2 to fix browser error if no bar code was present. Also fix QR script so if QR code is not present nothing will show.

Also fix BS3 code as it was not working on old Edge site.

 

Link to comment
Share on other sites

Hello Zahid,

Your addon is very good and easy to install.
But there is one problem: it does not supported multiple languages. This is the name of the tabs and the contents of some of them. To example: Condition. Delivery.
My site already contains languages files, for example, languages/-LANG-/shipping.php, languages/-LANG-/condition.php
Files shipping.txt and  condition.txt - are not a very convenient and universal solution.

How to add language constants? How can I change the code so that the addon would support many languages?

Thanks, Fred.

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Link to comment
Share on other sites

I think half of the problem is solved. Need to adjust the second part.

Change infile     tpl_cm_pi_description_tabs.php

    <li><a href="#tab-1">Product Info</a></li>
    <li><a href="#tab-2">Tech Info</a></li>
    <li><a href="#tab-3">Stock</a></li>
    <li><a href="#tab-4">QR Codes</a></li>
    <li><a href="#tab-5">Shipping</a></li>
    <li><a href="#tab-6">Privacy</a></li>
    <li><a href="#tab-7">Warranty</a></li>

To

    <li><a href="#tab-1"><?php echo TPD_INFO; ?></a></li>
    <li><a href="#tab-2"><?php echo TPD_DESC; ?></a></li>
    <li><a href="#tab-3"><?php echo TPD_STOCK; ?></a></li>
    <li><a href="#tab-4"><?php echo TPD_QRC; ?></a></li>
    <li><a href="#tab-5"><?php echo TPD_SHIP; ?></a></li>
    <li><a href="#tab-6"><?php echo TPD_PRIV; ?></a></li>
    <li><a href="#tab-7"><?php echo TPD_WARRANT; ?></a></li>

Add to englisg.php and other languages files.

/**** cm_pi_description_tabs ****/ //NOTE: text must be on one line
define('TPD_INFO', 'Product Info');
define('TPD_DESC', 'Tech Info');
define('TPD_STOCK', 'Stock');
define('TPD_QRC', 'QR Codes');
define('TPD_SHIP', 'Shipping');
define('TPD_PRIV', 'Privacy');
define('TPD_WARRANT', 'Warranty');
/**** End cm_pi_description_tabs ****/

 

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Link to comment
Share on other sites

Yes you need modular product info or you will not be able to place it in order! You will find many product info add-ons work on non moduler page but get added at bottom of page.

If you are using BS of any kind of edge (not gold have not tested) then you can simply add the new moduler product_info page and then add all the modules and it normaly just works.

 

Link to comment
Share on other sites

Quote

jquery.qrcode.js:89 Uncaught ReferenceError: jQuery is not defined
    at jquery.qrcode.js:89
(anonymous) @ jquery.qrcode.js:89
product_info.php?cPath=21&products_id=28:267 Uncaught ReferenceError: jQuery is not defined
    at product_info.php?cPath=21&products_id=28:267
(anonymous) @ product_info.php?cPath=21&products_id=28:267
product_info.php?cPath=21&products_id=28:276 Uncaught ReferenceError: $ is not defined
    at product_info.php?cPath=21&products_id=28:276
(anonymous) @ product_info.php?cPath=21&products_id=28:276
www-embed-player.js:377 POST https://www.youtube.com/youtubei/v1/log_event?alt=json&key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 net::ERR_SSL_PROTOCOL_ERROR

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...