Jump to content
Latest News: (loading..)
kymation

[Contribution] Documents Manager

Recommended Posts

Thanks Jim

 

I've read through the links, and can see that i need to add

 

<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_DOCUMENTS) . '">' . BOX_INFORMATION_DOCUMENTS . '</a>');

 

to catalog/includes/modules/boxes/bm_information.php, but don't know if i should be adding

 

// Start Documents Manager

$documents_string = '';

if (DOCUMENTS_SHOW_INFO_BOX == 'True') {

$document_type_array = document_types ();

 

foreach ($document_type_array as $document_type) {

$documents_query_raw = "select count(*) as total

from " . TABLE_DOCUMENTS . "

where document_types_id = '" . $document_type['id'] . "'

and documents_visible = 'True'

";

// print 'Documents Query: ' . $documents_query_raw . '<br>';

$documents_query = tep_db_query ($documents_query_raw);

$documents = tep_db_fetch_array ($documents_query);

 

if ($documents['total'] > 0) {

$documents_string .= '<a href="' . tep_href_link (FILENAME_DOCUMENTS, 'type=' . $document_type['id'], 'NONSSL') . '">' . $document_type['text'] . '</a><br>';

} // if ($documents['total']

} // foreach ($document_type_array

} // if (DOCUMENTS_SHOW_INFO_BOX

// End Documents Manager

 

Think I may just have to restore the vanilla install

 

ken

Edited by kenkja

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

This one is a bit more complicated than the example. Try this (as the execute() method in bm_information.php)

 

   function execute() {
     global $oscTemplate;

     $documents_string = '';
     $document_type_array = document_types();

     foreach ($document_type_array as $document_type) {
       $documents_query_raw = "
         select
           count(*) as total
         from
           " . TABLE_DOCUMENTS . "
         where
           document_types_id = '" . $document_type['id'] . "'
           and documents_visible = 'True'
      ";
       // print 'Documents Query: ' . $documents_query_raw . '<br>';
       $documents_query = tep_db_query( $documents_query_raw );
       $documents = tep_db_fetch_array( $documents_query );

       if ($documents['total'] > 0) {
         $documents_string .= '<a href="' . tep_href_link (FILENAME_DOCUMENTS, 'type=' . $document_type['id'], 'NONSSL') . '">' . $document_type['text'] . '</a><br />' . "\n";
       } // if ($documents['total']
     } // foreach ($document_type_array

     $data = '<div class="ui-widget infoBoxContainer">' .
             '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_INFORMATION_BOX_TITLE . '</div>' .
             '  <div class="ui-widget-content infoBoxContents">' .
             '    <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOXES_INFORMATION_BOX_SHIPPING . '</a><br />' .
             '    <a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . MODULE_BOXES_INFORMATION_BOX_PRIVACY . '</a><br />' .
             '    <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' .
             '    <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a><br />' . 
             $documents_string . 
             '  </div>' .
             '</div>';

     $oscTemplate->addBlock($data, $this->group);
   }

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello Jim

 

That worked, thanks.

 

Do I need to alter includes/boxes/documents.php similarly.

 

ken


Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

Yes, that file also needs to be modified in much the same way. Post here if you have problems with it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim

 

To be honest, i'm finding the upgrading a little hard going.

 

The information box worked with the code you supplied above, but I couldn't switch it off via admin, so figured out I needed to change it slightly.

 

$documents_string = '';
     if (DOCUMENTS_SHOW_INFO_BOX == 'True') {
     $document_type_array = document_types();

     foreach ($document_type_array as $document_type) {
       $documents_query_raw = "select count(*) as total
                              from " . TABLE_DOCUMENTS . "
                              where document_types_id = '" . $document_type['id'] . "'
                                and documents_visible = 'True'
                             ";
       // print 'Documents Query: ' . $documents_query_raw . '<br>';
       $documents_query = tep_db_query( $documents_query_raw );
       $documents = tep_db_fetch_array( $documents_query );

       if ($documents['total'] > 0) {
         $documents_string .= '<a href="' . tep_href_link (FILENAME_DOCUMENTS, 'type=' . $document_type['id'], 'NONSSL') . '">' . $document_type['text'] . '</a><br />' . "\n";
       } // if ($documents['total']
     } // foreach ($document_type_array
     } // if (DOCUMENTS_SHOW_INFO_BOX

 

So now the information box is working fine.

 

However after trying for most of the day, just could not get the Documents box to appear or get any links to appear on product_info.php.

 

Anyway in the end, I thought I'd try to replicate the information box and call it Documents, so created includes/modules/boxes/documents.php, as follows :-

 

