Forums / Setting Up Categories, Products, Attributes / Product Type Book (by moku)

Product Type Book (by moku)

Started by moku on 12 May 2006, 6:37 AM · Views: 203,732

Results 361 to 380 of 647
14 Feb 2008, 1:42 AM
#361
elastic avatar

elastic

New Zenner

Join Date:
Dec 2007
Location:
New Jersey
Posts:
76
Plugin Contributions:
0

Product Type Book (by moku)

i have started a new product type, based on the book. i understand how the filtering system is used, but have a quick question about adding a text based search.

I have several fields which are in the product_XXXX_extra table, and I would like to be able to add all of these fields to the search so that I can

  1. get results when typing in the general search. i don't want a drop down, I want to type any combination of keywords, and search:
    a. the basic product table
    b. the product description table
    c. the new product_XXX_Extras table and all the fields in it ***

I also want to extend this search capacity to:

  1. get results when I do a more advanced search

so i am guessing i need to create an override for the includes/modules/pages/pages/advanced_search_result/header_php.php

any suggestions?

hmmn. really?

14 Feb 2008, 8:35 AM
#362
gsis avatar

gsis

Zen Follower

Join Date:
Jun 2007
Posts:
140
Plugin Contributions:
0

Re: Product Type Book (by moku)

Many thanks to SteveCollins for reporting this problem to me. It is appreciated.

In the book search boxes (Authors and Subjects - Publishers is ok for now) I'm seeing the following problem. If you filter by author or subject then click on 'reset' you get the following message (this one from 'authors'):

2008 MySQL client ran out of memory
in:
[select p.products_id, p.products_type, a.book_authors_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order from swift_products_description pd, swift_products p, swift_book_authors a, swift_book_authors_info ad, swift_books_to_authors bta, swift_product_book_extra pme, swift_products_to_categories p2c left join swift_specials s on p2c.products_id = s.products_id where p.products_status = 1 and p.products_id = p2c.products_id and pme.products_id = p.products_id and p.products_id = pd.products_id and a.book_authors_id = ad.book_authors_id and a.book_authors_id = bta.book_authors_id and ad.language_id = '1' and pd.language_id = '1']

