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 221 to 240 of 427
10 Nov 2014, 2:52 PM
#221
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

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

Hi there

in the tpl product info , I found myself in need of moving things a litle bit around, but I have a doubt about how to do it .
Ex: I remove the ISBN from the product details <ul id="productDetailsList"> , and I'm using the product variable $products_isbn to display it where I want. Also I want to display products details in two div's side by side.
So more or less like this :

<div id="left">
	<?php
		$zco_notifier->notify('NOTIFY_TPL_PRODUCT_BOOKX_INFO_DISPLAY_DOCPRODUCT_BEGIN');
		echo $authors_short_html;
                echo $publisher_short_html;
		echo $imprint_short_html;
		
		
?>
    </div> <!-- ends left -->
    <div id="right">
        <?php
        echo $bookx_extra_attributes_html;
                echo $publishing_date_html;
                echo $products_condition_html;
		echo $genres_html;
                echo $products_isbn;
        ?>
        
    </div><!-- ends right -->

So my doubt is if I'm safe playing around in the middle of this notifiers

$zco_notifier->notify('NOTIFY_TPL_PRODUCT_BOOKX_INFO_DISPLAY_DOCPRODUCT_BEGIN');

[B]wahtever I want  [/B]

$zco_notifier->notify('NOTIFY_TPL_PRODUCT_BOOKX_INFO_DISPLAY_DOCPRODUCT_END', array('products_id' => $products_id_current));

Or this serves a order, that could break things up .

Thanks

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

10 Nov 2014, 3:09 PM
#222
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,

sounds like the best way to do it. The Bookx info is put in these variables on purpose so it is easy to customize output where and how you want it.
Keep the display output between the notifiers. It will not break anything if you do not keep it between the two notifiers, but that is what they are there for, to indicate start and end of display output.

Regards,
p.

10 Nov 2014, 3:53 PM
#223
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

Thanks !
There is another doubt, for the information on product listing.... There is a file for tabular_display, but the I think this template is using columnar display,,,, because I'm not seeing no info in the product listing .... product listing it's all the listings to specials, new, all_products, etc... right ? Or something i'm missing ?

Best regards

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

10 Nov 2014, 3:55 PM
#224
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

You must be using ZC 1.5.3 ?
I have just upgraded myself and discovered that BookX does not yet work correctly with "columnar display". There is a setting in admin to go back to "tabular display".

p.

10 Nov 2014, 4:15 PM
#225
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
In this case it's 1.5.1 .... I changed , but nothing comes up.... this info is related with the bookx fields, rigght ? Because I removed all the zc display's for categories, models, etc.....

I have to make a new installation to see how it works...

Thanks

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

