Great. Note, too, that I've created a v500 branch on the repo: https://github.com/lat9/ZCA-Bootstra...late/tree/v500
v3.7.3 of the ZCA Bootstrap template is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2191
This release contains changes associated with these GitHub issues:
#316: Don't display back-to-top on small/medium devices.
#386: Use the $template class to locate site_specific_styles.php.
#411: Add the zc210 notifier to the account_history_info page's template.
#417: Submitted keywords to AJAX search must be a 'string'.
#419: Display shipping module's error messages in the shipping-estimator.
#421: "Align" with zc210's implementation for the order_status page's template.
#422: Split CSS/JS loading into separate modules; was in common/html_header.php.
#426: ezpages :: page_is_ssl removed in zc210; default always to 'SSL'.
#428: Recognize zc210's mobile-menu settings for EZ-Pages.
#429: Add support for zc210's "Featured Categories" feature.
#432: Correct layout inconsistency between "Notification" and "Manufacturers Info" centerboxes.
#434: Correct background-color bleed-through on various card classes.
#435: Centerbox Background Color applied to containing cards, not the wrapper.
I had the following problems with the bestsellers displayed in the sideboxes:
- In Configuration -> Maximum Values -> Best Sellers for Box I had to put in 11 to display 10 bestseller.
- The number 1 bestseller was never displayed. It started with the second best selling item.
I fixed it by modifying includes/templates/bootstrap/sideboxes/tpl_best_sellers.php.
Line 19
should beCode:for ($i = 1, $j = count($bestsellers_list); $i<$j; $i++) {
Line 22Code:for ($i = 0, $j = count($bestsellers_list); $i<$j; $i++) {
should beCode:$i . '. ' .
Somebody check please.Code:$i+1 . '. ' .
I forgot to add:
Zen Cart version 1.5.8a
Bootstrap 3.7.0
i can confirm the first item, but not the 2nd item; ie if you needed to have 1 more then the max to display that number.
BUT, the #1 best seller was displayed in my setup.
my fix:
in my setup, your line 22 fix, is not correct.Code://from for ($i = 1, $j = count($bestsellers_list); $i<$j; $i++) { // to for ($i = 1, $j = count($bestsellers_list); $i<=$j; $i++) {
my $bestsellers_list is an array. and the first array element is 1. if your first array element is 0 (which is possible if you have an override of the bestseller module; and i will note that your version of bootstrap does not); then i can see how your code would be correct.
best.
I do not have an override of the bestseller module.
This code is the original code. I just added the first line (echo $bestsellers_list[0]['name'];) to access the first element in the array, which is position 0.
Result looks like this. The item above the "Bestseller" headline is the best selling item at array position 0.Code:echo $bestsellers_list[0]['name']; if ($is_carousel === false) { $content = '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="list-group-flush sideBoxContent">' . "\n"; for ($i = 1, $j = count($bestsellers_list); $i<$j; $i++) { $content .= '<a class="list-group-item list-group-item-action" href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . $i . '. ' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a>'; } $content .= "</div>\n"; return; }
![]()
actually you are correct.
i am running a module that is overriding the bestseller list; and is using an older version of the module.
the change did happen in v158a, and specifically this commit:
https://github.com/zencart/zencart/c...980bee4b28f972
the old code was like this:
the index value being the var $rows, and here, it starts at 1.PHP Code:$rows = 0;
while (!$best_sellers->EOF) {
$rows++;
$bestsellers_list[$rows]['id'] = $best_sellers->fields['products_id'];
...
the new code is like this:
with no explicit setting of the index, it will definitely start at 0.PHP Code:$bestsellers_list = [];
foreach ($best_sellers as $bestseller) {
$best_products_id = $bestseller['products_id'];
$bestsellers_list[] = [
'id' => $best_products_id,
'name' => $bestseller['products_name'],
...
good catch.
as to what is the most eloquent way to address this error, i can not say.
but the commit i referenced above is definitely where this bug got introduced.