-
Re: Creating an add-on "product type book" for ZC 1.5
Hi mesnitu,
the MySQL error is a bug indeed. You can fix it as follows:
In file [YOUR_ZC_INSTALLATION] -> includes -> functions -> extra_functions -> functions_product_type_bookx.php
on lines 253 & 254 (this is the "publisher" filter query)
you need to replace "bi" with "bpub" so it looks like this:
PHP Code:
$extra_filter_query_parts['join']['publisher'] = ' LEFT JOIN ' . TABLE_PRODUCT_BOOKX_PUBLISHERS . ' bpub ON bpub.bookx_publisher_id = be.bookx_publisher_id ';
$extra_filter_query_parts['where']['publisher'] = ' bpub.bookx_publisher_id = "' . $active_bx_filter_ids['publisher_id'] . '" ';
Let me know if that solves the error for you and I will include this in another revision update asap.
As for resetting the filter, I don't yet see what your usage scenario is. I have tested it here with multiple BookX filters enabled and if I filter for genre "A" and then reset, I return to the homepage. Do you get this behaviour and do you agree that this is a good way to do it?
If I filter for genre "B" and then filter for series "XYZ" (a series which had genre "B" applied, otherwise I could not choose it from the filter popup) and then I reset the genre filter, I still get the series "XYZ" displayed, for which i was also filtering. Do you get this behaviour and do you agree that this is a good way to do it?
If we are speaking of different things, then please try again to explain again what your scenario is :)
Regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
The query change did the trick :) Thank's !
Also, now I'm using r4 .
About the reset , I think it's a template issue. As I said , this template uses new, featured and special products in a jquery tab. I also have a slider above.
So when I reset the filter (total reset), it breaks the template or the querys that the template needs to do in the homepage.
But , one thing I notice, it's upon the total reset, I get a breadcrumb Home :: genre_description , and in my homepage I don't have a breadcrumb, and the sliders and tabs only work in the homepage because they have a if ($is_home)
Am I really on the hompage ?
Quote:
If I filter for genre "B" and then filter for series "XYZ" (a series which had genre "B" applied, otherwise I could not choose it from the filter popup) and then I reset the genre filter, I still get the series "XYZ" displayed, for which i was also filtering. Do you get this behaviour and do you agree that this is a good way to do it?
It's just awsome ! :smile:
Thanks !
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi mesnitu,
difficult for me to troubleshoot your template issue. I am aware that the breadcrumbs do not yet give meaningful "Bookx" info all the time, especially when navigating around after a filter or search. This will hopefully work better soon, like in 0.9.5.
The filters work exclusively via the GET parameters added to the URL. You can try this by hand, by adding something like &typefilter=bookx&bookx_genre_id=2 at the end of your URL and voilá: you have filtered for genre with ID #2. Now if your template also uses GET parameters for whatever reason, it could be that they are cut off when you reset the filter? Just look at your URL when your template is working and compare to when it isn't working. As far as the filters are concerned that is the only place where it can interfere in my opinion.
I think ZC assumes that if there are GET parameters in the URL, you are not on the homepage. Try deleting the bookx parameters and see if it behaves like the homepage then.
Regards,
P.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
When I reset the filter I get this url :
index.php?main_page=index&typefilter=bookx&bookx_publisher_id=
But if I could get this :
index.php?main_page=index
it would be ok .
By the way : what are the options in the configuration of the filter ?, it says :
Quote:
Filter list: Size/Style
Sets the maximum length for an option list in the Book X filter sidebox. Settings this value to 0 or 1 will display a dropdown list.
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
oh I get it , if we place a 3 in the Filter list: Size/Style it gets a select form !
-
1 Attachment(s)
Re: Creating an add-on "product type book" for ZC 1.5
Fixing the "filter reset" needed more changes than just one line, so find attached the updated file bookx_filters.php to go into [YOUR_ZC_INSTALLATION] -> includes -> index_filters ->
Let me know if that works for you and I'll have it in the next update.
p.
Attachment 14649
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi Philou ! :bow:
Fantastic man !
Thanks a lot !
Are you developing this module for some university project or something ? This is quite amazing, and the support and effort outstanding !
Thanks !
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi mesnitu,
thank you for your kind words! I am developing this for our own store, which is actually not a bookstore but the shop of a small publisher. This may be why some things work like someone using them day to day would like to have them work...
The reason I can respond so quickly just now is, that I happen to work on this project anyway at this very moment. If someone finds a bug I may just as well fix that first before I tackle the ones you haven't discovered yet ;)
The workweek is usually full of publishing business, so BookX has to happen on the weekends.
It would be great, if BookX could finally come out of BETA and we could go online with this in our own store by the end of the year, but it's getting tight. Over the years I have already hacked a few versions of ZenCart for our bookselling purposes, but this time I wanted to do it right and write a proper plugin. I did underestimate a bit the time it takes to pass this on to others so it is useful, with a little documentation, allowing configuartion via ADMIN, adding langugage files etc etc.
Anyway, glad it is useful for some other people too!
Regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Well, can't thank you enough !
I will make some suggestions as I working with the module, however, please consider them as suggestions and not asking for more features, because as I see it , bookx it's already a great tool for bookshops.
Thanks!
-
Re: Creating an add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hi Mesnitu,
very difficult to say what the problem is with so little info. Are you sure there is no DEBUG log anywhere? Check this post about where to look for it:
http://www.zen-cart.com/content.php?124-blank-page. The DENUG log should give some valuable info about what exactly is going wrong.
Regards,
p.
Hi Philou,
Yes it did fix my problem. I have come across other issues since but they are probably down to other templating issues. I've got other projects on the go so I've been on and off this shop for the last couple of weeks.
Looking forward to the next release so I can play with the filtering on author types :-)
Kinsley
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi Kinsley,
glad you could resolve your problem. Filters are fully operational as far as I'm concerned…?
Best regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hah oh dear - this is driving me daft.
OK you are right filters is there - except that on an update it is breaking out before it gets to the 0.9.3 section. I have just checked the 0.9.4 zip file and in the init_product_type_bookx.php file on line 623 it has a break; command.
So, taking that out has installed the filter options etc from 0.9.3.
Unfortunately I can't figure out how to have filter by author type? Both Illustrator and Authors are shown in the same Authors drop down - is this by design?
Thanks,
Kinsley
-
Re: Creating an add-on "product type book" for ZC 1.5
Goodness, you are right, that break; on line 623 of the installation script from 0.9.2 to 0.9.4 should not be there.
Did you set "Allow multiple filters" to "true" in ADMIN -> Catalog -> Product Types -> Product Type BookX -> edit layout ?
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi Philou,
Yes I've enabled the Filter author type and also the Allow multiple filters active.
Kinsley
-
Re: Creating an add-on "product type book" for ZC 1.5
Hm, i don't quite see what is going wrong.
Just to be sure:
in ADMIN -> Catalog -> Product Types -> Product Type BookX -> edit layout you have two settings:
Filter Sidebox - Filter Autor
Filter Sidebox - Filter Author Type
Both are set to "1", yes?
Of course you also have at least one author and at least one author type set up and you also have at least one product with this author and that type?
If all this is the case, can you go to ADMIN -> Tools -> Developer Tool Kit and look for this constant: SHOW_PRODUCT_BOOKX_FILTER_AUTHOR_TYPE
Does it find it? If yes, then it really beats me what is going on.
Finally, do you have the possibility to debug the code i.e. set breakpoints or is that a bit above what you are comfortable with? The logic to show the author type filter dropdown is in [YOUR_ZC_INSTALLATION]/includes/modules/sideboxes/bookx_filters.php around line 71. I don't have much I can debug here, since it is working for me. I would first have to be able to reproduce the error.
Have you tried to use the RESET Bookx option new in 0.9.4r4 to be found in ADMIN -> Tools -> BookX Tools -> Reset settings? Make a DB backup first !!
This makes sure all the settings constants etc. are in the DB, but it also resets their values, notable ALLOW_ MULTIPLE_FILTERS to "0" = no.
Regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Bl**dy hell - ok I figured out what the problem was - and again it wasn't your fault.
The previous developer copied the file into the bespoke template folder and it was an older version of the filter code.
I deleted that and guess what - it works now as it uses the template default version.
Gee sorry to have wasted your time Philou.
Kinsley
-
Re: Creating an add-on "product type book" for ZC 1.5
Guess you're not called redrandsom for nothing ;)
At least it wasn't a fault in my code, and you spotted the bug in the install script, so that's good.
Regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi there
Sometime I see this message :
This book is not currently displayed in your shop, since the "product status" is set to
Everything is working fine, but there is this message .
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi mesnitu,
it should read This book is not currently displayed in your shop, since the "product status" is set to "Out of stock".
It will be fixed in next release. If it bothers you then change line 35 of [ADMIN] –> includes -> languages -> english (or portugese :) ) -> product_bookx.php
to
PHP Code:
define('TEXT_PRODUCT_NOT_DISPLAYED_DUE_TO_PRODUCT_STATUS', 'This book is not currently displayed in your shop, since the "product status" is set to "Out of stock".');
Regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
hi
ok, but I forgot to mentioned , that this message it's when I about to insert a new product.... so there is no product or stock.
Thanks
-
Re: 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 :
HTML Code:
<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
Code:
$zco_notifier->notify('NOTIFY_TPL_PRODUCT_BOOKX_INFO_DISPLAY_DOCPRODUCT_BEGIN');
wahtever I want
$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
-
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.
-
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
-
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.
-
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
-
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
-
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
-
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
-
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: www.woodbinebooks.co.uk
Thanks again for your help,
Kinsley
-
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 :
PHP Code:
$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 !
-
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
-
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.
-
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
-
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
-
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.
-
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 :
Code:
[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:
PHP Code:
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
-
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.
-
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
-
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
-
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.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I've send you a testing link.
But , If I turn this featured off, it works nice in a zc behaviour .... so, it's listed as a new product, the button isn't replaced.
When On , button is replaced and nothing is added to the shopping cart.....
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Okay, i have seen it in your shop, you can delete the test product.
I will make a note and fix it in next release.
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
hum... I just remember that this template as some issues with bookx new products.... could that be the case ?
In fact I disable the tabs for the new modules in the front page.... but the sideboxes for new products are working, the new products page is working.... but possible in this featured is one of the cases that doesn't work ?...
if you can't reproduce, that it's this template anda not a issue.
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Indeed, here it works as expected.
I have seen that on your test page the SUBMIT form is missing two hidden INPUT fields in the HTML.
Your HTML:
HTML Code:
<!--bof Add to Cart Box -->
<div id="cartAdd">
<input class="cssButton button_bookx_new" onmouseover="this.className='cssButtonHover button_bookx_new button_bookx_newHover'" onmouseout="this.className='cssButton button_bookx_new'" type="submit" value="Novo" style="width: 80px;" />
</div>
<!--eof Add to Cart Box-->
HTML I have here:
HTML Code:
<!-- bof Add to Cart Box -->
<div id="cartAdd">
<input type="hidden" value="1" name="cart_quantity"></input>
<input type="hidden" value="469" name="products_id"></input>
<input class="cssButton submit_button button button_bookx_new" type="submit" value="Neu! Bestellen" onmouseout="this.className='cssButton submit_button button button_bookx_new'" onmouseover="this.className='cssButtonHover button_bookx_new button_bookx_newHover'"></input>
</div>
<!-- eof Add to Cart Box -->
Below is the part where file tpl_product_bookx_info_display.php is creating the form (around line 532 here), so I can't see at the moment, how your template cannot have the INPUT "quantity" and "product_id" since the template always outputs that… ?
PHP Code:
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$hidden_quantity = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']);
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I made some diff to the original files, but or I'm missing something, but everything is looks equal....
PHP Code:
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
$hidden_quantity = '';
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$hidden_quantity = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']);
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = bookx_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
echo $display_qty . $hidden_quantity;
echo $display_button;
?>
</div>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
-
Re: Creating an add-on "product type book" for ZC 1.5
Not sure how that is possibly, are you sure this is the file being used? do you have an override file somewhere?
In the above code this HTML "<input type="hidden" name="cart_quantity" value="1" />'" must be in your source code HTML, but it is not there…
do you agree?
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Could this rely on some specific zencart configuration that I don't have ?
-
Re: Creating an add-on "product type book" for ZC 1.5
Hm, very mysterious.
Try to set the "SHOW CART QUANTITY BOX" to "0" in Admin, maybe that helps?
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I was checking things, and it's reading the file, and turn on the featured and from the same file the output is different....
Well, you wanted a hidden input right ?There it is ! :D
Anyway, from a "not new" bookx date
HTML Code:
<div id="cartAdd">
<div><!-- I'm suppose to be here --></div>Adicionar ao Carrinho: <div>----------</div><input type="text" name="cart_quantity" value="1" maxlength="6" size="4"><br><br><input type="hidden" name="products_id" value="1291"><input class="cssButton button_in_cart" onmouseover="this.className='cssButtonHover button_in_cart button_in_cartHover'" onmouseout="this.className='cssButton button_in_cart'" type="submit" value="Adicionar" style="width: 80px;"> </div>
A new one :
HTML Code:
<div id="cartAdd">
<div><!-- I'm suppose to be here --></div><input class="cssButton button_bookx_new" onmouseover="this.className='cssButtonHover button_bookx_new button_bookx_newHover'" onmouseout="this.className='cssButton button_bookx_new'" type="submit" value="Novo" style="width: 80px;"> </div>
I'll try now your suggestion.
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hm, very mysterious.
Try to set the "SHOW CART QUANTITY BOX" to "0" in Admin, maybe that helps?
p.
Hi
Nop... I actually had that config... I've turned to 1 , but same results....
I'll have to figured this out later.
ok
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi there
I'm having some troubles inserting a product, and I'm not sure why.
Sometimes I can insert the product on the second try, sometimes it just wont insert the product....
I'm getting this error logs :
Code:
[27-Nov-2014 13:06:06 Europe/Lisbon] PHP Warning: Invalid argument supplied for foreach() in /*******/admin/includes/modules/product_bookx/collect_info.php on line 786
[27-Nov-2014 13:06:06 Europe/Lisbon] PHP Warning: Invalid argument supplied for foreach() in /******/admin/includes/modules/product_bookx/collect_info.php on line 952
The line are:
PHP Code:
foreach ($product_assigned_authors as $product_assigned_author) {
echo '<div class="drop_down_div">';
echo zen_draw_hidden_field('assigned_author_db_id[' . $author_counter . ']', $product_assigned_author['primary_id']);
echo TEXT_PRODUCTS_BOOKX_AUTHOR . ' ' . zen_draw_pull_down_menu('bookx_author_id[' . $author_counter . ']', $authors_array, $product_assigned_author['bookx_author_id']);
if (1 < count($author_types_array)) {
echo TEXT_PRODUCTS_BOOKX_AUTHOR_TYPE . ' ' . zen_draw_pull_down_menu('bookx_author_type_id[' . $author_counter . ']', $author_types_array, $product_assigned_author['bookx_author_type_id']);
};
echo '</div>';
$author_counter++;
}
in netbeans there is a warning about a empty statement... but I already worked with no issues inserting other books....
line 952 no warnings....
PHP Code:
foreach ($product_assigned_genres as $product_assigned_genre) {
echo '<div class="drop_down_div">';
echo zen_draw_hidden_field('assigned_genre_db_id[' . $genre_counter . ']', $product_assigned_genre['primary_id']);
echo zen_draw_pull_down_menu('bookx_genre_id[' . $genre_counter . ']', $genre_array, $product_assigned_genre['bookx_genre_id']);
echo '</div>';
$genre_counter++;
}
Could this some sort of ID's issue ?
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I was checking, and just found out that it's because of the meta tags files....
So just placing the files in modules/product_bookx , it's not going to work...
The strange thing, it's sometimes works.....
Placing the files there as another behavior, because of that read directory line, that places the meta tag preview into the product preview.
Also, updating existing metatags, returns always empty tags.... so there was a problem, but I was able to insert the books and after inserting meta_tags, I knew that if I don't edit them, I would be fine.
But not anymore.
Ok, I know you haven't implemented the metags, but just reporting this
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi mesnitu,
from just checking it quickly, I would think that inserting the following lines in product_boox/collect_info.php at line 100 should work:
Code:
$product_assigned_authors = array();
$product_assigned_genres = array();
so it reads:
Code:
$product_assigned_authors = array();
$product_assigned_genres = array();
if ($pID && empty($_POST)) {
Not sure why meta tags create this problem, but it seems that a special situation arises which means the follwing IF statement is skipped and the two arrays are not defined.
Let me know ho you get on with this.
Regards,
p.
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
As usual it's looking fine now. No error logs, and now it's also possible to update existing meta_tags. :)
Thanks !
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I've installed ZC 1.5.3 with edit orders, super orders and this mod. However, when I add a product to the shopping cart I get a warning msg, digging into the log files, it points to the
includes/classes/shopping_cart.php file, specifically
Unknown column 'pd.products_merkmale' in 'field list'
Does anybody know what may be causing this?
Thanks
-
Re: Creating an add-on "product type book" for ZC 1.5
Hi Chabbu,
please excuse, i did not get notified of your post here for some reason. I have taken the original Shopping cart class file from the german distribution of ZC, so possilby they have made a modification there? If you compare the problematic file in the BookX distribution with the original file in your distribution, then you could check if this is not in your original ZC distribution. In that case I would think you can safely remove the 'pd.products_merkmale'. (Make sure you also check closely if there is an extra colon ',' which you need to remove.
Regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
Has anyone gotten this to work? I tried downloading it and installing it which was not really an issue there. but I noticed there is no SQL file to add to the database and it doesn't show up in my admin area when trying to add a new book product.
-
Re: New add-on "product type book" for ZC 1.5
Hi Imagine,
once you placed all PHP files where they need to be, you still have to run the installation script in the ZC Admin backend. This will install the necessary database tables. The installation instructions are ncluded in the distribution, did you find them?
Regards,
p
-
Re: New add-on "product type book" for ZC 1.5
Hi Philou
A question that has been on my mind for a while is why so many db tables need to be created for this mod.
Surely by consolidating the tables, a significant reduction in the number of sql queries and amount of code would result.
My 2c.
ps ATM I have no need to use this mod, but there may come a day...
-
Re: New add-on "product type book" for ZC 1.5
Hi DW,
it seemed to me the best way to do it.
The idea is to create additional logical entities like author, series, book condition, so that the shop can filter for these. If we roll all of that into one DB table, then we could just use one of the existing modules which add extra fields to a product and then you can store your authors, series, book conditions in there. But then filtering would be quite an act.
One further requirement was that users can choose their own options, like names of series, or type of book conditions they want to use in their shop setup. Since I am myself not using the mod in English, the mod also needs extra tables for language translations. What do you suggest we eliminate?
I also question whether fewer tables would result in a more efficient code execution. Extra JOINS are currently needed to link up all these tables, but I would have to add JOIN clauses all the same, even if all these extra attributes would be collected in a single table.
One thing that is indeed a bit inefficient in this mod, is that it resends some product listing database queries after I have injected the extra logic for BookX attributes, therefore querying the DB twice. This was the only way I saw how to do it using only the observer functionality of ZC, as there was no hook I could observe for to inject my extra query code. That would be a very useful addition to ZC in my opinion. The other option would be to hack the DB queries in core code, which I did not want to do to remain as forward compatible as possible and I also assumed that most users are not so happy altering ZC core code.
Hope that answers your question ;)
p.
-
Re: New 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
-
Re: New 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.
-
Re: New 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: ?
-
Re: New 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.
-
Re: New 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
-
Re: New 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
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
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
-
Re: New 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.
-
Re: New 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
-
Re: New 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.
-
Re: New 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
-
Re: New 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.
-
Re: New 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
-
Re: New 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.
-
Re: New 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
-
Re: New 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
-
Re: New 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!
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
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
-
Re: New 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.
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
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?
-
Re: New add-on "product type book" for ZC 1.5
Is that error log from when you try to install or do something else? It appears it is from when you do something else. In cpanel, are there any logs in the error file?
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
lruskauff
Is that error log from when you try to install or do something else? It appears it is from when you do something else. In cpanel, are there any logs in the error file?
Please do not bother to follow this thread anymore. I completely removed this application when I discovered it not only wasn't working but it messed up my shopping cart page. I started to get 500 server errors on the shopping cart page and after I removed the bookx plugin I was able to view the shopping cart and now everything is back to normal.
I have absolutely no faith that the bookx plugin works and can not afford to fool with it any longer.
-
Re: New add-on "product type book" for ZC 1.5
Hi fjbern,
sorry the plugin wasn't working for you out of the box. As Iruskauff mentioned below, the error log you posted says it can't find one of the database tables which are installed by the installation script. Since the installation script gave you an error, it makes sense that the database tables were not installed correctly.
If you do still want to install this plugin, the question would be what file is the installation script saying it can't find? If you say you "checked installation three times", then I assume you mean you checked the placement of all the bookx files in the correct folders. it could also possibly be a permission problem, meaning the file is where it should be, but the web server can't access it? Really it is crucial to know what file you are talking about, so any more info you can give will be great.
Best regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hi fjbern,
sorry the plugin wasn't working for you out of the box. As Iruskauff mentioned below, the error log you posted says it can't find one of the database tables which are installed by the installation script. Since the installation script gave you an error, it makes sense that the database tables were not installed correctly.
If you do still want to install this plugin, the question would be what file is the installation script saying it can't find? If you say you "checked installation three times", then I assume you mean you checked the placement of all the bookx files in the correct folders. it could also possibly be a permission problem, meaning the file is where it should be, but the web server can't access it? Really it is crucial to know what file you are talking about, so any more info you can give will be great.
Best regards,
p.
I am still interested in using this plugin. I do not know what file it can't find and do not know how to find out what it is.
Best regards,
fjbern
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
I am still interested in using this plugin. I do not know what file it can't find and do not know how to find out what it is.
Best regards,
fjbern
Hi fjbern,
I am not near my development computer at the moment, so I can only fiddle with this starting next monday. I assume the error message you got did not have more info than "file not found" otherwise you would have mentioned it here? I do not recall at the moment if errors that occur on the Admin side of ZCart are also logged in the debug logs which are saved in the folder "cache"? If nothing is recorded in the debug logs, then the next step could be to place only the bookx installation script in the corresponding Admin folder and run the install command via the URL. The installation script should complain that not all bookx files are there and not run any further. But since I can't check the exact names and folders of files right now, I can't give you more specific instructions on how to do that.
Does more info by next monday work for you still? I know it's frustrating to be in the middle of development and then it doesn't go forward...
Of course you back up your database before trying these things, when there is already an issue with the installation ;)
Regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
I think he was saying he couldn't find the install script.
-
Re: New add-on "product type book" for ZC 1.5
Hello,
Are you saying I can just upload the admin folder then run the install script from mybrowser?????
Yes I can wait awhile to hear back from you. I had such a bad experience with this plugin that I want to have guidance before proceeding.
Best regards,
fjbern
-
Re: New add-on "product type book" for ZC 1.5
Okay. I can check what error is shown when the actual install script file is missing. I have not tried that myself :)
Let's rather wait a few days and I can give you more specific help.
Regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Okay. I can check what error is shown when the actual install script file is missing. I have not tried that myself :)
Let's rather wait a few days and I can give you more specific help.
Regards,
p.
Hi fjbern,
I cannot reproduce a "file missing" error even by omitting some required bookx files.
So let's make sure we're on the same page as far as the installation goes:
1.) You were asking about "uploading the admin folder", so I assume you can only run the zen-cart shop system on an online server (e.g. at a webhosting service) and you do not have a local web server running on your development computer to test things. Is that correct?
2.) Either way I advise you to make a copy of your zen-cart system files (e.g. by turning the whole folder into a ZIP archive) before experimenting with plugins, so you can easily go back to a previous working state of the shop. The same is true for making a backup of the database before you install any plugins.
3.) The Bookx files have to be merged into the file structure of the zen cart shop system. The BookX documentation explains that. Can you confirm, that all files are merged into your shop installation? Some files have to be edited manually unfortunately, but the edits should not affect the operation of your shop, even if you decide to uninstall or simply not use BookX. If you can only run ZC online, then you need to synchronize your only shop files & folders, so the Bookx files are also online in their respective folders. if you do not have a synchronizing tool, you may have to re-upload the entire ZC site, even if you really only need the extra Bookx files.
4.) What exactly is the error you get when you run the installation script by entering the URL
Code:
http://[YOUR-SHOP-URL]/[YOUR-ADMIN-FOLDER]/?action=bookx_install
You suspected that the install script is missing. The installation scrip is here:
Code:
[YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php
Let me know how you get on with these steps and we troubleshoot further :)
Best regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hi fjbern,
I cannot reproduce a "file missing" error even by omitting some required bookx files.
So let's make sure we're on the same page as far as the installation goes:
1.) You were asking about "uploading the admin folder", so I assume you can only run the zen-cart shop system on an online server (e.g. at a webhosting service) and you do not have a local web server running on your development computer to test things. Is that correct?
2.) Either way I advise you to make a copy of your zen-cart system files (e.g. by turning the whole folder into a ZIP archive) before experimenting with plugins, so you can easily go back to a previous working state of the shop. The same is true for making a backup of the database before you install any plugins.
3.) The Bookx files have to be merged into the file structure of the zen cart shop system. The BookX documentation explains that. Can you confirm, that all files are merged into your shop installation? Some files have to be edited manually unfortunately, but the edits should not affect the operation of your shop, even if you decide to uninstall or simply not use BookX. If you can only run ZC online, then you need to synchronize your only shop files & folders, so the Bookx files are also online in their respective folders. if you do not have a synchronizing tool, you may have to re-upload the entire ZC site, even if you really only need the extra Bookx files.
4.) What exactly is the error you get when you run the installation script by entering the URL
Code:
http://[YOUR-SHOP-URL]/[YOUR-ADMIN-FOLDER]/?action=bookx_install
You suspected that the install script is missing. The installation scrip is here:
Code:
[YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php
Let me know how you get on with these steps and we troubleshoot further :)
Best regards,
p.
1. I do have a test site on the same server.
2. Always do.
3. Looks like 1 file is missing for the merged files: [YOUR-ZEN-CART-FOLDER]/includes/templates/[YOUR-ACTIVE-TEMPLATE]/templates/tpl_modules_whats_new.php Is this really required and if so how do I get a copy of this file
4. Internal server error 500. Can't see the reason.
5. Only error CODES are as previously stated above.
So here is my initial question. Can I upload all the new files in the admin and includes directories without doing the file mods.
I then would want to do the file mods individually to make sure they are working properly and not effecting the operation of my store.
Best regards,
fjbern
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
3. Looks like 1 file is missing for the merged files: [YOUR-ZEN-CART-FOLDER]/includes/templates/[YOUR-ACTIVE-TEMPLATE]/templates/tpl_modules_whats_new.php
Hi fjbern,
you will excuse if my questions / suggestions were possibly a bit too entry level for you, but now I see clearer, thanks.
The file tpl_modules_whats_new.php is not absolutely required, if you do not use this functionality. I see now that for some reason the file is not in the current distribution, so I will add it and upload a new archive. If you just want to continue now with installation quickly, you could delete or comment out the line no. 94
Code:
DIR_FS_CATALOG_TEMPLATES . $current_template . '/templates/tpl_modules_whats_new.php',
inside [YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php which checks for the presence of tpl_modules_whats_new.php.
Quote:
Originally Posted by
fjbern1943
So here is my initial question. Can I upload all the new files in the admin and includes directories without doing the file mods. I then would want to do the file mods individually to make sure they are working properly and not effecting the operation of my store.
I have done my best to develop BookX so it will change the shop files as little as possible and also make it fail gracefully, meaning that I believe you could just upload the extra Bookx files and run the install script and only then do the modifications by hand. Again I have not tried and tested this approach myself, so i can't guarantee that it will work.
Maybe this bit of info helps you:
Bookx does almost all its work by observing the notifier hooks already in the ZC files and then inserting extra code whenever these hooks are triggered. Unfortunately there are not so many hooks in ZC yet as would be needed by BookX, so the manual modifications are almost all simple additions of these notification hooks. They do not change ZC very much at all, so the only error i could see these modifications producing are syntax errors in case something went wrong during making the edits.
Hope you get on well with all this now,
p.
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hi fjbern,
you will excuse if my questions / suggestions were possibly a bit too entry level for you, but now I see clearer, thanks.
The file tpl_modules_whats_new.php is not absolutely required, if you do not use this functionality. I see now that for some reason the file is not in the current distribution, so I will add it and upload a new archive. If you just want to continue now with installation quickly, you could delete or comment out the line no. 94
Code:
DIR_FS_CATALOG_TEMPLATES . $current_template . '/templates/tpl_modules_whats_new.php',
inside [YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php which checks for the presence of tpl_modules_whats_new.php.
I have done my best to develop BookX so it will change the shop files as little as possible and also make it fail gracefully, meaning that I believe you could just upload the extra Bookx files and run the install script and only then do the modifications by hand. Again I have not tried and tested this approach myself, so i can't guarantee that it will work.
Maybe this bit of info helps you:
Bookx does almost all its work by observing the notifier hooks already in the ZC files and then inserting extra code whenever these hooks are triggered. Unfortunately there are not so many hooks in ZC yet as would be needed by BookX, so the manual modifications are almost all simple additions of these notification hooks. They do not change ZC very much at all, so the only error i could see these modifications producing are syntax errors in case something went wrong during making the edits.
Hope you get on well with all this now,
p.
I uploaded all the admin and include files to my test site.
I got a 500 server error: 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.
Also under Tools/bookx tools it shows:
BookX is currently not installed.
•Reset BookX settngs to defaults. Missing configuration entries will be fixed. No products will be altered or deleted! (Please make a database backup before you proceed!)
•Install BookX. (Please make a database backup before you proceed!)
•Update BookX to new version. (Please make a database backup before you proceed!)
•Remove BookX from the Database. (Please make a database backup before you proceed!) All BookX products as well as authors, genres, publishers etc. will be deleted!
If I try to install BookX using this link I get the same error.
Here is my setup and the error message produced:
Using PHP Version - 5.3.29
ZEN CART Version 1.54
Mysql server version: 5.1.73
Web server
•Apache
•Database client version: libmysql - 5.1.73
•PHP extension: mysqli Documentation
MyDebug error:
[19-Aug-2015 07:05:34 America/Chicago] PHP Fatal error: 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 '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/catalog/admins/includes/init_includes/init_product_type_bookx.php on line 903 <== in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/classes/db/mysql/query_factory.php on line 155
Of course nothing gets written to the database.
Help!
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
MyDebug error:
[19-Aug-2015 07:05:34 America/Chicago] PHP Fatal error: 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 '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/catalog/admins/includes/init_includes/init_product_type_bookx.php on line 903 <== in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/classes/db/mysql/query_factory.php on line 155
Of course nothing gets written to the database.
Help!
If you have direct access to your MYSQL the you could run the query direvctly just to test (copied from your error statement above):
Code:
REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct')
See if that gives you a syntax error. If it does, then see below.
In the installation script on line 950 it reads:
Code:
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct'");
There should be no single quotes around {$profile_ids->fields['profile_id']}, so if you feel okay with it then you could remove these and try installation again. I actually don't get a MYSQL error when I run this query here with quotes.
The line should read:
Code:
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ({$profile_ids->fields['profile_id']}, 'bookxProduct'");
I don't see any other syntax problem with that statement and can only try later on to make clean install of 1.5.4. and run the script myself.
Best,
p.
-
Re: New add-on "product type book" for ZC 1.5
Actually I did your instructions backwards.
First I modified the file to remove the single quotes as instructed at got the same error message.
Then I ran the sql statement directly in MySQL using phpmyadmin and it did indeed modify the database by inserting the information in the admin_pages_to_profiles table.
But after that no change in the bookx mod????
What should I do next?
-
Re: New add-on "product type book" for ZC 1.5
We are still aiming to find the source of your error, installation of the module comes next.
BookX is not installing because there is a MYSQL error and the module is therefore not yet running. As long as the script hasn't run completely, BookX will not work. Apparently your browser reports the failure of the installation script as "500 server error / page not found" since no HTML page is returned to your browser by the aborted script execution. So this to me seems to be one the same incident.
I was puzzled that the DEBUG log reported a syntax error in this statement: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct')
since as you saw the MYSQL query executes fine when sent directly to the DB. Not being able to reproduce the error means I have currently no way to troubleshoot further.
Let me try and install a ZC 1.5.4 shop and then BookX and see if I can reproduce the problem you encounter to then be able to fix it. Otherwise we are just poking around in the dark. I won't get to that today unfortunately, I'll do my best to tackle that tomorrow and let you know as soon as I have something.
Best regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
Hi fjbern,
I have now downloaded a fresh ZC 1.5.4 english-only distribution and installed it with a new database. Merged the Bookx files into the file tree in their respective locations, excluding the manual edits to certain existing ZC files for now. Used the URL http://[YOUR_ADMIN_BACKEND]?action=bookx_install and Bookx installed fine.
There were some warnings about missing language files for german, which really shouldn't happen on an english-only distribution, so I will fix that on next release.
One thing that puzzles me is this:
Quote:
Originally Posted by
fjbern1943
Also under Tools/bookx tools it shows:
BookX is currently not installed.
•Reset BookX settngs to defaults. Missing configuration entries will be fixed. No products will be altered or deleted! (Please make a database backup before you proceed!)
•Install BookX. (Please make a database backup before you proceed!)
•Update BookX to new version. (Please make a database backup before you proceed!)
•Remove BookX from the Database. (Please make a database backup before you proceed!) All BookX products as well as authors, genres, publishers etc. will be deleted!
If I try to install BookX using this link I get the same error.
In fact before Bookx is installed in the DB, there should be no "Bookx Tools" showing under the "Tools" menu, so I suspect you have a partial install of Bookx in your DB.
Do you have a means to reload a pre-Bookx database from backup? if you don't have that or have made other changes to DB since, then you could make a DB backup now and try the "BookX Tools" command "Remove BookX from the Database."
Since bookx is not working for you, I would think that the warning about what to do with products of type "BookX" has no relevance to you, meaning you should not have any products of type BookX in your DB. Anyway you will make a DB backup first before removing Bookx, so you shouldn't lose any data this way or another.
After removing Bookx from DB, there should be no more "Bookx Tools" menu in your admin.
You can immediately run the bookx_install via URL again after that and see if it installs correctly this time. If not, please try to preserve as much info as possible, e.g. any warnings the installation script outputs or any other errors. If I can't reproduce the error here, I can't really fix it :)
You can leave all PHP files as they are during this entire procedure. In fact the additional Bookx PHP files as well as any manual modifications mentioned in the Bookx installation instructions should not interfere with the operation of your shop whether Bookx is installed or not. The module "sees" that Bookx is not installed and shouldn't really throw any errors. This is another reason why I suspect you have a partial install of Bookx in your DB for some reason.
Let me know if this helps you along.
Regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
First I want to thank you for your active participation in trying to solve my problem installing bookx.
I am regularly getting two error messages in my admin/logs directory, they are:
[23-Aug-2015 08:10:42 America/Chicago] PHP Fatal error: 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 '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/catalog/admins/includes/init_includes/init_product_type_bookx.php on line 903 <== in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/classes/db/mysql/query_factory.php on line 155
and:
[19-Aug-2015 09:48:51 America/Chicago] PHP Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/functions/plugin_support.php on line 38
[19-Aug-2015 09:48:51 America/Chicago] PHP Warning: file_get_contents(http://www.zen-cart.com/downloads.ph...heck&id=1495): failed to open stream: no suitable wrapper could be found in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/functions/plugin_support.php on line 38
[19-Aug-2015 09:48:51 America/Chicago] PHP Warning: in_array() expects parameter 2 to be array, null given in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/functions/plugin_support.php on line 42
This second one is because fopen is disabled on the server for security reasons.
Also I noticed that if I try to do a update from the bookx tools menu I get this message:
This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/sideboxes/tpl_bookx_filters_select.php
Warning This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/templates/tpl_bookx_authors_list_default.php
Warning This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/templates/tpl_bookx_series_list_default.php
Warning This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/templates/tpl_product_bookx_info_display.php
Even though these files are definitely in place under my responsive_sheffield_blue template directories.
Evidence is that if you go to the site http://christianstore.biz/catalog you will see that the sidebox appears on the top lefthand side of the sideboxes.
I am now under the opinion that I will not be able to install this plugin unless I can run an sql statement either in sql patches in the admin or directly into the database using myphpadmin, because I was able to run successfully the above SQL statement: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct').
Thanks again for your help.
-
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
First I want to thank you for your active participation in trying to solve my problem installing bookx.
That is very nice, thank you. In the end that's what one gets themselves into with open source development and if I am offering you software, be it paid or not, then it should be working too ;)
On to your problem:
I must have been blind before, because now I do see a MYSQL syntax error in my script and don't ask me why it has never triggered an error here.
On line 950 and on line 631 of the installation script in file [YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php it should read:
Code:
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct')");
Note that at the end of the line it is ')"); so a closing bracket was indeed missing. Could you try to correct that and see if it works?
Regards,
p.
-
Re: New add-on "product type book" for ZC 1.5
Yeah,success!
I would like to download the entire plugin again with the necessary changes to the init_product_type_bookx.php and the missing file as discussed before.
-
Re: New add-on "product type book" for ZC 1.5
Great news!
let me put that together and I will let you know here when the file at Sourceforge is updated. I will submit here at ZC.com at the same time, but it usually takes much longer until the download shows up.