<?php
/*
 $Id: documents.php, v 1.0 20090909 kymation Exp $
 $From: information.php 1739 2007-12-20 00:52:16Z hpdl $
 $Loc: catalog/includes/boxes/ $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class documents {
   var $code = 'documents';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;

   function documents() {
     $this->title = MODULE_BOXES_DOCUMENTS_TITLE;
     $this->description = MODULE_BOXES_DOCUMENTS_DESCRIPTION;

     if ( defined('MODULE_BOXES_DOCUMENTS_STATUS') ) {
       $this->sort_order = MODULE_BOXES_DOCUMENTS_SORT_ORDER;
       $this->enabled = (MODULE_BOXES_DOCUMENTS_STATUS == 'True');

       $this->group = ((MODULE_BOXES_DOCUMENTS_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
   }
 }

 function execute() {
   global $oscTemplate;

 $documents_string = '';
 if (DOCUMENTS_SHOW_BOX == 'True') {
   $document_type_array = document_types ();

   foreach ($document_type_array as $document_type) {
     $documents_query_raw = "select count(*) as total
                            from " . TABLE_DOCUMENTS . "
                            where document_types_id = '" . $document_type['id'] . "'
                              and documents_visible = 'True'
                           ";
     // print 'Documents Query: ' . $documents_query_raw . '<br>';
     $documents_query = tep_db_query ($documents_query_raw);
     $documents = tep_db_fetch_array ($documents_query);

     if ($documents['total'] > 0) {
       $documents_string .= '<a href="' . tep_href_link (FILENAME_DOCUMENTS, 'type=' . $document_type['id'], 'NONSSL') . '">' . $document_type['text'] . '</a><br>';
     } // if ($documents['total']
   } // foreach ($document_type_array
   } // if (DOCUMENTS_SHOW_BOX

   $data = '<div class="ui-widget infoBoxContainer">' .
           '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_DOCUMENTS_BOX_TITLE . '</div>' .
           '  <div class="ui-widget-content infoBoxContents">' .
           '    <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOX_DOCUMENTS_BOX_SHIPPING . '</a><br />' .
           '    <a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . MODULE_BOXES_INFORMATION_BOX_PRIVACY . '</a><br />' .
           '    <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' .
           '    <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a><br />' .
              $documents_string .
           '  </div>' .
           '</div>';

     $oscTemplate->addBlock($data, $this->group);
   }

   function isEnabled() {
     return $this->enabled;
   }

   function check() {
     return defined('MODULE_BOXES_DOCUMENTS_STATUS');
   }

   function install() {
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_DOCUMENTS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_DOCUMENTS_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_DOCUMENTS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
   }

   function remove() {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
   }

   function keys() {
     return array('MODULE_BOXES_DOCUMENTS_STATUS', 'MODULE_BOXES_DOCUMENTS_CONTENT_PLACEMENT', 'MODULE_BOXES_DOCUMENTS_SORT_ORDER');
   }
 }
?>

 

then did similar, with includes/languages/modules/boxes/bm_information.php to create includes/languages/modules/boxes/documents.php

 

<?php
/*
 $Id$

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright (c) 2010 osCommerce

 Released under the GNU General Public License
*/

 define('MODULE_BOXES_DOCUMENTS_TITLE', 'Information');
 define('MODULE_BOXES_DOCUMENTS_DESCRIPTION', 'Show information page links');
 define('MODULE_BOXES_DOCUMENTS_BOX_TITLE', 'Information');
 define('MODULE_BOXES_DOCUMENTS_BOX_PRIVACY', 'Privacy Notice');
 define('MODULE_BOXES_DOCUMENTS_BOX_CONDITIONS', 'Conditions of Use');
 define('MODULE_BOXES_DOCUMENTS_BOX_SHIPPING', 'Shipping & Returns');
 define('MODULE_BOXES_DOCUMENTS_BOX_CONTACT', 'Contact Us');
?>

 

Thought that in theory, that should have allowed me to add the box via admin/modules/boxes, which it did, albeit with some issues on the box heading, but the documents manager had no effect on the new box, so figured I'm barking up the wrong tree

 

ken


Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

That will work if you remove the Information page links. You only need one of these boxes, depending on whether you want the document links in the Information box or in a separate box.

 

Neither box will show any links until you have at least one document loaded. It's designed to ignore any document categories that don't have anything in them.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello Jim

 

I see my mistake now, doh "its homer time"

 

Changed

 

'    <a href="' . tep_href_link (FILENAME_SHIPPING) . '">' . MODULE_BOX_DOCUMENTS_BOX_SHIPPING . '</a><br />' .

 

to

 

'    <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOXES_DOCUMENTS_BOX_SHIPPING . '</a><br />' .

 

and hey presto it works and is acknowledged by the admin document manager.

 

Now only product_info.php to resolve

 

ken

Edited by kenkja

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

JIm,

 

Here's my product_info.php, it's not vanilla as I've added Fimble's info only contribution. Also the version 2.2 & 2.3.1 files are significantly different so I couldn't find the exact place where your contribution says I should add the extra lines, so I've tried to get it close as possible.

 