2013 Lost connection to MySQL server during query
in:
[select count(*) as total from swift_sessions where sesskey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']Taking the first query and running it via phpMyAdmin returns 27,054,450 rows. Perhaps it's missing a join somewhere, or is my database missing an index or two? :blink:

I'm still running 1.3.7 with an upgrade to 1.3.8a delayed by a hickup during which I finally moved my site to another host.

If this has been addressed already in 1.3.8a I'll let it slide and push the upgrade through faster. If it hasn't been addressed it's likely to become an issue for other users.

We're now settled in at our final home - http://www.swiftbooks.co.uk - where you'll find an eclectic collection of used books. Still a lot of work to do, though!

14 Feb 2008, 11:37 AM
#363
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

gsis
well its faintly exciting seeing the book product explode

but seriously, any experts please have a look at the sql code for the filter.. I did alter the reset recently I think. I'm a bit tied up with other thigs just now but i will check it out later

otherwise just remove reset from the dropdown list, its probably got a value that upsets the filter

14 Feb 2008, 11:42 AM
#364
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

elastic
the sql searches are quite code-complicated, the nearest I did was the isbn search section in the multi sidebox, but thats a zencart field in the main database, not in the book tables. You need to learn php, or find a friend that'll do it for you!

14 Feb 2008, 7:36 PM
#365
elastic avatar

elastic

New Zenner

Join Date:
Dec 2007
Location:
New Jersey
Posts:
76
Plugin Contributions:
0

Re: Product Type Book (by moku)

hi hareslade, don't take this the wrong way, because it's easy to misread text.

You should not assume i don't know Php, i happen to be good at php programming. I am just trying to get a feel for the specific core files in zen I am going to have to create overrides for.

hmmn. really?

14 Feb 2008, 10:03 PM
#366
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

elastic
I didn't know if you knew php or not.. now I do.. you do.. :)

reminds me of 'now I know kung foo'..

16 Feb 2008, 10:17 PM
#367
mikecook avatar

mikecook

New Zenner

Join Date:
Sep 2007
Posts:
2
Plugin Contributions:
0

Re: Product Type Book (by moku)

24star:

  1. Setting for "Show Book Condition" under the book-type layout has no effect. It shows up on the product info page all the time.

I think I found this bug, the sort routine is missing an if {} statement.

Navigate to the 'templates' directory and edit the following file;

tpl_product_book_info_display.php

Then search for this line;

(($products_book_condition_description != '' and $products_book_condition_description != ' ') ? $show_desc = 1 : $show_desc = 0);

Add an if at the start and replace the ; at the end of the line with an {

Like so;

if (($products_book_condition_description != '' and $products_book_condition_description != ' ') ? $show_desc = 1 : $show_desc = 0) {

Don't forget to close this by adding an } after the last line;

  echo '</div>' . "\n";
 }
}
?>
16 Feb 2008, 10:28 PM
#368
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Product Type Book (by moku)

The code may or may not need another if to control the output of the
echo '</div>' . "\n";
but the line you refer to is not incorrectly written. It is a "ternary operator" which is an implied if statement that can be embedded inside a line of PHP.

The "?" says to evaluate the code before it, and if true execute the next bit of code until the ":"; if not true, execute the code after the colon.

This would have to be examined in context to know whether a new "if" is required.
My guess is that it is not, because the line as written will do the whole job of showing the description or not, and making the </div> conditional is probably a bad thing.

17 Feb 2008, 9:51 PM
#369
inmac avatar

inmac

New Zenner

Join Date:
Feb 2008
Posts:
2
Plugin Contributions:
0

Re: Product Type Book (by moku)

Hello, I've looked everywhere (forum and the download section) for the current download for the book module can someone point me to the link? Thanks:smile:

3 Mar 2008, 12:38 AM
#371
inmac avatar

inmac

New Zenner

Join Date:
Feb 2008
Posts:
2
Plugin Contributions:
0

Re: Product Type Book (by moku)

hello,

I'm getting the following error when applying a the patch for version 1.37.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id'=>'1', 'text'=>'True'), array('id'=>'0', 'text'=>'False')), '
in:
[INSERT INTO product_type_layout (configuration_title, configuration_key, configuration_value, configuration_description, product_type_id, sort_order, set_function, date_added) VALUES ('Enable the Book Search', 'SEARCH_PRODUCT_BOOK_ENABLED', '1', 'Add the books to the search engine 0= off 1= on', '7', '0', 'zen_cfg_select_drop_down(array(array('id'=>'1', 'text'=>'True'), array('id'=>'0', 'text'=>'False')), ', now());]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Can someone tell me what I need to do to fix this.

inmac:smile:

15 Mar 2008, 2:28 PM
#372
bearaman avatar

bearaman

New Zenner

Join Date:
Jun 2006
Posts:
57
Plugin Contributions:
0

Re: Product Type Book (by moku)

Hi Paul (Hareslade),
Would it be possible for you to post what tables get created and what new fields get created by your fine mod?
I'm trying to use Easy Populate Advanced to upload a pile of book data and this info would be very handy.
Thanks for a great mod!
Bearaman

15 Mar 2008, 3:28 PM
#373
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

inmac, sorry I didn't get notication from the forum innards that you posted,
that section
'INSERT INTO product_type_layout '
is only inserting a switch for book search, in admin | edit layout for books..

In general, you can take out a specific entry from the sql in the patch, the text can be edited with notepad. Since its an upgrade sql, if the config table entry is already in your database, it would give an sql error.

Since the patch might have complete the items 'up to' where its errorred, then you just try applying the remainder of the patch, just after the line it errored at. Just do a zc backup using their add-on, before going too far! In fact, backing up the db before doing any sort of upgrade is essntial..

its essential really, to know about phpmyadmin. in your site control panel, because you can search for an entry e.g 'SEARCH_PRODUCT_BOOK_ENABLED' in the database, which if you find it, means you don't need that bit of the patch!

Haven't got space here obviously to explain it all, but using phpmyadmin is very useful for checking if an sql errored. But don't apply the patches designed for zencart patch page, in phpmyadmin, because the zc patches don't have the table prefix in the sql. The zc add on patches only work inside zencart.

15 Mar 2008, 3:35 PM
#374
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,746
Plugin Contributions:
0

Re: Product Type Book (by moku)

Please add the contrib to the downloads section. Thanks.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

15 Mar 2008, 3:45 PM
#375
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

bearaman
there are a couple of word docs in folder 5_other_stuff in the book fileset, which roughly tell you the extra fields. Examining the add-on sql will tell you the exact tables created new for book product. there are quite a few...

To be honest, I never continued trying to get an auto-upload system working, the time to design it meant my 200 books could have been put in manually! (which they were..)

