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,146

Results 261 to 280 of 427
23 Jun 2015, 3:54 AM
#261
dw08gm avatar

dw08gm

Totally Zenned

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

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

I see what you are saying, although I wonder whether some of the filters could be replaced by onscreen sorting - a bit like asc/desc anchors in some (mostly admin) pages. From my perspective as a user, I prefer being able to sort results found before refining or conducting a new search.

FWIW I was looking at this mod to see if could do something else, equally complex, only to be stumped by the code. I anticipate having another look at the inner workings in the not too distant future, when I am closer to resolving what I want to do

23 Jun 2015, 1:46 PM
#262
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

Hope the BookX mod will be helpful to what you are planning to develop.

Best regards,
p.

26 Jul 2015, 2:31 PM
#263
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
By the way Philou, still no idea when a csv import for this module comes alive :smile: ?

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

26 Jul 2015, 8:15 PM
#264
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

Hey mesnitu,

nice to hear from you :)
The CSV import is not really a big priority I'm afraid, especially since all the attributes which have user defined entries (i.e. anything "BookX" under the "Extras" menu, like conditions, authors, series etc.) could not easily be assigned via CSV. So the only values which could be assigned via CSV import would be ISBN, number of pages, publishing date.

Workaround: If you use another zen cart CSV import tool to import books as general products first, then you can pick and choose which of these to convert to "BookX" type in the "Tools" Menu "BookX Tools". That should get you most of the way a BookX CSV import could take you. If you are comfortable with MySQL you can export the table "product_bookx_extra" and add the pages, volume, isbn etc and load the table back in. If you only add info to existing entries that should work without any problems.

Sorry I can't announce a solution to this, but in fact it is not a problem that can satisfactorily be solved ...

Best regards,
p.

27 Jul 2015, 9:16 AM
#265
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
Yes, I already did that once, but it was for all the products. Not a easy process for every time one need to upload 50 or 100 products (for all the fields). I mentioned this, because of the comments about the tables and all the joins.
I was making one, base on EP (they have a import for music products), but I had to stop, cause another site come around, but I'm nearly finishing it.
I'll give it a go, but I guess if you said that it can not easily be assigned via csv, probably i'll stuck.
For me, the author, publisher, genre, pages, isbn, date and book cover, fulfill my needs.
Let's see what happens.

Best regards

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

27 Jul 2015, 9:29 AM
#266
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,

author, publisher and genre are the problems, because they link to another table. You have discovered that you can assign a genre / author / publisher to multiple bookx products at once from the form where you enter author etc. info under EXTRAS menu, yes?

Best regards,
Philipp

27 Jul 2015, 4:10 PM
#267
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

philou:

Hi mesnitu,
You have discovered that you can assign a genre / author / publisher to multiple bookx products at once from the form where you enter author etc. info under EXTRAS menu, yes?

Yes, but not sure what if I follow what you mean... As I remember the music products also work with different tables, record companies, etc... but the association is simpler then bookx.
For a complete csv import, with all the user choices, etc, it's complicated.
Have you ever seen Easy Populate ?
Do you think this is a impossible mission ?
All I was doing was "study" bookx query's and try to adapt at EP... but if you find it hard to do it.... my mojo is low now :)
Any way in a couple of week I'll update zencart to 154, and I'll dig into it a bit more. If I can't achieve the quest, well.....the world will survive :)

Best regards

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

27 Jul 2015, 4:38 PM
#268
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

Dear mesnitu,

I'm not so familiar with the music type, but the main problem is this: you have a table of (user defined) authors A, B and C. They have IDs 1, 2, 3 in their table "bookx_authors". Now in your CSV file you would need to know the ID of the author of the book, so that the import script can link the book to the correct author. The same is true for series, publishers etc. How will you know all these numercial IDs ?

Matching by name of the author or series is theoretically possible, but your spelling would have to be 100% identical to the spelling in the database. Not impossible but the work needed to make that import solution work is really a lot and it is not the main focus of this add-on... :)

Regards,
p.

29 Jul 2015, 3:21 PM
#269
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
But aren't the query's similar to the ones that display the book info on the site ?
Your mention some (user define tables), I'm not sure what that is (I use bookx with not much customization on the config side), but I guess it's require to match or join 3 tables, the extra, the authors id and the authors name. EP uses a "^" for multiple categories. In this case, it's to adapt to multiple genres and authors. Something like Author1^Author2.

