![]() |
If statement to display 'check out' button
Hi All,
I am not using the mini cart sidebox on my site, and would prefer to have an if statement that I can place in my home.tpl which would display a 'check out' button if there are items in the shopping cart. Can anyone help? |
Re: If statement to display 'check out' button
Hi
Just use this: {if $minicart_total_items > 0}Button{/if} |
Re: If statement to display 'check out' button
Here is what I use....
In customer/home.tpl I added the following at the top of the "menu" column {if $main ne "fast_lane_checkout"} {include file="customer/main/minicart-box.tpl" short_mode="short"} <br />{/if} Then I modified customer/main/minicart.tpl and named it minicart-box.tpl Code:
{* $Id: minicart-box.tpl,v 1.17 2006/03/28 08:21:07 max Exp $ *} The image "top-cart-full.gif" shows a full cart and has text that says "Your Shopping Cart". In essence, what it does is remain invisible until there is something in the cart, then it puts a highlighted box (in my case bright yellow) at the head of the menu column that shows the customer how many items are in the cart, a subtotal, and when clicked takes them to their shopping cart/checkout. |
Re: If statement to display 'check out' button
Thanks Paul,
That worked great but I'd like to add one more thing to the mix - how would I create an exception that would prevent the link from being displayed if the page = cart.php? |
Re: If statement to display 'check out' button
Quote:
Thanks for this nice mod, just what I was looking for! One thing I do not seem to accomplish is how to change the "Items in Cart" and "Subtotal" language variables. I added both variables minicart_total_items and minicart_total_cost as both text and lbl but they still show up in English. Anyone can help out here? |
Re: If statement to display 'check out' button
Anyone can help here? It seems I am missing lng.lbl_cart_items and lbl_total but I don't know how to add them correctly to minicart-box.tpl
[edit] never mind, I already sorted it out. The text was hardcoded .. |
Re: If statement to display 'check out' button
For this mod I'd like to change the "Items in Cart" behaviour. Right now if you add 1 product it will add "1" to the items. But if you change the quantity it still says "1 item in cart". Only if you add a different product the amount will change to 2. Does anyone know how to change this?
|
Re: If statement to display 'check out' button
Quote:
In my example "Items in Cart" and "Subtotal" are hard-coded into minicart-box.tpl. You could make them language variables but I chose not to. As for the other problem of having the cart say "1" is in the cart when the customer ordered 3 of the same item, I actually changed "Items in Cart" to "Unique Items" (again hard-coded). That way if the customer orders 3 of 1 item, 2 of another item, and 1 of a third item, it will say "Unique Items: 3". Not a perfect solution but without getting too complex it works. One thing I have found is that by high-lighting the "minicart box" in a contrasting color (in my case yellow) to the rest of your site, it draws attention to it, so the customer can see a visual difference and "knows" something is in the cart. You would be surprised how many times a customer will click "Add to Cart" if they are not directed to the cart (an option in x-cart to go or not). You could actually change the minicart-box.tpl to Code:
{* $Id: minicart-box.tpl,v 1.17 2006/03/28 08:21:07 max Exp $ *} Also, my "top-cart-full.gif" is not the standard one in x-cart. It has text that says "Your Shopping Cart" to the right of the standard top-cart-full.gif. |
Re: If statement to display 'check out' button
In my site I have changed the background to transparent since this matches the sites design best. Drawing the attention already happens when something is added to the cart because the box suddenly pops-up! I used the "full cart" default image since it has orange in it (one of my primary colors) Clicking on any part of the minicart box takes you to the cart page and that's exactly how I like it now. the only thing I am not sure about is if I want to display "unique items" instead of total items.
|
Re: If statement to display 'check out' button
You can always include other parts of the minicart if you wish (I chose to keep it simple). There is a thread at http://forum.x-cart.com/showthread.php?t=24999&page=7&highlight=descriptiv e+minicart that modifies the minicart to do all sorts of things. If you enclose it in the same "if" statement it will display or not... your choice.
|
All times are GMT -8. The time now is 10:56 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.