Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Optional Related Products, Version 4.0


Skittles

Recommended Posts

installed related on my new site to be running OSC234/bootstrap.  Under admin  went down to Module and click on Content I get: Fatal error: Cannot redeclare tep_get_products_model() (previously declared in /home/ladybug3597/public_html/osc234/adminlb/includes/functions/general.php:549) in /home/ladybug3597/public_html/osc234/adminlb/includes/functions/related_products_funcs.php on line 25

 

I did not modify this file, it is as copy up to the sever.  How to fix this?

Link to comment
Share on other sites

installed related on my new site to be running OSC234/bootstrap.  Under admin  went down to Module and click on Content I get: Fatal error: Cannot redeclare tep_get_products_model() (previously declared in /home/ladybug3597/public_html/osc234/adminlb/includes/functions/general.php:549) in /home/ladybug3597/public_html/osc234/adminlb/includes/functions/related_products_funcs.php on line 25

 

I did not modify this file, it is as copy up to the sever.  How to fix this?

Hello Dean @@dculley,

 

Then you had an old version of related products installed. Maybe you are using includes/functions/general.php from a previous installation??

open your includes/functions/general.php

and remove the functions:

        function tep_get_products_model($product_id) {
          $product_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
          $product = tep_db_fetch_array($product_query);

          return $product['products_model'];
        }

        function tep_get_products_description($product_id, $language_id) {
          $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
          $product = tep_db_fetch_array($product_query);

          return $product['products_description'];
        }

They are now included in the module

 

regards

Rainer

Link to comment
Share on other sites

Hello Dean @@dculley,

 

Oh yes, you are right, my fault.

It is: ADMIN/includes/functions/general.php

 

If you have a look on the error message, you can also see where is the problem:

previously declared in /home/ladybug3597/public_html/osc234/adminlb/includes/functions/general.php:549

 

The version is correct

 

regards

Rainer

Link to comment
Share on other sites

@@raiwa  Hi Rainer

 

Thanks for reaching out and helping.  It means a lot to me.

 

Ok back at work,  so this weekend I went back to the beginning.  By reinstalling BS.  I had two more issues I needed to put a nail in. 

Doing one step at a time.  Now I’m back to Related Products 234 BS.

 

I did not get the previous error this time.  This time after uploading to as clean a site as possible, the Related Products program.  I get the following:

 

Going to Admin administration screen, Catalog > Related Products – clicked on “configuration options” this pops up:

 

Warning: Invalid argument supplied for foreach() in /home/ladybug3597/public_html/osc234/adminlb/modules_content.php on line 290

 

Line 290 is:  foreach ($mInfo->keys as $key => $value) {

 

Being I’m not a programmer I have no idea what the problem is.  This is not a modified file.  So it leaves me with nothing but questions

Link to comment
Share on other sites

Hello Dean @@dculley,

 

Did you clean or reinstall your database???

 

If not try this:

- In your Admin area, uninstall all optional related product modules

- Enter your database with phpMyAdmin

- select the table "configuration"

- Search for: configuration_key - LIKE%...% - RELATED_PRODUCTS

- If you get any results, erase the entries

- reinstall the related product modules in Admin

 

regards

Rainer

Link to comment
Share on other sites

Hello Rainer @@raiwa

 

I did as you asked.  I uninstalled all admin modules as instructed,  Checked phpmyadmin - MYSQL returned an empty result set (i.e. zero rows).  I re loaded admin modules, went to sql and uninstalled then reinstalled.  tried to configure and got the same results.

Link to comment
Share on other sites

Hello Dean @@dculley,

 

I just checked again in an unmodified 2.3.4 BS store (master download from 24/February/2015), and all works without any problem.

 

Which is your exact 2.3.4 bootstrap version?? Is it at least bootstrap Gold release??

If it's an older version, can you check if in product_info.php this line is present (about line 214-216):

  <div class="row">
    <?php echo $oscTemplate->getContent('product_info'); ?>
  </div>

If not, add it before:

<?php
    if ((USE_CACHE == 'true') && empty($SID)) {
      echo tep_cache_also_purchased(3600);
    } else {
      include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
    }
Edited by raiwa
Link to comment
Share on other sites

@@raiwa  GOT IT or should I say FOUND IT :lol: :D (w00t)

 

Need to go to admin side /Modules/content -> install and pick Related Products you might like.  This is missing from the install.txt file.  It is the new config file.

Link to comment
Share on other sites

Hello Dean @@dculley,

 

It's supposed that the module is auto installed if you open in Admin the related products page for the first time.

Instructions:

5) In Admin, go to Catalog->Related Products.
    The Content Module will be installed and displayed.
    Go once again to Catalog->Related Products
    The SQL Setup Utility will be displayed.
    Click on the button for a new install. You will automatically be redirected to
    the Optional Related Products page once the database has been updated.
 

regards

Rainer

Link to comment
Share on other sites

I have a problem installing the related products addon in Osc 2.3.4 BS gold

 

the following error is presented:

 

Fatal error: Cannot redeclare tep_version_readonly() (previously declared in C:\xampp\htdocs\gold\includes\functions\recently_viewed.php:42) in C:\xampp\htdocs\gold\admin\includes\functions\related_products_funcs.php on line 18

 