ps: By the way, I'm updating to 154. Is the latest Bookx working with this version, and is the latest version of bookx in the same place or in zencart site ?

Thanks
Best regards

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

29 Jul 2015, 4:01 PM
#270
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,

I cannot verify right now that BookX works with 1.5.4 but I don't see what would break it, since not much seems to have changed in the core functionality.
I went through great efforts to make BookX as independent of core changes/updates as possible, so hopefully that pays off now :)

Back to your question of import:
It is quite easy to assemble a query from multiple tables for data already in the DB, like "get me all genres assigned to a book with ID 3". But the query "insert a book and link it to multiple genres" is not so easy, because the user (you!) have to tell the import script which genres you mean. But the database thinks in terms of "genre with ID #34" and not "genre called 'crime novels' ". So when you import via CSV, you have to create an entry like this

bookx title ---- ISBN ---- author ID --- author ID --- genre ID ---- Series ID
War&Peace ---- 978-1-234567-89-0 ----- 324 ---- 76 ---- 12 ---- 32

How will you know what ID all the authors have and the genres etc?

You could try to have the script look up the genres and the series based on their naming, but if you only make one spelling mistake there will be no match. So you import 100 books and on five there will no match of author. Have you misspelled the author? Does the author not exist in the DB? The same about genre, series etc etc.

So of course this is possible, but to do it "right" it is a very complex logic.

I hope I could explain it well :)
p.

29 Jul 2015, 4:48 PM
#271
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
Can you please say something positive ? :D

I think I see what you mean. I've finish a site made in Drupal for a book distributor (no shop). But with feed importer, and all the extras fields and mappings, it's quite easy to import the products, But , there's always that problem, specialty in Portuguese, where there is a lot of accents. So the author "João" is different from "Joao", or "joao" or " joao" (a empty space).
Something for Genres or Publishers.

I don't know how the core of csv imports works, but I guess, if no ID or matching string is found, new ones are created.
If one imports 100 books, and has to rectify 20, it's always easier (not to mentioned competitive ) .
Or simply restore a backup, and redo to match the corresponding author, genres, etc ,names and upload again.

But yeah, this is probably very complex for my knowledge, but looking at EP, it looks "simple". But I guess I'm wrong.

Best regards

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

29 Jul 2015, 5:01 PM
#272
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

do you import 100 books with 100 authors, or maye 100 books with 20 authors?

If you want to hear seomthing positive, then I think you will find that importing books as "normal" products, conevrting them to bookx and then mass assign genre, authors, series you will find it takes less time and is less headache than trying to work out duplicates and missing matches :)

best,
p.

29 Jul 2015, 5:06 PM
#273
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

But how do you mass assign that ? Exporting tables and working with excel ? Or do you have another technique?

Best Regards

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

29 Jul 2015, 5:09 PM
#274
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

Let me quote from the README file :)

NEW IN 0.9.4: Assign & remove Author / Publisher / Series / Genre / Imprint to multiple books at once

Linking a book to authors / series / imprint / publisher / genres
You can link a product you are editing to any author / series / imprint / publisher / genre via their respective popups, but there may be situations where you would like to quickly assign e.g. a new genre to multiple books at once. This can be done by selecting the author / series / imprint / publisher / genre via ADMIN -> Extras -> BookX: Genres -> Genre. At the bottom of the edit screen there are two "multi-select" fields, where you can choose multiple books and assign the current genre. Inversely, you can use the bottom field to remove the assignment of the genre from multiple books at once.

29 Jul 2015, 5:17 PM
#275
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

Yes, when everything else fails read the instructions :)

I've seen that, but honestly I haven't use it that much. I'll try to see if it suits the needs of this site.

Thanks

Best Regards

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

29 Jul 2015, 6:06 PM
#276
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 again
Just an aside : I was rechecking what I've done about 4 or 5 months ago, cause as I said, I've been in drupal, and now it's a little puzzling to remember zencart way again, but I quite made the export part, and I didn't remember.
Works as the Music products does, so if bookx is active (by the user), products type 6 are exported and adds the bookx fields. For now i have

