Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Manufacture's About contribution help

Manufacture's About contribution help

Locked

Views: 1,491

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
16 Oct 2014, 3:38 PM
#1
rodrigodc avatar

rodrigodc

New Zenner

Join Date:
Jun 2014
Location:
Washington, DC
Posts:
4
Plugin Contributions:
0

Manufacture's About contribution help

Hello,

I am using a contribution called Manufacture's About that enables the use of a description box for manufactures (I use it for Artist's bios) in the admin, and then set up a Manufacture's Page with an image and the aforementioned description. The template page also includes two links:

  1. to all products by such manufactures, and
  2. To a Manufacture's external URL page IF specified in the admin page.

Everything work for me except the links. The template somehow is not pulling in the SQL data from the Manufacture's table (created by the contribution). Here is the code of the template file:

<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: manufacturers_about_default.php  v1.2.3.0 2005-01-04 langer $
//
?>

<table  width="100%" border="0" cellspacing="8" cellpadding="2">
  <tr>
    <td class="breadCrumb" colspan="2"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></td>
  </tr>
  <tr>
    <td class="pageHeading" colspan="2"><h1 id="indexCategoriesHeading"><?php echo HEADING_TITLE; ?></h1></td>
  </tr>
  <tr>
<?php
  $content = '<td nowrap="nowrap" valign="top" class="ArtistOtherInfo">';
	if (zen_not_null($manufacturers_about->fields['manufacturers_image'])) {
	  $content .= '<div align="left" class="main-image">' . zen_image(DIR_WS_IMAGES . $manufacturers_about->fields['manufacturers_image'], $manufacturers_about->fields['manufacturers_name']) . '</div>';
	  }
	if (zen_not_null($manufacturers_about->fields['manufacturers_url'])) {
	  $content .= '<div id="ArtistOtherInfo"><li><a href="' . zen_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturers_about_id) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturers_about->fields['manufacturers_name']) . '</a></li></div>';
	  }
	$content .= '<div id="ArtistOtherInfo"><li><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers_about_id) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></li></div></td>';
  if (($manufacturers_about->fields['manufacturers_about'])) {
  	$content .= '<td class="infoBox" valign="top">' . ($manufacturers_about->fields['manufacturers_about']) . '</td>';
  } else {
  $content .= '<td class="infoBox"> </td>';
  }
  echo $content;
?>
  </tr>
<?php if (TEXT_INFORMATION) { ?>
  <tr>
    <td class="main" colspan="2"><?php echo TEXT_INFORMATION; ?></td>
  </tr>
<?php } ?>
  <tr>
    <td class="main" colspan="2"><br /><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></td>
  </tr>
</table>

The query should come from the extra_functions file. This is it:

<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: functions_manufacturers_about.php v1.2.3.0 2005-01-04 langer $
//

//
// returns manufacturers about array
//

  function zen_get_manufacturers_about($manufacturers_about_id, $language = '') {
    global $db;
    // $manufacturers_about = array();

    if (empty($language)) $language = $_SESSION['languages_id'];

    $manufacturers_about_query = "select m.manufacturers_name, m.manufacturers_image,
                           mi.manufacturers_url, mi.manufacturers_about
                           from " . TABLE_MANUFACTURERS . " m
                           left join " . TABLE_MANUFACTURERS_INFO . " mi
                           on (m.manufacturers_id = mi.manufacturers_id
                           and mi.languages_id = '" . (int)$language . "')
                           where m.manufacturers_id = '" . (int)$manufacturers_about_id . "'";

    $manufacturers_about= $db->Execute($manufacturers_about_query);

    	// echo $manufacturers_about->fields['manufacturers_name'];

    return $manufacturers_about;
  }
?>

But somehow, the links are not working. They are missing the ID:

<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers_about_id) . '">

Can anyone give me hint on how to to create a query to make sure that the field ID from table manufacturers_about is actually pass through to the template file?

I am not a programmer, but I use common sense and I am patient.

Thanks for your help.

17 Oct 2014, 2:07 PM
#2
rodrigodc avatar

