Saturday, June 5, 2010

Prestashop as Bookstore Part 2 - Book Series & Publishers

I have done several modifications to make PrestaShop usable as a bookstore and I will try to sum it up in a few blog posts.

Today I'll talk a little about more information I like to have in my Bookstore, eg the Publishers of the books.

I understand if my needs are not the same as most Bookstores have, but these modifications were very valuable for my needs.
First of all, listing the Publishers, to be able to find all books from a certain Publisher is almost a must for me.
And also, lots of my books are part of a series of books, so listing all books in a series is a really good thing for me.

First off I translated Manufacturers and Distributors to Publisher and Book Series.

I then used the Location field for the ISBN number and by leaving this field empty for other items I can determine if a item is a book or not (for books without ISBN I just put "none" in the field.

I put the info in the same block as the Authors, like this
(continued from last post's chunk of code, in themes/product.tpl)

{if $product->manufacturer_name}
<div id="short_description_content" class="rte align_justify">
{if $product->location}
{l s='Publisher'}:
<a href="{$link->getmanufacturerLink($product->id_manufacturer, $product->link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List books from'} {$product->manufacturer_name|escape:'htmlall':'UTF-8'}">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</a>
{l s='Manufacturer'}:
<a href="{$link->getmanufacture
rLink($product->id_manufacturer, $product->link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List items made by'} {$product->manufacturer_name|escape:'htmlall':'UTF-8'}">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</a>

As you may see in the code above, I later realized that I could use Manufacturers for their "real" use when not dealing with books.

{if $product->supplier_name}
<div id="short_description_content" class="rte align_justify">
{l s='Supplier'}:
<a href="{$link->getsupplierLink($product->id_supplier, $product->link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List books in the series'} {$product->supplier_name|escape:'htmlall':'UTF-8'}">
{if $product->location != ''}
<div id="short_description_content"
class="rte align_justify">
{l s='ISBN'}: {$product->location}
{if $product->ean13 != ''}
<div id="short_description_content" class="rte align_justify">
{l s='EAN'}: {$product->ean13}

And last in the block I put the ISBN and/or EAN, which tends to be the same thing for most books (but not always) so I just figured why not. More information than one needs is better than less information than one wants...

Then I modified the settings in the Manufacturers and Distributors Blocks in the Admin part of Prestashop to not use plain text but a drop-down list.

I also did some more translations so it says "Select Series" etc.

In the future I'd like to split up the Distributors Block in two so that one is for Publishers and one for Manufacturors, but right now they are mixed together.

This is how the product view looks for a book after the modifications.

and this is how it looks for a non-book.

No comments:

Post a Comment