10 Nov 2014, 9:55 PM
#226
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 Philou
Not sure if you can reproduce this or if it's I that already change something else, but the imprint div, even if there is nothing there, get's listed.
I've made this small alteration :
//*** imprint info
if ($flag_show_product_bookx_info_imprint &&
(!empty($products_imprint_name) || 2 == $flag_show_product_bookx_info_imprint)) {
$imprint_detail_html = '<!-- bof bookx imprint -->
<div id="bookxImprint">';

But not sure if it's the best way. I assume that it must have a name to display something else...

Best Regards

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

11 Nov 2014, 3:51 PM
#227
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

I was trying to have a author shorter description in the books page info, so something like substr($author['description'],0,180) does the job.
But the I see the in the Author Info, it gets the same length .... Is there a easy way to work around this ?

Thanks

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

11 Nov 2014, 4:00 PM
#228
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

**Edited **: Just found out that a ($_GET['id']=='indexBody') can work for this

But not sure if it's a good practice ....

Best Regards

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

12 Nov 2014, 11:32 AM
#229
redransom avatar

redransom

New Zenner

Join Date:
Aug 2014
Posts:
20
Plugin Contributions:
0

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

Hi Philou,

My site has gone live finally which is great - we noticed a problem with duplicate authors showing on the search that wasn't showing normally in the categories list.

To fix it you need to add a DISTINCT to the GROUP_CONCAT function on line 310 in the class.bookx_observers.php file. I have just noticed that you had it elsewhere as well but managed to overlook this instance (and just noticed that it's needed on line 1256 as well).

The site is: https://www.woodbinebooks.co.uk

Thanks again for your help,

Kinsley

12 Nov 2014, 4:23 PM
#230
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
@redransom very nice site , simple and clean !

Well , another question to master Philou :)
I was trying to get the author image (in product_info) , to link to the authors filter, because it's something that I think it's one of the first things people's will try to click.... I guess...
Anyway , the variable $author['searchlink'] gives the name with the link, I was wondering if there is a way that I can use this.... some php array magic, because the only way I found was to add to main_template_vars_product_type file another variable :

$current_author['author_image_url'] = (!empty($authors->fields['bookx_author_id']) && !empty($authors->fields['author_name']) ?  zen_href_link(FILENAME_DEFAULT, '&typefilter=bookx&bookx_author_id=' . $authors->fields['bookx_author_id']) . ''  : '');

But I don't want to get much apart from the original files, for future updates, etc.....

Thanks !

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

13 Nov 2014, 3:11 PM
#231
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
As I was testing, copy and pasting formatted text to author description (in this case from wikipedia), results in a strange behavior, that I can't edit the author anymore. I have to delete in the database.

Formatting the author text with fckeditor it's on as far as I can tell.

Thanks

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

13 Nov 2014, 3:29 PM
#232
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

Maybe an HTML tag in your editor text? If by any chance you put a </div> in there, it could very well mess things up.
Rather look at the contents without any editor and see if you find something in the text field which should be in there.

13 Nov 2014, 3:35 PM
#233
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 , in this case was copy and past from the wiki..... I usually don't do that, I paste the info without any formatting and I use fckeditor, and with fckeditor until now, I didn't see a problem, using div , links, etc...
I was just saying, because, after this mistake, only in phpmyadmin I can delete the info.
But for me it's ok .

But the info displays ok in the front page. Is just in the admin

Thanks

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

13 Nov 2014, 7:23 PM
#234
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 there
Sorry for so many questions, but I have another one:

I have to testing situations:
1- A book with 3 authors (the authors have image, description, etc...)

2- A Book with 3 authors (the authors have no image, nothing...)

When styling the related products list, I was trying to make everything look the same, but in the 1 situation, I have a related product, I did a nice <li> to .bookxAuthorRelatedProducts

In 2 situation it goes to a team_related products.... and for some reason (possibly tiered ) , I place <ul> outside the foreach , but he doesn't appear, and I respect that :)

So I saw a flag $flag_show_product_bookx_info_authors_team_related_products , and I thought : ok, that's paradise, no teams !
But I don't see that in the configuration, or I'm missing something.

What are the scenarios for teams, and for other books with more than one author ?

Thanks

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

16 Nov 2014, 7:07 PM
#235
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,

sorry, forgot to answer your question about "teams".
There is no separate setting to show "teams" or not. The logic is this:
If there is a "team" of let's say 3 authors who have published multiple books together, then under each author the same books would have to be listed. If there are 3 authors like in your example, then the same books are listed three times.
That is where the "team" comes in. If there are other books by exactly the same "team" of the book currently displayed, then those books go under "other books by the same author team". If in addition one of the authors has published another book by herself, then that book only shows under her biography.

So if you choose to "show books by the same author" then "team" are automatically also shown.

Possibly an ADMIN setting to choos the "team" option would be good.

Regards,
p.

22 Nov 2014, 9:53 AM
#236
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 there
Are the meta tags working ? I'm having this error when trying to add or view the meta_tags :

[22-Nov-2014 09:38:38 Europe/Lisbon] PHP Warning:  require(includes/modules/product_bookx/collect_info_metatags.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/promoboo/public_html/admin/product_bookx.php on line 150

The line is this one:

if ($action == 'new_product_meta_tags') {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/collect_info_metatags.php');
    } else {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/collect_info.php');
    }

Show this files exist in product_bookx folder ?

Thanks

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

22 Nov 2014, 6:23 PM
#237
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 have not yet implemented the meta tags. You could copy the file "collect_info_metatags.php" from [ADMIN]/includes/modules/product/ and it should work (but without Bookx specific info).

Regards,
p.

22 Nov 2014, 7:25 PM
#238
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
ok, I did that, and it's working.

Thanks

Another thing: I'm not using it, and after I disable it, but the way bookx treats the new products by date..... So I had the default config (90 days ), and I realize that the add cart button was replace by a** "new"** button, but when clicked, it goes to shopping cart page, where I can see the full description, but it does not add the book to the shopping cart, neither gives anyway out, except clicking on the image (don't remember if the title is a link also), and go back to the product_bookx_info......

Thanks

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

22 Nov 2014, 7:35 PM
#239
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

By the way, another question about the use of genres vs categories, because I got lost, or confused in the way.... but, when we add a product type bookx, we always have to assign a genre, right ? It has nothing to do with categories, or shod the main genre be related with the categorie where the product_type is been inserted ?

I'm asking this, because I started to insert some books "manually" , (I've used a csv files to import all the data), and I see a add "additional genre"....so that's my confusion.

So If I had no genre, there's .... no genre. Is this correct ?

Thanks

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

24 Nov 2014, 10:09 AM
#240
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,

that doesn't sound right.
Just to be sure:
You are saying even when you turn off the option "New Products: Base on Publication Date" by setting it to "0" then the "New Products" list is not sorted by publication date (expected behaviour) but the product info page shows a "new" button instead of "Add to cart" button and it is also not adding the product to cart?

Second part of the problem the "add to cart" button (which says "new" in this case) takes you to the shopping cart and you have no way to leave the shopping cart page? What would you expect to happen when you click the "add to cart" button (which says "new" in this case) and how would you expect to leave the shopping cart page?

Regards,
p.