rodrigodc

New Zenner

Join Date:
Jun 2014
Location:
Washington, DC
Posts:
4
Plugin Contributions:
0

Re: Manufacture's About contribution help

Perhaps I made this post too complicated. What I'm am asking is the following:

How do I query the database to output fields from within two different tables to the template file?

I think that should resolve the issue.

Thanks in advances.

19 Oct 2014, 2:33 PM
#3
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Manufacture's About contribution help

Where did you get the mod from?

2005 - version may have passed use-by date.

22 Oct 2014, 1:55 PM
#4
rodrigodc avatar

rodrigodc

New Zenner

Join Date:
Jun 2014
Location:
Washington, DC
Posts:
4
Plugin Contributions:
0

Re: Manufacture's About contribution help

Yes, this is definitely an outdated mod, but it works fine on my version and there is nothing else like it that I could find.

The only problem with the plugin is that those two links above (The Manufactures's URL and the page to other products) do not work. It should be a relatively easy fix (I think), and then all should be good.

I can try to find out for you the URL to download the mod.If I cannot find it, I'd be glad to upload it or send it to you via PM.

If anyone else has any incline to help out, I would appreciate it.

26 Oct 2014, 11:11 AM
#5
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Manufacture's About contribution help

It would help if you could provide a link to download or attach the original zip file in reply.

Or are the above two files all there is to the mod?

26 Oct 2014, 12:51 PM
#6
rodrigodc avatar

rodrigodc

New Zenner

Join Date:
Jun 2014
Location:
Washington, DC
Posts:
4
Plugin Contributions:
0

Re: Manufacture's About contribution help

dw08gm:

It would help if you could provide a link to download or attach the original zip file in reply.

Or are the above two files all there is to the mod?

There are other files. You may download the entire mod here:

Attachment #14630

Thank you very much for your attempt to help.

Rodrigo

28 Oct 2014, 7:46 AM
#7
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Manufacture's About contribution help

Let me say firstly that in my experience Langer (brother, where art thou) made good reliable mods.

I loaded the zip file supplied into a 139h store and found it basically works with minimal modification. In merging the files, I tended to preserve 139h code instead of over-writing with the mod code.

Screenshot01.png shows the Admin > Manufacturer > Edit Manufacturer page with a Manufacturer URL and About Manufacturer fields completed. So that works.

Attachment 14634

Upon selecting a manufacturer from the Manufacturer (= Makes) sidebox, the Manufacturer Info (= Maker Info) sidebox subsequently appears with three links below the Manufacturer Image, while the centre column displayed product info for the single linked product.
Screenshot02.png shows a catalog page displaying the two manufacturer sideboxes (RHS), after manufacturer was selected, with only one product linked to the manufacturer.

Attachment 14635

Each of the three links displayed in Manufacturer Info worked.

  1. Clicking Ancient Aegean Homepage (linked defined as http://www.doggy.bom) opened into a new tab, as expected, although url was bogus. Did you get this far?

  2. Clicking Other Products displayed the only product listed for the manufacturer in the centre column. However, upon adding a second product via admin > catalog >categories/products, both products display in the centre column upon clicking the manufacturer link, but the Manufacturer Info sidebox disappears until one of the centre column products is selected. Screenshot03.png shows a catalog page after clicking Other Products, that displays only the Manufacturer sidebox and two products linked to the manufacturer. I would have prefered that the Manufacturer Info sidebox remained visible. Need to look into this. Screenshot04.png shows a catalog page displaying both Manufacturer sideboxes and product info of one linked product, while two products were linked to the manufacturer. Did you get this far?

Attachment 14636

Attachment 14637

  1. Clicking About Ancient Aegean loaded the About Manufacturer page in the centre column, but the Manufacturer Info sidebox disappears again, where I would have prefered that it remained visible. Need to look into this. Did you get this far?

So the mod seems to work, except for the minor glitches described above, with single and multiple products listed per manufacturer.

Addressing your problem:
Your zencart version may have problems. Upgrade recommended.
You may have incorrectly merged the files (biggest hunch).
You may have incorrectly entered the external Manufacturer URL link in admin, (eg as http://www.website.com, did not test for https://etc)
As for the missing manufacturer_id, I am not sure that this is a problem.

Have you found a support thread for this mod?

Hope this helps. Cheers

ps Thanks for the headsup on the mod. It would be great to get this upgraded for 151+, although like yourself I am not a programmer and generally only learn by an aweful lot of trial and error.

20 Nov 2014, 1:28 PM
#8
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Manufacture's About contribution help

  1. Improved BreadCrumbs - Manufacturers_All Page

a. \includes\languages\english\manufacturers_all.php
change
define('NAVBAR_TITLE', 'Manufacturers');
to
//define('NAVBAR_TITLE', 'Manufacturers');
define('NAVBAR_TITLE_1', 'Home'); /* or whatever your index page is called /
define('NAVBAR_TITLE_2', 'Manufacturers'); /
or whatever your manufacturers_all page is called */

b. \includes\modules\pages\manufacturers_all\header_php.php
change
$breadcrumb->add(NAVBAR_TITLE);
to
//$breadcrumb->add(NAVBAR_TITLE);
$breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_DEFAULT));
$breadcrumb->add(NAVBAR_TITLE_2);

  1. Improved BreadCrumbs - Manufacturers_About Page (if used)

a. \includes\languages\english\manufacturers_about.php
change
define('NAVBAR_TITLE', 'Manufacturer > About ' . $manufacturers_about->fields['manufacturers_name']);
to
//define('NAVBAR_TITLE', 'Manufacturer > About ' . $manufacturers_about->fields['manufacturers_name']);
define('NAVBAR_TITLE_1', 'Home'); /* or whatever your index page is called /
define('NAVBAR_TITLE_2', 'Manufacturers'); /
or whatever your manufacturers_all page is called */
define('NAVBAR_TITLE_3', 'About ' . $manufacturers_about->fields['manufacturers_name']);

b. \includes\modules\pages\manufacturers_about\header_php.php
change
$breadcrumb->add(NAVBAR_TITLE);
to
//$breadcrumb->add(NAVBAR_TITLE);
$breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_DEFAULT));
$breadcrumb->add(NAVBAR_TITLE_2, zen_href_link(FILENAME_MANUFACTURERS_ALL));
$breadcrumb->add(NAVBAR_TITLE_3);

