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 401 to 420 of 427
1 May 2018, 2:05 PM
#401
philou avatar

philou

Zen Follower

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

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

Hi mesnitu,

nice to hear from you. I have just put BookX on Github. It is my first project on Github, so if I missed something, let me know :)

https://github.com/philoupin/bookx

Please note the "README Installation", as it explains the option to create symbolic links instead of copying all the files into your Zen cart installation.

Best regards,
P.

1 May 2018, 2:16 PM
#402
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

Beautiful! :cheers:
Thanks!
Never used symbolic links, have to check how it works on windows.
Either way, now it rocks !

Best Regards!

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

24 Aug 2018, 1:32 PM
#403
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

This box is not required. I have found what I was asking

Learning Fast.
Eden Craft Supplies

3 Feb 2019, 3:42 PM
#404
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

I cannot get this to work. I have installed as per instructions and even if the docs say to merge at the template being used I have done to the same to default template. Currently using v1.5.5f and when I go to add a new product there is nothing on the page so that I can add authors etc. The Am I missing something? There are a couple of other thing that do not look correct.

I am going to change nothing so that you can have a look at the 'live' site. cert uk

Learning Fast.
Eden Craft Supplies

3 Feb 2019, 3:59 PM
#405
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

You must add authors , genres, etc .. first in menu->extras

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

3 Feb 2019, 4:17 PM
#406
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

I've made a sub-module for ep4 that deals with importing books related fields by csv.
I'm using it ( live ), using zc155f also. This way, you can import and create all that data.
However, I'm in the middle of a update for bookx module for zc156 ( unofficial ) since the main module will be the Phillou version.
For that, I have to review the import module also, since there are some stuff that I incorporated in this update.
If you try that, and get some errors, post them in git.

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

3 Feb 2019, 4:25 PM
#407
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

mesnitu:

You must add authors , genres, etc .. first in menu->extras

Just done that. The "Show Author only of type:" has a double entry. This happened the last time I used this plugin, I thought it was me. Add new product still does not display Authors etc. I will have another look around to see why they are not display, but I suspect something is not linking to the new product page under ADMIN

Learning Fast.
Eden Craft Supplies

3 Feb 2019, 4:33 PM
#408
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

The "Show Author only of type:" has a double entry.
For authors, you have author_types ( author, illustrator, etc) and authors ( author name)

I guess that's what you're seeing as double ?

Do you select Products - Bookx when inserting a new product ?

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

3 Feb 2019, 4:42 PM
#409
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

mesnitu:

For authors, you have author_types ( author, illustrator, etc) and authors ( author name)

I guess that's what you're seeing as double ?

Do you select Products - Bookx when inserting a new product ?

I did say I was missing something. I did not do Product - bookx. My bad. Double entry may do when I do things right

Learning Fast.
Eden Craft Supplies

3 Feb 2019, 4:47 PM
#410
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

And if you check your product type (bookx) layout settings, you adjust what filters you want to display.
So even if you have authors_types, you are not force to display them in bookx filter sidebox ( etc, etc )

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

5 Feb 2019, 2:47 PM
#411
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

This is a very good plugin. I have installed it as I am going to start selling e-books, so, several of the drop downs will be changed. you have answered the question I had before I ask it. Did you build this?

Learning Fast.
Eden Craft Supplies

5 Feb 2019, 2:50 PM
#412
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

No, Phillou did.
But I use it heavily ( with some changes)

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

5 Feb 2019, 3:06 PM
#413
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

Forgot to ask; does this work with v1.5.6a?

Learning Fast.
Eden Craft Supplies

5 Feb 2019, 3:16 PM
#414
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

Nope. I'm working on a update to 156. I don't know the intentions of Phillou, but meanwhile I'm doing it and adding some features that I use in the bookstore that I work.
However, probably is not going to work with zc155 ( I think it will, but still not sure).

