Re: 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:
2. 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?
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'):
Quote:
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.
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
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!
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.
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'..
Re: Product Type Book (by moku)
Quote:
Originally Posted by
24star
2. 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;
Code:
tpl_product_book_info_display.php
Then search for this line;
Code:
(($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;
Code:
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;
Code:
echo '</div>' . "\n";
}
}
?>
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.
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:
Re: Product Type Book (by moku)
Paul Hailey (hareslade) now maintains this excellent product. Go here for the Version 3 download. Don't forget to deownload the patch too.
http://www.jphuk.co.uk/zc/index.php?...roducts_id=482