<?php
/*
 $Id$

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright (c) 2010 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

 require(DIR_WS_INCLUDES . 'template_top.php');

 if ($product_check['total'] < 1) {
?>

<div class="contentContainer">
 <div class="contentText">
   <?php echo TEXT_PRODUCT_NOT_FOUND; ?>
 </div>

 <div style="float: right;">
   <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
 </div>
</div>

<?php
 } else {
   $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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br /><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
?>

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>

<div>
 <h1 style="float: right;"><?php echo $products_price; ?></h1>
 <h1><?php echo $products_name; ?></h1>
</div>

<div class="contentContainer">
 <div class="contentText">

<?php
   if (tep_not_null($product_info['products_image'])) {
     $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order");

     if (tep_db_num_rows($pi_query) > 0) {
?>

   <div id="piGal" style="float: right;">
     <ul>

<?php
       $pi_counter = 0;
       while ($pi = tep_db_fetch_array($pi_query)) {
         $pi_counter++;

         $pi_entry = '        <li><a href="';

         if (tep_not_null($pi['htmlcontent'])) {
           $pi_entry .= '#piGalimg_' . $pi_counter;
         } else {
           $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image']);
         }

         $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a>';

         if (tep_not_null($pi['htmlcontent'])) {
           $pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>';
         }

         $pi_entry .= '</li>';

         echo $pi_entry;
       }
?>

     </ul>
   </div>

<script type="text/javascript">
$('#piGal ul').bxGallery({
 maxwidth: 300,
 maxheight: 200,
 thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>,
 thumbcontainer: 300,
 load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>

<?php
     } else {
?>

   <div id="piGal" style="float: right;">
     <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?>
   </div>

<?php
     }
?>

<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
 cyclic: true
});
</script>

<?php
   }
?>

<?php echo stripslashes($product_info['products_description']); ?>

<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>

   <p><?php echo TEXT_PRODUCT_OPTIONS; ?></p>

   <p>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
     <strong><?php echo $products_options_name['products_options_name'] . ':'; ?></strong><br /><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?><br />
<?php
     }
?>
   </p>

<?php
   }
?>

   <div style="clear: both;"></div>

<?php
   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>

   <p style="text-align: center;"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p>

<?php

// Document Manager
   if (DOCUMENTS_SHOW_PRODUCT_INFO == 'True') {
     include_once (DIR_WS_MODULES . FILENAME_DOCUMENTS);
}   
}
?>

 </div>

<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1");
   $reviews = tep_db_fetch_array($reviews_query);
?>

<div class="buttonSet">                
<?php
// [url="http://www.linuxuk.co.uk"]http://www.linuxuk.co.uk[/url] FIMBLE: added for osC info site
if (SHOW_BUTTON == 'True') { ?>
<span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>
<?php }
if (SHOW_REVIEWS == 'True') {?>
<?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?>
<?php
}
 // [url="http://www.linuxuk.co.uk"]http://www.linuxuk.co.uk[/url] FIMBLE: added for osC info site 
?>                
</div>

<?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
?>

</div>

</form>

<?php
 }

 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

Can you see where I'm going wrong ??

 

thanks again

 

ken

 

 


Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

The exact location is not critical. You can move it around to suit your desired layout.

 

If you think there's something wrong, you need to say what you think is wrong and why. If I have to guess, I'd say you have an extra } in the section that you added.

 

Regards

JIm


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

The exact location is not critical. You can move it around to suit your desired layout.

 

If you think there's something wrong, you need to say what you think is wrong and why. If I have to guess, I'd say you have an extra } in the section that you added.

 

Regards

JIm

 

Hi Sorry Jim,

 

I've added a couple of products and associated some documents to them, but the links don't appear on product_info pages, it is switched on in admin->document manager

 

I added the extra } because without it I get the following error message

 

Parse error: syntax error, unexpected $end in /home/my site/public_html/product_info.php on line 229

 

Line 229 is the final ?>, perhaps I've added the } in the wrong place or maybe I should have done something completely different, I'm not good enough at php to know (yet)

 

I've tried switching off the options relating to product_info.php on the Fimble's info only add on, but it doesn't help.

 

I'm a bit burned out now after a whole day at it, but will try again tomorrow on a vanilla install.

 

I've been writing a new readme.txt for 2.3.1. installs, will foward to you, when alls well

 

ken


Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

Try moving that extra } above the Document Manager section. It's the end of the date available section, and everything in that section only shows if you have a date set.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

You are a star !!!

 

thanks

 

ken


Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Share this post


Link to post
Share on other sites

Hi Jim,

 

I think i found a bug. When i tried to open a brochure i attached to a product, the path to the file was a missing "/".

 

In the file "catalog/includes/modules/documents.php" on line 60

 

old

echo '<span class="document"><a href="' . tep_href_link (DIR_WS_DOCUMENTS . $products_documents['type_name'] .'/' . $products_documents['documents_name']) . '" target="_new">';

new

 

echo '<span class="document"><a href="' . tep_href_link (DIR_WS_DOCUMENTS . $products_documents['type_name'] . $products_documents['documents_name']) . '" target="_new">';

 

regards

 

bret

Share this post


Link to post
Share on other sites

Hi Jim,

 

I think i found a bug. When i tried to open a brochure i attached to a product, the path to the file was a missing "/".

 

In the file "catalog/includes/modules/documents.php" on line 60

 

old

echo '<span class="document"><a href="' . tep_href_link (DIR_WS_DOCUMENTS . $products_documents['type_name'] .'/' . $products_documents['documents_name']) . '" target="_new">';

new

 

echo '<span class="document"><a href="' . tep_href_link (DIR_WS_DOCUMENTS . $products_documents['type_name'] . $products_documents['documents_name']) . '" target="_new">';

 

regards

 

bret

 

Sorry my bad, i did not see that you already posted this bug earlier..

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

Hi Jim,

 

I am haveing a small problem with this addon. I have installed and tested locally and everything works fine. Once i uploaded to the remote server it gives me the following error when i try and open the pdf files associated with the products.

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

i have looked at the htaccess file but i am not really sure what i should be looking for.

 

Regards

 

Bret

Share this post


Link to post
Share on other sites

Some servers seem to have a problem with the downloads section. Try deleting this code from the .htaccess file in the documents directory:

 

# Force download
<Files *.*>
 ForceType application/octet-stream
 Header set Content-Disposition attachment
</Files>

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

Just a quick question. i scrapped the previous version i had because i was having problems with the ckeditor addon. I have now downloaded oscommerce 2.3. Is it possible to include this document manager addon (version 2.2) my website that is version 2.3??

 

From what i can see the only page that will give me issues is the product_info.php? do you think it is possible ? If so where about do i change the code in the product_info page?

If it is not possible do you know of any other addons where i can add product manuals etc to my site?

 

Regards

 

Bret

Share this post


Link to post
Share on other sites

Associate drop down list -

 

Would like to add a mod -

 

See the attached image - you will notice that it is crazy trying to select the product soley by name only. Hence i would like to put the model number along side in the [].

 

I have done this for product atrributes but the code is not the same, i assume that the sql file might need an extra column??--

 

 

Any help welcome:

 

 

---------

AROUND LINE 652:

 

$products_query_raw = "select products_name,

products_id

from " . TABLE_PRODUCTS_DESCRIPTION . "

where language_id = '" . $languages_id . "'

order by products_name

";

// print $products_query_raw . '<br>';

 

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

 

$products_query = tep_db_query($products_query_raw);

$products_array = array();

$products_array[] = array ('id' => '-',

'text' => '-=Select Product=-');

while ($products = tep_db_fetch_array ($products_query)) {

$products_array[] = array ('id' => $products['products_id'],

'text' => $products['products_name'].'  ['.$products ['products_model']. ']' );

Share this post


Link to post
Share on other sites

Hi Jim,

 

Just a quick question. i scrapped the previous version i had because i was having problems with the ckeditor addon. I have now downloaded oscommerce 2.3. Is it possible to include this document manager addon (version 2.2) my website that is version 2.3??

 

From what i can see the only page that will give me issues is the product_info.php? do you think it is possible ? If so where about do i change the code in the product_info page?

If it is not possible do you know of any other addons where i can add product manuals etc to my site?

 

Regards

 

Bret

Document Manager is not hard to convert. You'll need to update the documents.php file and the boxes to the new style. You can add the code to products_info.php just below the products_description.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Associate drop down list -

<snip>

$products_query_raw = "select products_name,

products_model,

products_id

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

all seems to be working now. I am using the Document manager to upload the documents and associate them to the product. when i go to the product the attachments are displayed under the 'More Info' TAB.

 

Just a quick question . In the catalog/includes/modules/documents_tab.php file on line 323

 

<?php

// The Documents tab

if ($documents_tab == true) {

echo ' <div id="tabs-12">';

include( DIR_WS_MODULES . FILENAME_DOCUMENTS );

echo ' </div>';

}

?>

</div>

 

i have changed to

 

<?php

// The Documents tab

if (DOCUMENTS_SHOW_PRODUCT_INFO == 'True') {

echo ' <div id="tabs-12">';

include( DIR_WS_MODULES . FILENAME_DOCUMENTS );

echo ' </div>';

}

?>

</div>

 

Will this code be ok???

 

Regards

 

Bret

Share this post


Link to post
Share on other sites

Either one will work. The constant just needs to be set in the Admin. Use whatever works for you.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×