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 61 to 80 of 427
9 Dec 2013, 7:31 AM
#61
design75 avatar

design75

Totally Zenned

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

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

bwidener:

In which file would I find the "Other books by"? I would like to change it to "Other books by this author" or something generic like that.

Brice
You can find it in (arround line 52)
\ZC_INSTALLATION\includes\languages\YOUR_LANGUAGE\product_bookx_info.php

9 Dec 2013, 10:15 AM
#62
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

Design75:

You can find it in (arround line 52)
\ZC_INSTALLATION\includes\languages\YOUR_LANGUAGE\product_bookx_info.php

In addition I suggest that you use the ZC override mechanism, so make a copy of \ZC_INSTALLATION\includes\languages\YOUR_LANGUAGE\product_bookx_info.php and put it into \ZC_INSTALLATION\includes\languages\YOUR_LANGUAGE*YOUR_TEMPLATE*\product_bookx_info.php and make you changes in the copied file.

Also please be advised that BookX arranges the "Other books by" in a more complex manner (at least as of the next version :-)
If a book has three authors X,Y and Z, then first there will be "Other books by X, Y and Z" with the same team of 3 authors, then individually "Other books by X", "Other books by Y", "Other books by Z". Books which are listed as "by the same team" do not display again in the individual lists for each author.
This is in order to differentiate which of the authors the referred book is by and at the same time not repeating the same title over and over on the same page.

All this to say that changing the Text to "Books by the same author" will possibly give you some unexpected results, unless all your books ever only have one author.

Best,
philou

5 Jan 2014, 7:04 PM
#63
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

Hello** philou** and thanks for your great module. I've instaled it on a test site and i want to use it with the Tabbed products module.
I have a problem with the filter sidebox as it only shows filters for author and series and another problem is that if i try to use the filter, it doesn't show the books asigned to the respective author or series.
Do you have any idea why?

5 Jan 2014, 8:08 PM
#64
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,

hard to troubleshoot it based on the info you give. I haven't changed anything on the filter module in recent releases, so it couldn't be a new bug. If you want to filter e.g. by genre, have you created some genres and assigned it to some products? Also, does the filter work if you create a URL manually as described here: http://sourceforge.net/p/zencartbookx/wiki/Configuration/
Lastly, do you find anything in the ZC debug log, found in the folder "cache", which might give me some more info?

Best regards,
p.

suportafaceri:

Hello** philou** and thanks for your great module. I've instaled it on a test site and i want to use it with the Tabbed products module.
I have a problem with the filter sidebox as it only shows filters for author and series and another problem is that if i try to use the filter, it doesn't show the books asigned to the respective author or series.
Do you have any idea why?

5 Jan 2014, 9:24 PM
#65
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

I have instaled the 9.2 version. I think that part of my problem is that nothing gets written in the product_bookx_extra table but it does in the product_bookx_extra_description. I can PM you my site if you have time to figure this out with me.

5 Jan 2014, 10:24 PM
#66
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

The problem was solved with the help of philou. The problem was with the content of my database.

5 Jan 2014, 10:25 PM
#67
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, glad you found what the problem was!

8 Jan 2014, 12:46 AM
#68
oldcat avatar

oldcat

New Zenner

Join Date:
Jan 2014
Location:
Japan
Posts:
3
Plugin Contributions:
0

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

Hi philou,
I have installed 0.92 ver. on my Japanese site and It works great!!!.
Just one question.
I have 3000 over authors on my site.
So I feel some difficulties finding an author with "drop-down list box".
Is it possible to add "the searchbox" on admin section?

Attachment 13645

Best Regards,
oldcat

8 Jan 2014, 10:11 AM
#69
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 Oldcat,

glad to hear it works for you as well!
It should not be too difficult to implement search or "type ahead" functionality into the dropdown for authors on the product editing page in the Admin backend. However, I still have a few other items on my list to resolve for the 1.0 release which I keep postponing to include extra functionality :)

So I can't tell you how soon I can get to including this…

Best regards,
p.

8 Jan 2014, 11:52 AM
#70
oldcat avatar

oldcat

New Zenner

Join Date:
Jan 2014
Location:
Japan
Posts:
3
Plugin Contributions:
0

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

Hi philou,
Thank you for your quick response.
It's good to hear that it is not too difficult to implement these functions.
Thanks anyway.

Best regards,
oldcat

8 Jan 2014, 8:54 PM
#71
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 Oldcat,

of course you are aware that some browsers already provide part of the functionality you describe: You click once on the pop-up with the author names, so the pop-up stays open and then you just start typing on the keyboard and the pop-up highlights entries which begin with the letters you type. Hitting ENTER selects what is highlighted in the popup. In Firefox this works, although I do not know if this works when you enter japanese characters. This will only pick up the first characters so if you look for "Osamu Tezuka" you can only find it by typing "Osam.." not by typing "Tezu…"

Maybe you can do it this way until there is a full search functionality in BookX.

Best wishes,
P.

9 Jan 2014, 5:20 AM
#72
oldcat avatar

oldcat

New Zenner

