| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
If statement to display 'check out' button | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() 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?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World - Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com) X-Cart Version 4.1.10 |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() Hi
Just use this: {if $minicart_total_items > 0}Button{/if}
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
#3
|
|||||||||
|
|||||||||
![]() 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:
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.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#4
|
|||||||||
|
|||||||||
![]() 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?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World - Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com) X-Cart Version 4.1.10 |
|||||||||
#5
|
|||||||||
|
|||||||||
![]() 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?
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#6
|
|||||||||
|
|||||||||
![]() 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 ..
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#7
|
|||||||||
|
|||||||||
![]() 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?
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#8
|
|||||||||
|
|||||||||
![]() 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:
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.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#9
|
|||||||||
|
|||||||||
![]() 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.
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#10
|
|||||||||
|
|||||||||
![]() 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.
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|