One of the problems is, the authors are kept in a specific table, so if you upload a book, you need to add the author to the authors table first, (as you would in admin)... then upload the rest of a books data, .. but you need to know the i.d that the new author got, (or search it) before you can link the rest of the new book data to it.

So its not just a case of uploading data.. I think it needs a bespoke php system to do it, which takes the book data in, processes it in the website, doing the separate table updates in a sequence. Thats vastly different from dumping a set of 'ordinary' zencart product data into single table or two.

Anyone want to spend 6 weeks programming php?
But do let us know how you get on with existing methods..

15 Mar 2008, 3:57 PM
#376
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

Thanks Kim,

If you say please, I must do it.. will do..

Only thing is, I'm unable currently to give the support it really needs, in terms of coding time..

I did discuss with a few others about wiki, forum, or project creation for book... any suggestions in context of zencart? I don't want to have to admin a project as well!

19 Mar 2008, 4:55 AM
#377
chinesebks4children avatar

chinesebks4children

New Zenner

Join Date:
Mar 2008
Posts:
4
Plugin Contributions:
0

Re: Product Type Book (by moku)

Hello,

Thank you for working on this product type. We are selling books and this looks like the ideal way for us to present the special info about books on our site (using 1.3.8a).

On to my questions:
First, I rather circuitously found the link by explicitly putting this in my browser:

http://www.jphuk.co.uk/zc125/download/zencart1_3_8a_addons/ML_ZC1_3_8_EXTENDED_BOOK_TYPE_V_4_LANGS_ISS1.zip

It appears that there is no link to this on the homepage of your site

Next, I could not open this Zip files (using winxp sp2, built in extraction) b/c it asked for a password on some of the files.

Last, it appears that this will not work (or only partially) with EZ populate as I saw in another post. If it does work partially, what fields are used in the standard zc database and what are not? I figure if I only use the standard zc fields then maybe I can still use EZ Pop?

Thanks!
Eli

19 Mar 2008, 10:47 AM
#378
hareslade avatar

hareslade

Totally Zenned

Join Date:
Nov 2004
Location:
U.K. South Wales
Posts:
442
Plugin Contributions:
0

Re: Product Type Book (by moku)

hi! chinesebks4children
I forgot to do the formal entry in my website for the 1.3.8 book version! I was waiting for all those beta testers to decide if it works ok..

Note I only do the multilanguage version now.. it will run in single language..

Try this page for the add-ons link
http://www.jphuk.co.uk/zc/index.php?main_page=document_general_info&cPath=54&products_id=490
Thats issue 2, almost identical to issue 1.

Some people do get password request for opening my zips, maybe its the xp internal unzipper. I used powerzip to zip up. There is always an extra empty file inside of the unzipped file, don't worry about it. There is no password protection.

The EZ populate I reckon would only work on the 'top level' book data, that is, Title, description, ISBN, etc see the link texts. All the rest of book data is in an extra table, and the authors and so on are difficult to upload by EZ-style add-ons.

Advise if the zip still gives trouble. btw I haven't fixed the minor bugs with search sideboxes, thats a todo..

20 Mar 2008, 4:29 AM
#379
chinesebks4children avatar

chinesebks4children

New Zenner

Join Date:
Mar 2008
Posts:
4
Plugin Contributions:
0

Re: Product Type Book (by moku)

thank you so much for your answers. I will try it tonight, must be about 6am where you are now. (btw I have some family in wales, need to go there someday)

regards...

p.s. link to site is https://www.chinesebooksforchildren.com/index.php , not quite ready yet but getting there...

23 Mar 2008, 10:31 PM
#380
mikefarrant avatar

mikefarrant

New Zenner

Join Date:
Jan 2008
Posts:
9
Plugin Contributions:
0

Re: Product Type Book (by moku)

Hareslade,
I'm really new to zencart and php so the learning curve for me is pretty steep (I'm a VB.NET developer). Having said that, your work on this book product type has been really helpful with my project.
I'm working with the zencart 1.3.8a and v4 of the book product type.
Everything is hanging together fairly well and I've spent the day today working on getting easypopulate to start adding and deleting correctly (still got most of the extra tables to do!!)
I've just taken a little breather and decided to try and put some authors in manually... but alas I've found that I cannot...
The SQL tables are being updated but the name and nickname fields are just not being populated? I've scanned through this thread but not found anyone else with this problem. Any ideas?

Thanks

Mike