obviously I have the recently view BS addon pre-installed. 

 

Can any advise as it appears a function is redeclared

 

regards

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

replaced

 

     function tep_version_readonly($value){
          $version_text = '<br>Version ' . $value;
          return $version_text;
        }

 

with

 

if(!function_exists('tep_version_readonly')) {
      function tep_version_readonly($value){
          $version_text = '<br>Version ' . $value;
          return $version_text;
        }
}

 

in file related_products_funcs.php

 

seems ok now, im still running in a test server, i'll confirm later.

 

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

@@raiwa

Hi Rainer

 

Me again. Im trying to use

.headliner

{
    min-height: 43px;
}
@@media (max-width: 768px) {
.headliner {
    min-height: 15px;
}
}
.back-to-top {
    bottom: 2px;
    cursor: pointer;
    display: none;
    position: fixed;
    right: 10px;}

with

<div class="headliner">

 

In an endevour to keep all boxs thye same height regardless of whether they have 2 or 3 lines., works well for new products and just wondering where I might put this in "related products"

 

Many thanks Grandpa

Link to comment
Share on other sites

replaced

 

     function tep_version_readonly($value){

          $version_text = '<br>Version ' . $value;

          return $version_text;

        }

 

with

 

if(!function_exists('tep_version_readonly')) {

      function tep_version_readonly($value){

          $version_text = '<br>Version ' . $value;

          return $version_text;

        }

}

 

in file related_products_funcs.php

 

seems ok now, im still running in a test server, i'll confirm later.

 

Mike

Hello Mike @@Mikepo,

 

Yes, thank you. I did this in the revently viewed add-on, but forgot it here.

Depending on the loading order it may produce this error if another add-on uses the same function.

I'll add it in the next update.

 

regards

Rainer

Link to comment
Share on other sites

@@raiwa

Hi Rainer

 

Me again. Im trying to use

.headliner

{

    min-height: 43px;

}

@@media (max-width: 768px) {

.headliner {

    min-height: 15px;

}

}

.back-to-top {

    bottom: 2px;

    cursor: pointer;

    display: none;

    position: fixed;

    right: 10px;}

with

<div class="headliner">

 

In an endevour to keep all boxs thye same height regardless of whether they have 2 or 3 lines., works well for new products and just wondering where I might put this in "related products"

 

Many thanks Grandpa

Hello John @@grandpaj,

 

Could you post the modification you applied in new products, I'll have a look then.

 

regards

Rainer

Link to comment
Share on other sites

@@raiwa

Hi Rainer

 

Here's yhe new_products.php file

$num_new_products = tep_db_num_rows($new_products_query);

  if ($num_new_products > 0) {

    $new_prods_content = NULL;

    while ($new_products = tep_db_fetch_array($new_products_query)) {
      $new_prods_content .= '<div class="col-sm-6 col-md-4">';
      $new_prods_content .= '  <div class="thumbnail equal-height">';
      $new_prods_content .= '    <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
      $new_prods_content .= '    <div class="caption">';
      $new_prods_content .= '      <p class="text-center headliner"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></p>';
      $new_prods_content .= '      <hr>';
      $new_prods_content .= '      <p class="text-center">' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</p>';
      $new_prods_content .= '      <div class="text-center">';
      $new_prods_content .= '        <div class="btn-group">';
      $new_prods_content .= '          <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'products_id=' . $new_products['products_id']) . '" class="btn btn-default" role="button">' . SMALL_IMAGE_BUTTON_VIEW . '</a>';
      $new_prods_content .= '          <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '" class="btn btn-success" role="button">' . SMALL_IMAGE_BUTTON_BUY . '</a>';
      $new_prods_content .= '        </div>';
      $new_prods_content .= '      </div>';
      $new_prods_content .= '    </div>';
      $new_prods_content .= '  </div>';
      $new_prods_content .= '</div>';
    }
?>

 

Many thanks

 

Grandpa

Link to comment
Share on other sites

@@raiwa

 

Hi Rainer

 

Played around with cm_pi_relayed_products and changed

 

$optional_rel_prods_content .= '<h5 class="text-center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . $products_name_slave . '</a><br />';

 

to

 

$optional_rel_prods_content .= '<p class="text-center headliner"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . $products_name_slave . '</a><br />';

 

Seems to work, but probably reqiures a closer look, as Im certainly no coder

 

Cheers

 

Grandpa

Edited by grandpaj
Link to comment
Share on other sites

  • 4 weeks later...

In getting my new site ready to go live running under osc234/bs, I uploaded my product related items data from my current live site to the new.  In testing I see I have a little cleaning up to do.  But my problem is that it is stock on page 1,   You can click on pg 2, 3, 4...  the wheel spins screen blinks and still on page 1. 

 

What do I need to do so that I can get it to go page to page?

Link to comment
Share on other sites

Hello Dean @@dculley,

 

Did you check that the optional related version in your old store is the same like in your new store.

Compare the optional related database table if it has the same amount of columns and if they have the same name.

 

regards

Rainer

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...