Where? Sidebox Cart

Hi,



For the life of me I can’t find the sidebox cart.



Was it removed from 2.0? Or am I just too drunk?

To the best of my knowledge, the sidebox cart was removed in v2.



Bob

We’ve modified the droppy cart to a sidebar cart with the following:



This here is skin/customer/blocks/mini_cart.tpl

```php

{** block-description:mini_cart **}


{assign var="header_class" value="mini_cart_sidebar"}
{assign var="sidebox_wrapper" value="sidebox-minicart-wrapper"}
{include file="views/checkout/components/cart_status.tpl"}

```

You can then edit the cart_status template to remove the javascript drop downs and slightly change the layout [B]skin/customer/views/checkout/components/cart_status.tpl[/B]. Ours is as follows:
```php



{if $smarty.session.cart.amount}

{$smarty.session.cart.amount}
{if $smarty.session.cart.amount > 1}{$lang.cart_items_multiple}{else}{$lang.cart_items_singular}{/if}
,
{$lang.subtotal}: {include file="common_templates/price.tpl" value=$smarty.session.cart.display_subtotal}

{else}
{/if}


{if $smarty.session.cart.amount}

    {hook name="index:cart_status"}
    {foreach from=$smarty.session.cart.products key="key" item="p" name="cart_products"}
    {if !$p.extra.parent}

  • {if !"CHECKOUT"|defined || $force_items_deletion}
    {include file="buttons/button.tpl" but_href="$index_script?dispatch=checkout.delete.from_status&cart_id=`$key`" but_meta="cm-ajax" but_rev="cart_status" but_role="delete" but_name="delete_cart_item"}

    {/if}
    {$p.product_id|fn_get_product_name}

    {$p.amount} x {include file="common_templates/price.tpl" value=$p.display_price span_id="price_`$key`" class="none"}

  • {if !$smarty.foreach.cart_products.last}

    {/if}
    {/if}
    {/foreach}
    {/hook}


{$lang.checkout}

{else}
  • {$lang.cart_is_empty}


{$lang.browse_for_products}

{/if}


```


Note - I have no idea whether or not this is the correct way to do such a thing. My biggest reservation is that include - it looks a little dodgy. But for the life of me I can't find any decent documentation, and this solution works (without modifying any functional code, I might add).

I'm guessing if you want both a sidecart and a droppy js cart you would need to use assigned smarty variables for the cart_status.tpl to remove the cm-* classes, as the PHP controllers are hardcoded to use this template file.

will have to try this out! I reviewed your code and like your approach!



thanks,

tony

Used your method with a variety of changes, but overall, came out very nice. Much nicer for the customer to see the list of products in their cart all the time. For people who ship “products” versus “services”, the addition of a shipping estimator would be very nice.

This is a really great little mod. I have put it on my testing site and have made a couple of changes and it seems to be working well except for one thing.



What I am trying to do is to add the product thumbnail to the sidebox. I just can’t figure it out.



Here is what I have so far:







I know that the code that controls the thumbnails is this:


{include file="common_templates/image.tpl" image_width=50px obj_id=$key images=$p.product.main_pair object_type="product"} {$p.product_id|fn_get_product_name}




What am I doing wrong? I can get the right id, but I just can’t get the image to come up.



Any help would be greatly appreciated.



Thank you,



Brandon

One other thing I just noticed is that the main cart shows the newest added product on top where the mini cart shows it on bottom. How can this be changed so that they match?



Again,



Thank you,



Brandon

I really need this however I have found that it doesn’t update when you add an item into the cart unless the user refreshes the page.



Are you others having the same problem?



Gotta say trying to work with the templates in 2.0.8 is absolutely frustrating and if there was another shopping cart with the same features as CS Cart I would dump CS Cart today. I have been with it since it started and it is getting harder and harder to understand.



I also heavily use vBulletin and that is so simple compared to this smarty system

Ian



Yeah, I had the same problems with the mini-cart. I ended up just dumping it. It would be cool to have this work right though, but it is above me.



As for the templates, it took me a while to learn, but now I am very comfortable with them. I jumped into 1.3.x with basically no knowledge besides some basic html and yet I was able to learn. By the way, that last satement is saying something. If I can learn than anyone can, trust me.



Brandon