Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Do not count certain Items

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-20-2008, 04:22 AM
  AquaClic's Avatar 
AquaClic AquaClic is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 37
 

Default Do not count certain Items

Is there a way to exclude certain products from being counted in the minicart.php?

Just an example of how we intend to make it work: If the price of the Product is below 10$ it lands in the cart but the minicart does not show it as 1 Item. We have a category with small parts and stuff that are not really products and we wish that the customer can see them in his cart but that they are not listed/counted on Xcart's vanilla minicart.
Or if it makes it simpler: If the Product is from category A than it should be ignored in the minicart count...

Thanks for any clue
__________________
Xcart version 4.1.10
Reply With Quote
  #2  
Old 10-20-2008, 04:50 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Do not count certain Items

Don't you think that would become very confusing to the customer? I add one of these to my cart but it doesn't show it.... so I add another. Later I see (or don't see) that what I have chosen is not in my cart.... so I leave. See what I mean?

Anyway, to answer your question. No, I don't think X-cart will function properly if it doesn't list every product in the cart. You could add something that says don't display items under 10$ but then the customer would wonder why the total doesn't match what is listed.
__________________
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
Reply With Quote
  #3  
Old 10-20-2008, 05:40 AM
  AquaClic's Avatar 
AquaClic AquaClic is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 37
 

Default Re: Do not count certain Items

Thanks for the fast reply


I agree, in a "normal" store it wouldn't make much sense to do it like this

But the products that are meant to be ignored in the total count are really peanuts. People order much bigger stuff from us and showing them their nuts and bolts which they ordered in a "small spare parts" category just bothers the customer (we've had feedback about that in our old shop)
And now we want to start with the new shop without usability issues that were ruled out in an older shop...

What i need basically is the piece of code marked as XXXXXXXXXX to achieve my goal

Code:
$MINICART["total_items"] = 0; if (!empty($cart["products"]) and is_array($cart["products"]) and XXXXXXXXXX>10) { foreach ($cart["products"] as $_tmp) $MINICART["total_items"] += $_tmp["amount"]; } if (!empty($cart["giftcerts"]) and is_array($cart["giftcerts"])) $MINICART["total_items"] +=$cart["giftcerts"]; } $smarty->assign("minicart_total_cost", $MINICART["total_cost"]); $smarty->assign("minicart_total_items", $MINICART["total_items"]); ?>

EDIT: Oh sorry, maybe there was a misunderstanding here. I'm talking only about the Minicart display. Not the Cart itself
__________________
Xcart version 4.1.10
Reply With Quote
  #4  
Old 10-20-2008, 05:13 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Do not count certain Items

Well, the minicart only displays the number of different items (not like 3 if you have 3 of the same item, but 1) and the total (without tax and shipping).

Are you saying you don't want small items (under $10) in the total?
The problem is, minicart.tpl doesn't figure the totals, it just displays them.
__________________
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
Reply With Quote
  #5  
Old 10-21-2008, 04:22 AM
  AquaClic's Avatar 
AquaClic AquaClic is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 37
 

Default Re: Do not count certain Items

I edited my minicart.php to show 3 items if there are even 3 of the same kind in there

Here's the How-to:
http://forum.x-cart.com/showthread.php?t=29370

And no, these small items under 10$ are to be listed in the totals but just not to be counted in the minicart (in the left vertmenulist).

They are still being displayed normally in the cart when the customer clicks "show cart" since i edit only the minicart.php file.
Just the amount of them should not be counted in the minicart, that's it. All i need is the missing variable in the code i posted above (at least i think so )
__________________
Xcart version 4.1.10
Reply With Quote
  #6  
Old 10-21-2008, 05:05 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Do not count certain Items

The problem appears to be that minicart is simply pulling the totals from cart. I'm no expert in php, but it looks like it would difficult to modify the cart and keep two running totals of the quantity of items in the cart. Have you tried $product["amount"] as the variable?
__________________
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
Reply With Quote
  #7  
Old 10-21-2008, 07:08 AM
  AquaClic's Avatar 
AquaClic AquaClic is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 37
 

Default Re: Do not count certain Items

Technically it would still be only one quantity and not 2 different. Since the minicart.php does not affect the func.cart.php it does not matter what one likes to display there, important is only that func.cart.php remains unchanged and everything will be fine.

The cart and it's contents are not affected in any way, only the minicart would show something different.

At least that's what i've found out about the minicart.php
Anyone please correct me if i'm wrong
__________________
Xcart version 4.1.10
Reply With Quote
  #8  
Old 10-28-2008, 04:12 AM
  AquaClic's Avatar 
AquaClic AquaClic is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 37
 

Default Re: Do not count certain Items

Does anyone at least have a clue where i could search for the missing piece of code?
__________________
Xcart version 4.1.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:54 PM.

   

 
X-Cart forums © 2001-2020