v_bookx_genre | v_bookx_isbn | v_bookx_size v_bookx_volume v_bookx_pages v_bookx_publishing_date v_bookx_publisher v_bookx_series v_bookx_binding v_bookx_printing v_bookx_condition v_bookx_author

successfully exported (as you said, the easy part)
Now, EP, uses the model as unique. In my case I use isbn as model too, but I guess it makes no difference
I've check the categories and it's more or less like genres. A categories_description and categories tables. If EP handles this quite well, it must handle the genres too.
So I give it a go.
And meanwhile, work with that featured that you mentioned.

Thanks
Best Regards

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

8 Aug 2015, 7:10 PM
#277
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

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

Using zencart version 1.54 and latest version of this plugin. Installed per instructions, checked 3 times. When I goto: mysite/myadmin/index.php?action=bookx_install I get a file not found error. I do not have a bookx_install file. Is this the problem????? Seems all information is in the admin.. Get same results if I try to run the install from the BookX Installation and Tools menu in the admin/tools?????? Also noticed I do not have a tpl_modules_whats_new.php file?

Please help!

8 Aug 2015, 7:22 PM
#278
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

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

fjbern1943:

Using zencart version 1.54 and latest version of this plugin. Installed per instructions, checked 3 times. When I goto: mysite/myadmin/index.php?action=bookx_install I get a file not found error. I do not have a bookx_install file. Is this the problem????? Seems all information is in the admin.. Get same results if I try to run the install from the BookX Installation and Tools menu in the admin/tools?????? Also noticed I do not have a tpl_modules_whats_new.php file?

Please help!

Here is the error log:

[08-Aug-2015 13:08:20 America/Chicago] PHP Fatal error: 1146:Table 'christi_storefront.product_bookx_extra' doesn't exist :: select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_description, CONCAT_WS(""
,pd.products_name
,IF(NULLIF(be.volume, "") IS NOT NULL, CONCAT_WS("", " <span class='bookxProdVolume'>", REPLACE("vol. %s", "%s", be.volume), "</span>"), "")
,IF(NULLIF(bed.products_subtitle, "") IS NOT NULL, CONCAT_WS("", " – <span class='bookxProdSubtitle'>", bed.products_subtitle, "</span>"), "")
) AS products_name,
p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description from products p, products_description pd
LEFT JOIN product_bookx_extra be ON be.products_id = pd.products_id AND (be.publishing_date IS NOT NULL) AND (DATEDIFF("2015-08-08",
CONCAT_WS("-",
SUBSTRING(be.publishing_date, 1,4 ),
IF(SUBSTRING(be.publishing_date, 6,2 ) = "00", "01", SUBSTRING(be.publishing_date, 6,2 ) ),
IF(SUBSTRING(be.publishing_date, 9,2 ) = "00", "01", SUBSTRING(be.publishing_date, 9,2 ))))
< 0) LEFT JOIN product_bookx_extra_description bed ON bed.products_id = pd.products_id AND bed.languages_id = "1" where p.products_id = pd.products_id
and pd.language_id = '1'
and p.products_status = 1
and p.products_id in (498, 502, 1304, 1305, 3764) AND (be.publishing_date IS NOT NULL) AND p.products_quantity > 0 ORDER BY be.publishing_date DESC, p.products_date_available DESC ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/includes/modules/responsive_sheffield_blue/new_products.php on line 54 <== in /hsphere/local/home/christianstore/christianstore.biz/includes/classes/db/mysql/query_factory.php on line 155

8 Aug 2015, 8:29 PM
#279
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

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

When you run the install from the admin or from the URL, what is the exact error? Does it tell you which file is not found? The install is not a file itself, it is built into the admin.

8 Aug 2015, 10:16 PM
#280
fjbern1943 avatar

fjbern1943

Zen Follower

Join Date:
Apr 2015
Location:
United States
Posts:
144
Plugin Contributions:
0

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

lruskauff:

When you run the install from the admin or from the URL, what is the exact error? Does it tell you which file is not found? The install is not a file itself, it is built into the admin.

Here is the error message:
HTTP 500 error

That's odd... Microsoft Edge can’t find this page

This page can’t be displayed, because this site’s server might be under maintenance or there could be a programming error.

Using chrome I get this error:
WARNING: An Error occurred, please refresh the page and try again. Did you see the error Log info I posted?