Jump to content

Resolved - display articles in small basket


fabriceunko

Recommended Posts

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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">&hellip;</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}&hellip;</div></li>
         {break}
      {/if}

 

Edited by bsmither
Better coding
Link to comment
Share on other sites

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">&hellip;</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}&hellip;</div></li>
         {break}
      {/if}

 

Hello, what is your code?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 version

Ian

Edited by havenswift-hosting
Link to comment
Share on other sites

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 *}

 

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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}&hellip;</div></li>
    {break}
  {/if}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 852

And 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...