Forums / Setting Up Categories, Products, Attributes / Creating an add-on "product type book" for ZC 1.5

Creating an add-on "product type book" for ZC 1.5

Views: 111,142

Results 381 to 400 of 427
30 May 2016, 9:34 AM
#381
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Creating an add-on "product type book" for ZC 1.5

Hi
Any idea how one could use image handler on authors images, etc.... in the filters result ?
In products info page, it's ok... on all authors etc page....haven't check.
But on the filters no.
This is probably a no man's land question, it's related with image handler thread , but I guess then they'll say, they dont' know about bookx product type....

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

30 May 2016, 9:55 AM
#383
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Thanks
I think I sorted it out :

Actually this constants (?) , were getting no values.

zen_image(DIR_WS_IMAGES . $author->fields['author_image'], $author->fields['author_name'], BOOKX_AUTHOR_IMAGE_WIDTH, BOOKX_AUTHOR_IMAGE_MAX_HEIGHT)

So I've tested with the ones from the main image, and now Image Handler is controlling the images.
zen_image(DIR_WS_IMAGES . $author->fields['author_image'], $author->fields['author_name'], MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT)

... still got to see, if the reason was because there were no values or if I have to change this extra images width / heights on bookx configs to get IH to work on all them.

Anyway, getting closer.
Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

3 Jun 2016, 6:40 PM
#384
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi
Getting real hard time to have the authors description with the proper html. ( ON the admin side )

I'm using ckeditor. On products page, all html is render quite right, but when editing a author, I get a lot of this :

<p><p>&lt;p&gt;&amp;lt;p&amp;gt;Sed aliquam ultrices mauris. Sed fringilla mauris sit amet nibh.

On the books_authors, in case new:

      	$author_description_textarea .= '<br>' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_textarea_field('author_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '15', '' );
	}
/*  zen_draw_textarea_field('author_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars(bookx_get_author_description($aInfo->bookx_author_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE));
*/

But I've tried to do with the htmlspecialchars, but getting no good results.
I see that this is using a fucion to get the authors description. But on post , I haven't find out, how this works....

I've tried seeing the $_POST....

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

3 Jun 2016, 7:02 PM
#385
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Narrowing down a bit , the insert is ok, but editing, the ckeditor gets all the html tags, so on save, gets wrong......

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

3 Jun 2016, 10:12 PM
#386
jrgoold avatar

jrgoold

New Zenner

Join Date:
May 2016
Location:
St. John's NL Canada
Posts:
32
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

