If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / [Not a bug] TEXT_TOTAL_ITEMS seems to ignore the SHOW_TOTALS_IN_CART switch setting

[Not a bug] TEXT_TOTAL_ITEMS seems to ignore the SHOW_TOTALS_IN_CART switch setting

Locked

Started by shrimp_gumbo_mmmhhh on 19 Aug 2009, 6:26 AM · Views: 1,973

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
19 Aug 2009, 6:26 AM
#1
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

[Not a bug] TEXT_TOTAL_ITEMS seems to ignore the SHOW_TOTALS_IN_CART switch setting

Maybe this has been fixed in 1.3.8a ... I am using 1.3.7

This code does not appear to be working right:

/includes/modules/pages/shopping_cart/header_php.php
/includes/modules/shipping_estimator.php

// altered to include Tare adjustment
// totals info
$totalsDisplay = '';
switch (true) {
case (SHOW_TOTALS_IN_CART == '1'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
break;
case (SHOW_TOTALS_IN_CART == '2'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($shipping_weight > 0 ? TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
break;
case (SHOW_TOTALS_IN_CART == '3'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
break;
}

I had to comment out $totalsdisplay for it not to display....
Shipping/Packaging -> Display Number of Boxes and Weight Status set to 0

I believe you get just about the same text whether 0,1,2, or 3 are selected.

19 Aug 2009, 2:03 PM
#2
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: [Not a bug] TEXT_TOTAL_ITEMS seems to ignore the SHOW_TOTALS_IN_CART switch setting

**/includes/languages/english.php
****Line #549 : define('CART_OT_SHOW','true'); // set to false if you don't want order totals **

This value may be currently used for the SHOW_TOTALS_IN_CART ... since the 1st option always showed up....

19 Aug 2009, 6:12 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: [Not a bug] TEXT_TOTAL_ITEMS seems to ignore the SHOW_TOTALS_IN_CART switch setting

shrimp-gumbo-mmmhhh:

// totals info
$totalsDisplay = '';
switch (true) {
case (SHOW_TOTALS_IN_CART == '1'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
break;
case (SHOW_TOTALS_IN_CART == '2'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($shipping_weight > 0 ? TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
break;
case (SHOW_TOTALS_IN_CART == '3'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
break;
}

...

I believe you get just about the same text whether 0,1,2, or 3 are selected.
Well, technically it's impossible for a 0 to cause it to display anything, based solely on the snippet of code you posted, since a 0 would leave $totalsDisplay set to ''.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Aug 2009, 6:16 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: [Not a bug] TEXT_TOTAL_ITEMS seems to ignore the SHOW_TOTALS_IN_CART switch setting

shrimp-gumbo-mmmhhh:

case (SHOW_TOTALS_IN_CART == '1'):
...
I had to comment out $totalsdisplay for it not to display....
Shipping/Packaging -> Display Number of Boxes and Weight Status set to 0

I believe you get just about the same text whether 0,1,2, or 3 are selected.
Hmm ...

SHOW_TOTALS_IN_CART is the deciding factor.
And the option you said you're editing has nothing to do with that.

shrimp-gumbo-mmmhhh:

Shipping/Packaging -> Display Number of Boxes and Weight Status set to 0That corresponds with this constant: SHIPPING_BOX_WEIGHT_DISPLAY
And that's used by shipping modules to decide on whether to display that information as part of shipping quotes

The SHOW_TOTALS_IN_CART setting comes from Layout Settings:> Shopping Cart - Show Totals

Description: Show Totals Above Shopping Cart?
0= off
1= on: Items Weight Amount
2= on: Items Weight Amount, but no weight when 0
3= on: Items Amount

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.