adding template code for AmazonSimilarItems et al
authorJoshua Ferraro <jmf@liblime.com>
Tue, 27 Nov 2007 03:26:51 +0000 (21:26 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 27 Nov 2007 03:27:25 +0000 (21:27 -0600)
Test this by having the following ISBNs in your system:

0152018484
0152053530

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl

index 82ee429..2a25379 100755 (executable)
@@ -134,14 +134,13 @@ if ( C4::Context->preference("AmazonContent") == 1 ) {
                        if (C4::Context->preference("AmazonSimilarItems") ) {
                                my $xbiblios;
                                my @xisbns;
-
                                if (C4::Context->preference("XISBNAmazonSimilarItems") ) {
-                                       my $xbiblio = get_biblio_from_xisbn($product);
-                                       push @xisbns, $xbiblio;
-                                       $xbiblios = \@xisbns;
+                                       $xbiblios = get_xisbns($product);
                                }
                                else {
-                                       $xbiblios = get_xisbns($product);
+                                       my $xbiblio = get_biblio_from_xisbn($product);
+                    push @xisbns, $xbiblio ;
+                    $xbiblios = \@xisbns;
                                }
                push @products, +{ product => $xbiblios };
                        }
@@ -157,7 +156,7 @@ if ( C4::Context->preference("AmazonContent") == 1 ) {
                 comment => $reviews->{Comment},
               };
         }
-    }
+    } use Data::Dumper; warn Dumper(@products);
     $template->param( SIMILAR_PRODUCTS => \@products );
     $template->param( AMAZONREVIEWS    => \@reviews );
 }
index 511423c..613c193 100644 (file)
 <!-- /TMPL_LOOP -->
 </ul>
 <!-- /TMPL_IF -->
+<h2>Related Items</h2>
+<ul>
+<!-- TMPL_LOOP NAME="SIMILAR_PRODUCTS" -->
+<!-- TMPL_LOOP NAME="product" -->
+<li><img src="/opac-tmpl/prog/itemtypeimg/<!-- TMPL_VAR
+NAME="itemtype" -->.gif" title="<!-- TMPL_VAR NAME="itemtype" -->" />
+<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR
+NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> by <!--
+TMPL_VAR NAME="author" --> &copy;<!-- TMPL_VAR NAME="copyrightdate"
+--></li>
+<img src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="isbn"
+-->.01._THUMBZZZ_PU_PU-5_.jpg" />
+
+   <!-- TMPL_LOOP NAME=items -->
+   <!-- TMPL_IF NAME="itype" --><img
+src="/opac-tmpl/prog/itemtypeimg/<!-- TMPL_VAR NAME="itype" -->.gif"
+title="<!-- TMPL_VAR NAME="itype" -->" /><!-- /TMPL_IF -->
+   barcode:<!-- TMPL_VAR NAME="barcode" -->
+   <!-- /TMPL_LOOP -->
+<!-- /TMPL_LOOP -->
+<!-- /TMPL_LOOP -->
+</ul>
 </div>
 
 <div class="yui-g" id="export" style="margin-top: 1em;">