Those changes are being made in git. You are welcome to test them ( knowing that it's still in development), so if you need to have your site online yesterday, probably is best to stay with 155.
The admin installation / update is more or less ready ( to test further).
But unfortunately I'll have to updated ep4bookx also, and CEON url rewrite ( that I have with this module).
So I guess, I'm a bit demoralized.

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

5 Feb 2019, 3:52 PM
#415
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

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

mesnitu:

Nope. I'm working on a update to 156. I don't know the intentions of Phillou, but meanwhile I'm doing it and adding some features that I use in the bookstore that I work.
However, probably is not going to work with zc155 ( I think it will, but still not sure).

Those changes are being made in git. You are welcome to test them ( knowing that it's still in development), so if you need to have your site online yesterday, probably is best to stay with 155.
The admin installation / update is more or less ready ( to test further).
But unfortunately I'll have to updated ep4bookx also, and CEON url rewrite ( that I have with this module).
So I guess, I'm a bit demoralized.
I can help you for the next couple of days. checkout my dev branch on GitHub for updates, and I will be making PRs

5 Feb 2019, 4:52 PM
#416
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

Well, that would be nice :bigups:
I already did a lot of stuff, but mainly the final purpose is:

The installation ( more or less already made):
Adds "native" support for CEON ( optional)
This generates a clean url for authors, genres, etc... ( for the first filter only ). However it depends on CEON update for zc156
I have this code made, but not yet in git.
Adds dynamic metatags ( optional )
Basically it gets the authors, genres, etc information, and adds to the <meta> tags ( when filtering), using canonical.
It also can build metainfo on products page IF metatags are not defined ( zencart way). This is because, honestly I will never, never, edit thousand of metatags manually.
Adds support for utf8mb4
replicating the zc156 installation.

**Adds a way to check git releases **on bookx, EP4, and epbookx ( still need to check if it's a good idea)

Adds a new table for books families:
Families can have multiple publishers.
Adds a new table for book search
I reduce the search time this way
On the installation, some changes are made to some indexes.

**Families: **They are imported from a csv file.
The main idea, is not to have another extra field, but to apply discounts based on families.
A example: A publisher released a new book. By law ( at least here in Portugal), one can't apply a discount greater than 10% over a period of time.
This could be done using the publishing date.
However, the bookstore may also have acquired some older books from the same publisher, ( the publisher does not control them anymore) that are now theirs. So they can apply a bigger discount.
This is useful, when importing with EP4 , since it apply's the discounts on the fly, but it can be made on inserting a product.
So in sum, one exports families from a software ( like sage) and imports to bookx_families.
Families can also have a "flag" to always have a online stock.
Even if a product belongs to a families, one can flag a product to ignore that discount. ( still needs review, because on import using ep4bookx, it will overwrite that "flag")

Authors:
One can now import a image from a url
The same for products ( not yet done)
I think this are the more important.

Made a lot of changes to use bootstrap and fit into the zencart design:
On authors, and products.

To be done:
Support the German language ( I think they use a different zencart version with a language table ), but I need to add the same changes to the configuration table
Review the front-store.
Add authors, genres, etc, directly on products page. ( right now, they must be created first), this is very useful when editing on admin.

I think the functions could be a file, and not separated by admin vs front-store, since some are very useful in front-store also

And some other minor stuff.

I'm stuck on the main observer, because the observer (on prodcut listing), try's to catch the css button to overwrite them with bookx_button.
However this is very fragile, because layouts can change... ok...right... I'm not on my machine right now. Latter I'll post a code example.

Well, that's the main idea. A lot was made.

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

5 Feb 2019, 4:56 PM
#417
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

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

Great, Maybe you can post these as issues on github, in the repo, so we can check them when work progresses

mesnitu:

Well, that would be nice :bigups:
I already did a lot of stuff, but mainly the final purpose is:

The installation ( more or less already made):
Adds "native" support for CEON ( optional)
This generates a clean url for authors, genres, etc... ( for the first filter only ). However it depends on CEON update for zc156
I have this code made, but not yet in git.
Adds dynamic metatags ( optional )
Basically it gets the authors, genres, etc information, and adds to the <meta> tags ( when filtering), using canonical.
It also can build metainfo on products page IF metatags are not defined ( zencart way). This is because, honestly I will never, never, edit thousand of metatags manually.
Adds support for utf8mb4
replicating the zc156 installation.

**Adds a way to check git releases **on bookx, EP4, and epbookx ( still need to check if it's a good idea)

Adds a new table for books families:
Families can have multiple publishers.
Adds a new table for book search
I reduce the search time this way
On the installation, some changes are made to some indexes.

**Families: **They are imported from a csv file.
The main idea, is not to have another extra field, but to apply discounts based on families.
A example: A publisher released a new book. By law ( at least here in Portugal), one can't apply a discount greater than 10% over a period of time.
This could be done using the publishing date.
However, the bookstore may also have acquired some older books from the same publisher, ( the publisher does not control them anymore) that are now theirs. So they can apply a bigger discount.
This is useful, when importing with EP4 , since it apply's the discounts on the fly, but it can be made on inserting a product.
So in sum, one exports families from a software ( like sage) and imports to bookx_families.
Families can also have a "flag" to always have a online stock.
Even if a product belongs to a families, one can flag a product to ignore that discount. ( still needs review, because on import using ep4bookx, it will overwrite that "flag")

Authors:
One can now import a image from a url
The same for products ( not yet done)
I think this are the more important.

Made a lot of changes to use bootstrap and fit into the zencart design:
On authors, and products.

To be done:
Support the German language ( I think they use a different zencart version with a language table ), but I need to add the same changes to the configuration table
Review the front-store.
Add authors, genres, etc, directly on products page. ( right now, they must be created first), this is very useful when editing on admin.

I think the functions could be a file, and not separated by admin vs front-store, since some are very useful in front-store also

And some other minor stuff.

I'm stuck on the main observer, because the observer (on prodcut listing), try's to catch the css button to overwrite them with bookx_button.
However this is very fragile, because layouts can change... ok...right... I'm not on my machine right now. Latter I'll post a code example.

Well, that's the main idea. A lot was made.

5 Feb 2019, 10:18 PM
#418
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

I will wait for this to work. My site is in a bit of a rush, however, I am having issues with the installation of v1.5.5f.

Learning Fast.
Eden Craft Supplies

6 Feb 2019, 11:30 AM
#419
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

adb34:

I will wait for this to work. My site is in a bit of a rush, however, I am having issues with the installation of v1.5.5f.

The installation of zc or the bookx module in zc ?

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

8 Mar 2019, 11:24 PM
#420
pititis avatar

pititis

New Zenner

Join Date:
Oct 2010
Location:
Andalucía
Posts:
15
Plugin Contributions:
0

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

Hello,

I'm unable to use simple or advanced_search. I have more than 100K books. It takes forever (and 100% CPU.) Server here is a new Xeon with 8 Gb Ram and SSD disk

Commenting the lines $extra_from and $extra_where in the function insert_book_attributes_into_search_query fix the issue (obviously) returning the search queries in no more than 1.4-1.6 seconds (0.5 when cached)

Sorry I'm not a mysql guy. Any clue please?

Cheers