Cheers

6 Feb 2015, 10:07 PM
#9
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Manufacture's About contribution help

I have been working on merging Manufacturer About with Manufacturer All to play with sideboxes/tpl_manufacturer_info and sideboxes/tpl_manufacturer_select. I have all the links working, except in two instances (IIRC):

  1. when user cycles through the links beginning with Manufacturer All page, then to Manufacturer About, then to manufacturers products page, then back to Manufacturer About from the Manufacturer Info sidebox, whereupon the link to manufacturers products page reverts to index.php. Somewhere along the way, the manufacture_id/manufacture_about_id is lost or reset to null, since the page is addressed as main_page=index.php&manufacturer_id=(blank).

  2. when manufacturer has more than one product, the manufacturer_info sidebox does not display, hence no direct links to manufacturer_about or manufacturer website. To get back to manufacturer_about, user must return to the Manufacturer All page.

Clear as mud? Hmmm!

Anyway for your external website link problem above, change

$content .= '<div id="ArtistOtherInfo"><li><a href="' . zen_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturers_about_id) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturers_about->fields['manufacturers_name']) . '</a></li></div>';

to

$content .= '<div id="ArtistOtherInfo"><li><a href="http://' . zen_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturers_about_id) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturers_about->fields['manufacturers_name']) . '</a></li></div>';
23 Feb 2015, 10:31 AM
#10
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Manufacture's About contribution help

You may be interested to know that I updated this mod as Manufacturers All About 1.0 for zc153+, which combines two previous mods - Manufacturers All Listing and Manufacturers About.

http://www.zen-cart.com/downloads.php?do=file&id=1966

Cheers