Re: New add-on "product type book" for ZC 1.5
Hi
It was the mysql config that was causing this issue.
I had troubles installing zencart , I had to apply this fix:
https://www.zen-cart.com/showthread....57#post1268657
It seems that with sql_mode=STRICT_TRANS_TABLES, you can't insert authors and authors types ( didn't test the others fields)
So today I changed to
sql_mode=NO_ENGINE_SUBSTITUTION
Usually I'm on Nginx with the same db, but never saw this error in other scritps. But for zencart I've used xampp, that had it's own db. I've change to a lamp cause I'm on linux, and this errors stared to come up.
everything it's ok :)
Thanks
Re: New add-on "product type book" for ZC 1.5
Thanks for letting me know, this is all new to me, I will look into it to see, if it's something I can fix in BookX.
Best regards,
p.
Re: New add-on "product type book" for ZC 1.5
Hi
I'm working on bookx EP import, but I'm getting a lot of this warnings in the log:
PHP Warning: Invalid argument supplied for foreach() in /home/daniel/public_html/zen154.dev/zenadmin/includes/modules/product_bookx/collect_info.php on line 782
As I have SEO uri, possibly the line is different , but I didn't mess with this lines:
It's just a warning, I don't see no working issues, but I wonder what could it be ?
No one else getting this warning ?
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++;
}
Thanks
Re: Creating an add-on "product type book" for ZC 1.5
Actually I didn't , but I got around with other price range boxes that I made, so I'm satisfied with the front page.
Best regards
Re: Creating an add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
Hello, Did you ever get an answer about using bookx and ceon URI mapping together?
Actually I didn't , but I got around with other price range boxes that I made, so I'm satisfied with the front page.
Well, this was the answer to this.... but I dont' get how this quick reply works :blink:
https://www.zen-cart.com/showthread....26#post1290626
Best regards
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
mesnitu
Hi
I'm working on bookx EP import, but I'm getting a lot of this warnings in the log:
PHP Warning: Invalid argument supplied for foreach() in /home/daniel/public_html/zen154.dev/zenadmin/includes/modules/product_bookx/collect_info.php on line 782
As I have SEO uri, possibly the line is different , but I didn't mess with this lines:
It's just a warning, I don't see no working issues, but I wonder what could it be ?
No one else getting this warning ?
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++;
}
Thanks
Not sure what the issue could be. In the unmodified collect_info.php an empty array is created on line 100:
Code:
$product_assigned_authors = array();
then possibly it is filled with some content on lines 139 and 169:
Code:
$product_assigned_authors[] = array('primary_id' => $assigned_authors->fields['primary_id'], 'bookx_author_id' => $assigned_authors->fields['bookx_author_id'], 'bookx_author_type_id' => $assigned_authors->fields['bookx_author_type_id']);
$product_assigned_authors[] = array('primary_id' => '', 'bookx_author_id' => $author_id, 'bookx_author_type_id' => $bookx_author_type_id);
So far it has always been safe to pass an empty array to a foreach loop, so not sure what the Warning is relating to.
Code:
foreach ($product_assigned_authors as $product_assigned_author) {
Have you made any changes like IF blocks, that prevent line 100 from creating the empty array?
Regards,
p.
Re: Creating an add-on "product type book" for ZC 1.5
Sorry
Actually, I'm working only with bookx rc6 and zencart 1.54 ... no mods, no nothing
Best regards
Re: Creating an add-on "product type book" for ZC 1.5
I have that line in 132 , bellow :
$assigned_authors = $db->Execute('SELECT * FROM ' . TABLE_PRODUCT_BOOKX_AUTHORS_TO_PRODUCTS . ' WHERE products_id = ' . $pID);
$product_assigned_authors = array();
Have you made any updates lately ?
Re: Creating an add-on "product type book" for ZC 1.5
Indeed, you are missing these two lines on line 100:
Code:
$product_assigned_authors = array();
$product_assigned_genres = array();
It is true I had not included the very latest files in 1.9.4 revisoin 6 since some more files have changed on the way to next version. Just the Fatal Error which fjbern got while installing Bookx.
So add those two lines, the error should go away and then when the next version comes along they will be included :)
Regards,
p.
Re: Creating an add-on "product type book" for ZC 1.5
Thanks
I was checking the rc 4, and those two lines were there.
ok. Thanks