“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
About the second step , now that I'm redoing it, I see that one can't use the $extra_html_end ( or at least I can't )
the Ceon it's building or collecting some info, that appears to need to be at the end. But this doesn't echo the object.
It only prints the checkbox , but not the text field.
$extra_html_end .= "<!-- BEGIN CEON URI MAPPING 2 of 2 -->" . $ceon_uri_mapping_admin->collectInfoBuildURIMappingFields() . "<!-- END CEON URI MAPPING 2 of 2 -->";
Or even saying that $extra_html_end = that object to print it at the end, doesn't work. ( or I don't know how to make it work )
So, using this :
It's ok.PHP Code:
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_sort_order', $pInfo->products_sort_order); ?></td>
</tr>
<?php // BEGIN CEON URI MAPPING 2 of 2
echo $ceon_uri_mapping_admin->collectInfoBuildURIMappingFields();
// END CEON URI MAPPING 2 of 2 ?>
</table></td>
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
I've sent to git the files needed for bookx / ceon.
I'm on zc155 with bookx 0.95
But I think it's working, new bookx, updates, and move the book to other categories...
Hope it helps... and for me it's good too in the future, because it's very boring to do all this stuff all over again.
https://github.com/mesnitu/Ceon-BookX
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Right
I was in pain, because I was following my own tips... this files have to be changed too :
In ceon_uri_mapping_filenames.php add :
define('FILENAME_PRODUCT_BOOKX_INFO', 'product_bookx_info');
In ceon_uri_mapping_product_pages.php add :
FILENAME_PRODUCT_BOOKX_INFO,
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
I just realize now that this new version has the breacrumb :) Nice !
Have you try this one on zv155 ?
I'm having a litle situation with product listing , that I recall mentioning some time ago.
I think it was on zc151 that I couldn't do it also.
Now I have a zc154 that I was making, only with zc and bookx. And it was ok.
Now, I have zc155, but I already have, the ceon, reward points, image handler, sitemapxml.
But probably this could be related to the ceon, since he's too in the index_product_listing .
But , I already remove ceon code from that page, just to test it... but no results.
making a var_dump($extra_bookx_filter_term_info);
I'll get NULL .
This is the array with bookx extra info, right ?
Or I should be looking somewhere else ?
In zc154 I was using some module for layout in columns or rows.... but I think that zen155 already has this.
Anyway, perhaps you could guide me were to look.
Thanks
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Well, the only way that I can get that extra info on listings is changing the observer around line 568 from
to :PHP Code:
if ($product_name_column) {
$listing->Move(0);
$listing->cursor = 0;
Some php version.... thing ?PHP Code:
if (isset($product_name_column)) {
$listing->Move(0);
$listing->cursor = 0;
the $product_name_column is 0 in the listing array... so he's there, but only using the if ($product_name_column) , I don't get inside that IF
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
There's a litle addition that could be made in bookx observer class, to get the right canonical url :
Now if one filters ie: a publisher ,
?main_page=index&typefilter=bookx&bookx_publisher_id=36
the canonical url is the home page
<link rel="canonical" href="http://pb155.local:8080/" />
But there are notifies in the init_canonical.php that could be use.
so in the bookx observer, one could add on function productTypeFilterObserver() :
PHP Code:
,'NOTIFY_MODULE_PRODUCT_LISTING_ALPHA_SORTER_BEGIN'
,'NOTIFY_INIT_CANONICAL_PARAM_WHITELIST'
,'NOTIFY_INIT_CANONICAL_DEFAULT'
)
On function update()
PHP Code:
case 'NOTIFY_INIT_CANONICAL_PARAM_WHITELIST':
$this->insert_bookx_canonical($callingClass, $notifier, $paramsArray);
break;
case 'NOTIFY_INIT_CANONICAL_DEFAULT':
$this->insert_bookx_canonical_case_default($callingClass, $notifier, $paramsArray);
break;
And add this ( this is just a test )
So now the canonical link is :PHP Code:
//$zco_notifier->notify ('NOTIFY_INIT_CANONICAL_PARAM_WHITELIST', $current_page, $excludeParams, $keepableParams, $includeCPath);
function insert_bookx_canonical(&$callingClass, $notifier, $paramsArray) {
global $keepableParams;
$keepableParams[] = 'bookx_publisher_id';
}
//$zco_notifier->notify ('NOTIFY_INIT_CANONICAL_DEFAULT', $current_page, $excludeParams, $canonicalLink);
function insert_bookx_canonical_case_default(&$callingClass, $notifier, $paramsArray) {
global $db, $keepableParams, $current_page, $excludeParams, $canonicalLink;
switch ( true ) {
case ($current_page == FILENAME_DEFAULT && isset($_GET['typefilter']) && $_GET['typefilter'] != '' && ( (isset($_GET['bookx_publisher_id']) && $_GET['bookx_publisher_id'] != '' ) ) ):
unset($excludeParams[array_search('typefilter', $excludeParams)]);
$canonicalLink = zen_href_link($current_page, zen_get_all_get_params($excludeParams), 'NONSSL', false);
break;
}
}
<link rel="canonical" href="http://pb155.local:8080/index.php?main_page=index&typefilter=bookx&bookx_publisher_id=36" />
I have made a query to add the publisher name to the canonical link... but I'm not sure if that is good...to have a url link and the canonical link different.
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Hi
About the filters.
I think the filters , always filters all authors, series, etc... even if they don't have a book associated.
But there's a option, on listing, to display books out of stock from authors, etc...
But out of stock is different from a book id that doesn't exist anymore....
I've done this primary simple thing, to just filter series that has books associated. I think this makes sense, but probably I' missing something.
And on the while loopPHP Code:
$bookx_filter_values_query = 'SELECT DISTINCT bs.bookx_series_id, bsd.series_name, be.bookx_series_id
FROM ' . TABLE_PRODUCT_BOOKX_SERIES . ' bs
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_EXTRA . ' be ON bs.bookx_series_id = be.bookx_series_id
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_SERIES_DESCRIPTION . ' bsd ON bs.bookx_series_id = bsd.bookx_series_id AND bsd.languages_id = "' . (int)$_SESSION['languages_id'] . '"'
. (!empty($extra_filter_query_parts['join_multi_filter']) ? $extra_filter_query_parts['join_multi_filter'] . ' ON be.bookx_series_id = bs.bookx_series_id ' : '')
. bookx_assemble_filter_extra_join($extra_filter_query_parts['join'], array('series'))
. ' WHERE 1 ' . bookx_assemble_filter_extra_where($extra_filter_query_parts['where'], array('series'))
. ' ORDER by bs.series_sort_order, bsd.series_name';
$bookx_series = $db->Execute ( $bookx_filter_values_query );
PHP Code:
while ( ! $bookx_series->EOF ) {
if ($bookx_series->fields['bookx_series_id'] !='') {
$bookx_series_name = ((strlen ( $bookx_series->fields ['series_name'] ) > ( int ) BOOKX_MAX_DISPLAY_FILTER_DROPDOWN_LEN) ? substr ( $bookx_series->fields ['series_name'], 0, ( int ) BOOKX_MAX_DISPLAY_FILTER_DROPDOWN_LEN ) . '..' : $bookx_series->fields ['series_name']);
$bookx_series_array [] = array (
'id' => $bookx_series->fields ['bookx_series_id'],
'text' => $bookx_series_name
);
}
$bookx_series->MoveNext ();
}
I think this makes more sense ? , or could be a future to have in a configuration option....to list everything even if there's no books anymore.
But personalty, I think, that it's a lot of "dead" links for a customer.
Another nice feature, would be a admin routine, upon admin click, to delete all series, etc... that don't have books anymore.
Last edited by mesnitu; 28 May 2016 at 09:49 AM.
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
To avoid issues on series_id, probably better to replace with this:
$bookx_filter_values_query = 'SELECT DISTINCT bs.bookx_series_id, bsd.series_name, bxe.bookx_series_id as series_books
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_EXTRA . ' bxe ON bs.bookx_series_id = bxe.bookx_series_id
if ($bookx_series->fields['series_books'] !='') {
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
After all the logic is wrong. Some sort of products status must be made...
Meanwhile, I've done so, but possibly some more checking should be made.
Perhaps later, this could go into another level.
PHP Code:
$bookx_filter_values_query = 'SELECT DISTINCT bs.bookx_series_id, bsd.series_name, bxe.bookx_series_id as series_books, p.products_status
FROM ' . TABLE_PRODUCT_BOOKX_SERIES . ' bs
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_EXTRA . ' bxe ON bs.bookx_series_id = bxe.bookx_series_id
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_SERIES_DESCRIPTION . ' bsd ON bs.bookx_series_id = bsd.bookx_series_id AND bsd.languages_id = "' . (int)$_SESSION['languages_id'] . '"
LEFT JOIN ' . TABLE_PRODUCTS . ' p ON p.products_id = bxe.products_id '
. (!empty($extra_filter_query_parts['join_multi_filter']) ? $extra_filter_query_parts['join_multi_filter'] . ' ON be.bookx_series_id = bs.bookx_series_id ' : '')
. bookx_assemble_filter_extra_join($extra_filter_query_parts['join'], array('series'))
. ' WHERE 1 AND p.products_status !=0 ' . bookx_assemble_filter_extra_where($extra_filter_query_parts['where'], array('series'))
. ' ORDER by bs.series_sort_order, bsd.series_name';
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Bookmarks