I only just stumbled on your thread (I've only just started using the forums again).

For what it is worth, I support a heavily modified version of Zen Cart used by a publisher who sells e-books (and some “interactive books”, i.e. software). The publisher produces print versions of books as well, but that has its own website and the books are also sold through book stores (including Amazon).

I was involved in modifying ZC back at 1.3.9h and recently upgraded the site to 1.5.4 (and am working on 1.5.5a). Just some comments based on what we (and I) did. I skimmed the first page of this thread and then jumped to the last page, so I'm not certain what has been discussed in the interim. If any of what I'm about to say duplicates that, sorry!

  1. I did not see any mention of ISBN numbers. Support for ISBN numbers is mandatory if you are serious about a book type.

  2. We extended the "manufacturer", which in our case is an author (not the actual company running printing presses). One needs to support multiple authors for a book — many books have more than one author (especially the genre published by my client). As well, there are other people who contribute to a book (who may be authors in their own right), such as illustrators, editors, writer of a forward… I chose to treat these different roles as "types of authors".

  3. If, in addition to print books, you deal with e-books (PDFs, ePUB, .MOBI…), then you may need to deal with the associated download files. Different formats of the same book each has its own ISBN number. You need to be careful with e-books because it is easy for them to be pirated.

  4. You may wish to extend the concept of "reviews". Out of the box, ZC supports customer reviews, but books are often reviewed in the press and you may want to include those reviews on your site. Also, you may have another author who reviews a book, but not on your site as a "customer" (reviewers will usually get a complimentary copy) and you have to deal with entering that review on your site.

  5. Similarly, if any of the books you publish win awards, you may want to introduce the concept of "awards".

Any way, good luck with your endeavours. ...John

4 Jun 2016, 5:32 AM
#387
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

mesnitu:

Narrowing down a bit , the insert is ok, but editing, the ckeditor gets all the html tags, so on save, gets wrong......

Removing the htmlspecialchars() from the case: 'edit' , made things work....not sure if it's good or not.

This is probably related to http://docs.zen-cart.com/Developer_Documentation/v1.5.5/code_docs/admin_sanitization (?)

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 6:10 AM
#388
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

JRGoold:

  1. I did not see any mention of ISBN numbers. Support for ISBN numbers is mandatory if you are serious about a book type.

Hi
I'm using bookx module for a while, so I can talk about the experience as a user, but in terms of isbn, it's there. It actually formats the isbn in a proper way.

Multiple authors, multiple genres, condition, imprint, publisher, cover, sizes, subtitle, team authors, author types, images and description for all that ... etc, etc, all there.
A lot of configs, on what to present on product listings or product info page.

Genres acts like tags, so the shop I work , I've started to use the genres as categories, so categorie A = Genre A, but now, some times I add more "tags" to genres.
The manufactures... in this case, I use them equal as publishers.

Rewards and reviews... there's no specific field for that.... I usually add them to the book description.

But, out of the box, ( I didn't do it ), for example, I don't use imprints fields. I guess one could change the name, and use it as a rewards fields...not fancy, but I think it would work.
Or one could use the genre "tag" for rewards, and with that genre ID one could sideboxes, centerboxes, etc...

I've made some changes to the module, so that the book filter result could have metatags and schema markup. So I think it getting nice for search engines ( I think )

A part from the rewards or reviews, one thing that I'll do, it's a authors quotes. I like books, and I like quotes, and I like that "fortune cookie" on the site displaying quotes.

Also, there's a git plugin for EP4, that one can use to import all this fields in a csv file. It's working 98 % .
Actually on that import file, without a ISBN, you can't import.

It's probable that bookx module goes to git soon, so I guess one could help to improve it.

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 3:08 PM
#389
jrgoold avatar

jrgoold

New Zenner

Join Date:
May 2016
Location:
St. John's NL Canada
Posts:
32
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

I had a quick glance back to the beginning of the thread. There was mention of using the “model” for ISBN. That could be made to work.

The problem I had when I got involved in the project was the client already had a Zen Cart site up and running. They had actually used the model column for the ISBN number, but it wasn't consistent. They still had remnants of the sample products in the database and, for some products, they had put stuff other than the ISBN number into the model column (I think free downloads were one of the ones with funny stuff in there).

Assuming it is doable, I would advise people who decide to use Zen Cart to start their “real” store with a database that has no sample stuff in it (and definitely not the music product type, etc.).

Keep the sample stuff for learning about Zen Cart — I'm sure that is what it was intended for anyway.

By the way, do you (did you) do anything special to deal with 10 versus 13 digit ISBNs?

4 Jun 2016, 3:18 PM
#390
jrgoold avatar

jrgoold

New Zenner

Join Date:
May 2016
Location:
St. John's NL Canada
Posts:
32
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

I forgot, in my last post, to mention that the ISBN column I added to the products table referred to the print edition of the book; I also added an ISBN column (actually “isbn” in both cases) to the products_attributes table to associate the appropriate ISBN with each of the e-book versions.

4 Jun 2016, 4:53 PM
#391
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

JRGoold:

I forgot, in my last post, to mention that the ISBN column I added to the products table referred to the print edition of the book; I also added an ISBN column (actually “isbn” in both cases) to the products_attributes table to associate the appropriate ISBN with each of the e-book versions.

Well, I'm talking about my experience.
I already had isbn as the model... the was a lucky start , before i even knew bookx.
At first that I had no csv to import the book fields, I've manged by excel, to make the comparison and enter the "model" to isbn field.
And I actually had a lot information, stored in metatags, so it was a matter of insert them too.
But it was a very risky process.
Now with the csv , I re-uploaded with the correct model ( the company internal code ) and isbn, etc, etc...

About the 10 digits... that's something that only Philou can reply.
Haven't seen no config for the isbn digits, so this is the isbn out of the box: 978-9-898839-84-8

I personally think this is quite a great module. Philou had a huge amount of work in it, now that I know the backs and forwards of this code.
Not much like this for free around for bookshops.

And it's made in Germany , so quite good :)

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 6:57 PM
#392
jrgoold avatar

jrgoold

New Zenner

Join Date:
May 2016
Location:
St. John's NL Canada
Posts:
32
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Germany :smile:

Here are a couple of links if you are interested in more about ISBNs, including how they should be formatted:

For the official specification: http://www.morovia.com/kb/EAN13-Specification-10633.html
For converting from 10-digit ISBNs: http://www.isbn-13.info/

Unfortunately, my link for generating or testing the check-digit doesn't work any more :(

Found it on one of the above pages: http://www.morovia.com/education/utility/upc-ean.asp

15 Jun 2016, 9:52 AM
#393
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi
Well, I'm not sure why the products url is altered on book info page, but the I use it for some book pdf preview.

But there´s a change in the redirect page on zencart 155.
The action url is not there anymore, as it was on 151.

So the link ends up in the main page again.

There's a notifier that can be use to re-add the action url.

case 'url':
if (isset($_GET['goto']) && zen_not_null($_GET['goto'])) {
zen_redirect('http://' . $_GET['goto']);
}
break;

I think this was the purpose of the products url on the bookx module.

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

15 Jun 2016, 9:57 AM
#394
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Can't edit the last post.

As I'm using another observer, haven't place the code here, so perhaps this can be added to another module release.
But for anyone that misses this, while there's no fix to this, basically one can add that piece of code in includes/modules/pages/redirect.php

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

15 Jun 2016, 10:06 PM
#395
jrgoold avatar

jrgoold

New Zenner

Join Date:
May 2016
Location:
St. John's NL Canada
Posts:
32
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

mesnitu:

Hi
Well, I'm not sure why the products url is altered on book info page, but the I use it for some book pdf preview.

But there´s a change in the redirect page on zencart 155.
The action url is not there anymore, as it was on 151.

I believe that, because of security concerns, the “action” value has become a POST variable (i.e. set by a <form>) and hence not visible as part of the URL (which are GET variables). You should still be able to test it by checking $_POST (after going through the “sanitizer”, they are essentially re-POSTed).

16 Jun 2016, 7:40 AM
#396
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi
Using the products url as a external link, probably one doesn't even have to go through the redirect page... Looking at the code, it seems this redirect page is used to count the clicks.
But one could have other uses for this link, and that's probably why the code is similar to the general product.
But once you go to the redirect page, that action must be there. ... I guess.

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

16 Oct 2016, 11:43 AM
#397
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi

With version 155 , in the new products module , there was that issue about the $new_products->Move(0); etc.. , that we've talk about.

The issue is that is not respecting the query limits, so it would display all the results.
Further more, the while (!$new_products->EOF) { , didn't work, since the EOF is 1 on the notifier

If made this changes, and I think it's working.
Also note the MoveNextRandom(); ,

//$new_products->Move(0);
//$new_products->cursor = 0;
// don't understand why this is necessary, but without it shows the first entry twice ?!
//$new_products->MoveNext();
// eof ?!!?
$cursor = $new_products->cursor;
$new_products->cursor = 0;

$row = 0;
$col = 0;
               
while ( $new_products->cursor < $cursor) {
etc, etc.....
$new_products->MoveNextRandom();
}

If this the right way to do it .... don't know, but it's working
So this is at includes\classes\observers\class.bookx_observers.php, related to function insert_bookx_attributes_into_new_products_listing

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

16 Oct 2016, 2:08 PM
#398
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

After all it was fixing the results limit but still was duplicating a book entry

uncomment the **$new_products->Move(0); **seens to fix it

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

17 Oct 2016, 4:49 PM
#399
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

Hi mesnitu,

thanks for sharing that. I am testing BookX with 1.5.5 in these days and will re-examine that issue. As I already wrote in the comments, i wasn't very have with my cursor movement to begin with :)

Best regards,
P.

1 May 2018, 9:24 AM
#400
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi Philou

A old question:
Is it possible to put Bookx on Git ? I'm still working on this changing bits here and there, but I'll must go deeper and have some consistence.
I was about to put bookx on bitbucket as a private repository, but at the light of opensource, it makes more sense to be open.
If you can, please put this on git, or if you don't have the time, give me the permission to put it myself and attribute the project to you ( I believe there is a way to do that).

That way I could fork the project and go my own way.
ie: I would like to convert DB to use InnoBD with foreign keys and make some other changes that must be made to work with php7 and mysql 5.7, etc..

Let me know your thoughts.

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison