fabriceunko Posted June 5, 2015 Share Posted June 5, 2015 Hello, since the update in 6.0.5. display of the small basket displays only the first 10 items purchase by the customer. Is it possible to change for this to be the last items to buy. with an offset upwardly each time the customer purchases an article. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2015 Share Posted June 5, 2015 Should be an easy change. I do not yet know what was changed to limit the display to 10 -- I hope it was an skin change as this limitation was an aspect of the skin layout only! Thus, it should be a skin display logic adjustment to show the last ten in reverse order (most recent at the top). Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 5, 2015 Share Posted June 5, 2015 This was a recent GitHub change - if the list was long enough it previously covered up the buttons needed to see full basket or checkout. I'll try to find it and be back. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2015 Share Posted June 5, 2015 (edited) In the Foundation template file box.basket.content.php:Find: {foreach from=$CONTENTS item=item name=items} {if $smarty.foreach.items.index == 10} <li class="clearfix"><div class="left">…</div></li> {break} {/if} Change to: {$CONTENTS = $CONTENTS|array_reverse}{* Remove this line if list is already reversed *} {foreach $CONTENTS as $items=>$item} {if $smarty.foreach.items.index == 10} <li class="clearfix"><div class="left">{$LANG.common.more}…</div></li> {break} {/if} Edited June 6, 2015 by bsmither Better coding Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 5, 2015 Share Posted June 5, 2015 Here's the original GitHub discussion. https://github.com/cubecart/v6/issues/496 Quote Link to comment Share on other sites More sharing options...
fabriceunko Posted June 5, 2015 Author Share Posted June 5, 2015 In the Foundation template file box.basket.content.php:Find: {foreach from=$CONTENTS item=item name=items} {if $smarty.foreach.items.index == 10} <li class="clearfix"><div class="left">…</div></li> {break} {/if} Change to: {$CONTENTS|array_reverse}{* Remove this line if list is already reversed *} {foreach $CONTENTS as $items=>$item} {if $smarty.foreach.items.index == 10} <li class="clearfix"><div class="left">{$LANG.common.more}…</div></li> {break} {/if} Hello, what is your code? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2015 Share Posted June 5, 2015 The CubeCart (versions 5 and 6) use a template rendering engine named Smarty. The template is a mix of HTML and Smarty template code. Quote Link to comment Share on other sites More sharing options...
fabriceunko Posted June 5, 2015 Author Share Posted June 5, 2015 what does your code compared to the original? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2015 Share Posted June 5, 2015 In CC604, the shopping cart side basket shows everything that was added to the basket. Once the number of items in the basket exceed 12 or so items, the height of the basket was so tall that the buttons at the bottom, View Basket and Checkout, were hidden below the bottom of your computer monitor.In CC605, the code to show the side basket limits the number to show to the first ten items. However, after that, there is no indication of any more additions to the basket. You see the first ten items and that is all.The edit above takes the array of items that have been added to the shopping basket and reverses the order. Thus, when showing only ten of however many items there have actually been added to the shopping basket, it is the last ten items that will always show. Quote Link to comment Share on other sites More sharing options...
LaughingHorse Posted June 5, 2015 Share Posted June 5, 2015 Out of curiosity, if the list was so long it was covering up buttons, why did it not become a scrollable list? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2015 Share Posted June 5, 2015 I can only make an incredibly uneducated guess. And it may eventually end up as a scrollable list. Quote Link to comment Share on other sites More sharing options...
fabriceunko Posted June 5, 2015 Author Share Posted June 5, 2015 Good evening,if I understand. for I am no English and I use google translate to communicate with you.the code to the top, will display the latest items bought? instead of the top 10? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2015 Share Posted June 5, 2015 Will display the last ten items added to the shopping basket. Quote Link to comment Share on other sites More sharing options...
fabriceunko Posted June 6, 2015 Author Share Posted June 6, 2015 Hello, I just test you your code, but it does not. his hands the basket that bug when adding a lot of this Article hide buttons, if I removed your code, the basket is good that displays the first 10 items added. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted June 6, 2015 Share Posted June 6, 2015 (edited) Displaying all items in the basket in reverse order of them being added and in a scrollable list has got to be better than the fixed list of 10 that it is now. I have updated the github issue with this comment so hopefully it willbe changed in a future versionIan Edited June 6, 2015 by havenswift-hosting Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2015 Share Posted June 6, 2015 Sorry, the code didn't come out right.Above, where I gave: {$CONTENTS|array_reverse}{* Remove this line if list is already reversed *} Change to: {$CONTENTS = $CONTENTS|array_reverse}{* Remove this line if list is already reversed *} Quote Link to comment Share on other sites More sharing options...
fabriceunko Posted June 6, 2015 Author Share Posted June 6, 2015 Hello, it works better. but in my test. after 19 Articles added, the small basket out of the screen. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 6, 2015 Share Posted June 6, 2015 Are all 19 showing? Could you provide a screen shot? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2015 Share Posted June 6, 2015 (edited) In the code that was replaced, try this better format:Was: {if $smarty.foreach.items.index == 10} Now: {if $item@index == 10}I don't have more than ten products in my development store, so someone else will have to verify this edit. Edited June 6, 2015 by bsmither Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2015 Share Posted June 6, 2015 In this conversation, there has been a mix of Smarty 2 and Smarty 3 syntax styles. So, the complete Smarty 3 syntax is:{$CONTENTS = $CONTENTS|array_reverse}{* Remove this line if list is already reversed *} {foreach $CONTENTS as $item} {if $item@index == 10} <li class="clearfix"><div class="left">{$LANG.common.more}…</div></li> {break} {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2015 Share Posted June 6, 2015 I got some Q&D code to make the mini-basket popup have a scroll bar instead of truncating the list to show only the last ten items added.But then I realized, the mini-basket popup only appears for four seconds.Is four seconds reasonably sufficient to get the mouse pointer on the scroll elevator and scroll the list to find what you need to find?I suppose the javascript (mini_basket_action() in 2.cubecart.js) could be enhanced to have a permanent delay if the mouse is hovering over the area. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 6, 2015 Share Posted June 6, 2015 Testing it now. All worked fine in the basket, just as expected. But when I clicked to see the whole basket, I got this error:Notice: `name` is not allowed as a key in 'CubeCart_config' table! in /home3/butter01/public_html/plushcatalog/classes/db/database.class.php on line 852And the basket was empty when I went back to home. Hopefully unrelated to this, but we never have sales with more than a couple of items at a time, so I've never put that much in my basket before. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2015 Share Posted June 6, 2015 Where is the error displayed? If you have CubeCart's debug enabled, the database query section should show which query the fault is on. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2015 Share Posted June 6, 2015 `name` is a column name in the CubeCart_config table. For CubeCart to say it is not means CubeCart lost connection to the database or the CubeCart_config table has crashed. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 6, 2015 Share Posted June 6, 2015 I just tried it again with 11 items, and it went through fine. Must have been a momentary internet/server hiccup. I think you're right - scroll would not be helpful. More should be enough, as it shows the number in the basket. I did change mine to More... That seems a bit more intuitive to me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.