Join Date:
Jan 2014
Location:
Japan
Posts:
3
Plugin Contributions:
0

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

Hi philou,
Thank you very much for your really useful suggestion.
I have not been aware of this browser's functionality until today.
I tried it and found that it does not work with Japanese/Chinese characters.
So I have made some "dummy" authors for index with alphabetical characters.
It really works and It does shorten my search time.
I will make a donation to your cat.
Thank you again.

Best Regards,
oldcat

9 Jan 2014, 10:01 AM
#73
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 Oldcat,

many thanks for your donation!

I'm happy you have a method that works – great idea to insert "dummy" authors :)

Best regards,
philou

18 Jan 2014, 11:33 AM
#74
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

Hello,

I have another question. I use Multisite modul and it has a function that you can show some categories on one site and other on other site. It uses a function called cat_filter by witch it filters the products (for sideboxes and search). Does anyone have an idea how or where i should try to use this function so that it does the same for the filter sedebox function of bookx?

18 Jan 2014, 11:52 AM
#75
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

I forgot to mention that the sidebox bookx filter is working in this maner, only the function that shows all books by the same author doesnt work, as it shows all the books asigned to that author, not just the ones asignet to the current store.

18 Jan 2014, 6:20 PM
#76
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 sup,

can you give a bit more info :
If you filter for a specific author "Joe" with ID 42 in the BookX sidebox, then it shows correctly all books by "Joe" assigned to your current store, is that right? (The URL should reflect the use of the author filter like for example "YOURSHOP.COM/index.php?main_page=index&typefilter=bookx&bookx_author_id=42")
Does the multisite plugin add another filter to the URL at this point?

If you choose the entry "show all authors" in the bookx filter, there is the link "Show books by Joe" after author "Joe". If you click on this link, then it shows all books by Joe for all stores? Does this exactly describe the problem? If yes, then what does the URL look like? Because in my development shop system it shows exactly the same URL as the filter pop-up in the example above, so if it is different, that could be a problem.

Let me know what the situation is with that, or if it is another point where "Show all books by author" is not working.

Regards,
p.

suportafaceri:

I forgot to mention that the sidebox bookx filter is working in this maner, only the function that shows all books by the same author doesnt work, as it shows all the books asigned to that author, not just the ones asignet to the current store.

18 Jan 2014, 9:56 PM
#77
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

So, another of my rushing thru things. The Advanced search is the one that works as when i search for an author it only shows the products of the respective author for the curent site.
The bookx filter doesn't care about my category alocation and shows all the products by that author.
I tryed al kinds of places to put the cat_filter in but to no avail.
The statements used in the Advanced search for the category filtering is ```
$listing_sql = cat_filter($select_str . $from_str . $where_str . $order_str);

and an example used in the "New product listing"

$check_products_all = $db->Execute(cat_filter($products_new_split->sql_query));

Do you have any idea what and where to change someting to make this work?
21 Jan 2014, 9:59 AM
#78
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 sup,

sorry, but I'm not really an expert on how the multi-site plugin works. Here are two thoughts:
There is a bookx function which runs on all pages that list multiple products and it is in YOUR CATATALOG/includes/classes/observers/class.bookx_observers.php. The function is called update_product_listing_with_bookx_attributes and around line 454 there is this:

$listing_split = new splitPageResults($listing_sql_new, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');

You could try adding your cat_filter there. Possibly this results in the cat_filter being called twice during one execution of the script, once here and once inside the product listing template, I don't know.

The more restrictive call to cat_filter could be placed inside YOUR CATATALOG/includes/index_filters/bookx_filter.php around line 122 there is $listing_sql = 'SELECT ' . $select_column_list . $select_table_list . ' WHERE ' . $select_where_conditions . $alpha_sort; which is only called when there is a BookX filter active.

**Attention: ** When a bookx filter is active, the filter code above is called first, and then the observer code is called as well a bit later, so adding cat_filter in both places means it will be called twice by BookX when filters are active.

Hope that helps you along!

Regards,
p.

22 Jan 2014, 4:40 PM
#79
suportafaceri avatar

suportafaceri

New Zenner

Join Date:
Jun 2012
Posts:
32
Plugin Contributions:
1

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

The first statement for the observers solved the problem with the sidebox.
This is the modified statement in case some one else needs it:

$listing_split = new splitPageResults(cat_filter ($listing_sql_new), MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');

The problem with the Books by the same Author in the product description page was solved by adding the cat_filter in the template tpl like this:

echo cat_filter($authors_related_products_html);

Thank you verry mutch for your help and if you need testing with new versions of your module you can count on me.

22 Jan 2014, 5:02 PM
#80
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,

I'm happy to hear that it works. It is quite surprising that this should fix something:

echo cat_filter($authors_related_products_html);

Since "echo $authors_related_products_html;" simply outputs the HTML previously assembled by the PHP code further up in the bookx_product_info file. I don't see how the cat_filter function is able to go through that HTML and decide which books don't fit the categories of your site. Are you sure that you didn't do something else as well?

Anyway, if it works then there's nothing to complain :)

Regards,
p.