Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-03-2004 16:06:17

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Req: 5.1 Mini Cart Shows Items In Cart

I would like to get a mod so that the built in mini cart in 5.1 can show the items (either product number or name) in the cart. with the price of that item next to it:

I.E.


Cart Items

Item A         $xx.xx
Item B         $xx.xx

Total             $xx.xx

View Cart | Checkout


I have the basic mini cart on a customer site I am working on



Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#2 03-04-2004 08:42:43

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Req: 5.1 Mini Cart Shows Items In Cart

In the file ./cgi-bin/library/modules/ste_cart.pl in the routine 'ste_cart_mini' right below:

Code:


$mini_quantity   = "0";
$mini_total      = "0.00";
$mini_totalrecur = "0.00";

Add:

Code:


$mini_items = "";

Then change:

Code:


$sql_statement = "

SELECT cart_prodquantity,cart_amtprod,cart_amtrecur
FROM cart

";

@mini = database_call('cart','SELECT',$sql_statement);

foreach $row(@mini) {

($cart_prodquantity,$cart_amtprod,$cart_amtrecur) = @$row;

$mini_quantity   = ($mini_quantity + $cart_prodquantity);
$mini_total      = ($mini_total + $cart_amtprod);
$mini_totalrecur = ($mini_totalrecur + $cart_amtrecur);

} ######### End of foreach statement.

To:

Code:


$sql_statement = "

SELECT cart_prodquantity,cart_prodname,cart_prodnumber,cart_amtprod,cart_amtrecur
FROM cart

";

@mini = database_call('cart','SELECT',$sql_statement);

foreach $row(@mini) {

($cart_prodquantity,$cart_prodname,$cart_prodnumber,$cart_amtprod,$cart_amtrecur) = @$row;

$mini_items .= "Item: $cart_prodnumber - $cart_prodname<BR>";

$mini_quantity   = ($mini_quantity + $cart_prodquantity);
$mini_total      = ($mini_total + $cart_amtprod);
$mini_totalrecur = ($mini_totalrecur + $cart_amtrecur);

} ######### End of foreach statement.

if ($mini_items =~ /\<BR\>$/) {

chop($mini_items);
chop($mini_items);
chop($mini_items);
chop($mini_items);

} ######### End of if statement.

This will get the items available as (CGIVAR)mini_items(/CGIVAR).


Nick Hendler

Offline

 

#3 03-04-2004 09:36:37

superhero2000
Member
From: Harrisburg, PA
Registered: 03-26-2003
Posts: 1025
Website

Re: Req: 5.1 Mini Cart Shows Items In Cart

Chris,

I know this is off the subject, but I was browsing the site and noticed that under the category of Eastwood Furniture, under each category, the menu along the top breaks and there are spaces between them.  Not sure if you had noticed this, but I wanted to give you a heads up.   


Vinh
VQC Designs, LLC


Offline

 

#4 03-05-2004 00:16:43

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Req: 5.1 Mini Cart Shows Items In Cart

superhero2000 - thanks I did not see that, the images are to large is why it is pushing that out. 

Sometimes you look at something so long you miss the obvious :-(


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#5 03-05-2004 00:20:53

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Req: 5.1 Mini Cart Shows Items In Cart

Nick,

I just made these change but they cart items still do not show up. Any ideas?


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#6 03-12-2004 10:29:19

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Req: 5.1 Mini Cart Shows Items In Cart

Can you post your code from your site layout file (only the mini-cart portion)?


Nick Hendler

Offline

 

#7 03-12-2004 13:54:28

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Req: 5.1 Mini Cart Shows Items In Cart

here it is:

Code:

<table border="0" cellspacing="0" cellpadding="4" width="100%" bgcolor="#E1E1E1" style="border-collapse: collapse; border: 1px dotted #C0C0C0">
         <tr>
           <td width="100%" align="center"><b><a href="(CGIVAR)common_url(/CGIVAR)&pg=cart">Cart Summary</a></b>
         </td>
         </tr>
         <tr>
         <td width="100%" class="content2">
<b>Cart Items:</b><BR>
<a href="(CGIVAR)common_url(/CGIVAR)&pg=cart">(CGIGET TYPE="SUB" VALUE="ste_cart_mini")</a>
<br><br>
<b>Cart Items in Cart:</b> (CGIVAR)mini_quantity(/CGIVAR)<br>
<b>Total:</b> (CGIVAR)currency_symbol(/CGIVAR)(CGIVAR)mini_total(/CGIVAR)
<BR><br><center>
<A class="blue" HREF="(CGIVAR)common_url(/CGIVAR)&pg=cart">View Cart</A> :: <A class="blue" HREF="(CGIVAR)common_url_checkout(/CGIVAR)">Checkout</A>
</center></td>
         </tr>
         <tr>
         <td width="100%" class="content2" bgcolor="#FFFFFF">
<center><img border="0" src="(CGIVAR)images_path(/CGIVAR)/site/reps.jpg" width="143" height="228"><br><br><img border="0" src="(CGIVAR)images_path(/CGIVAR)/site/secure.jpg" width="167" height="103"></center></td>
         </tr>
       </table>

Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#8 03-12-2004 13:59:55

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Req: 5.1 Mini Cart Shows Items In Cart

Add:

(CGIVAR)mini_items(/CGIVAR)

To that somewhere.


Nick Hendler

Offline

 

#9 03-19-2004 01:08:22

Big Dave
Member
Registered: 10-24-2003
Posts: 742

Re: Req: 5.1 Mini Cart Shows Items In Cart



You have a total of 3 items in your cart.
The total one-time charge is $32.97.
The total weight is 10.500 Pounds.

Item: Blue Wigit - Blue Wigit
Item: Green Wigit - Green Wigit




You have a total of 3 items in your cart.
The total one-time charge is $32.97.
The total weight is 10.500 Pounds.

Item: Blue Wigit - Blue Wigit - (Qty. 2)
Item: Green Wigit - Green Wigit - (Qty. 1)


Can you please tell me how to make this happen?
Below is the code from my ste_cart.pl and also from my site layout file.

Thank you.

Code:

#######################################################################
# Ste Cart Mini                                                       #
#######################################################################

sub ste_cart_mini {

&initialize_sub_add('ste_cart_mini');

#########
######### This routine gets info from the cart for a mini-cart display.
#########

$mini_quantity   = "0";
$mini_total      = "0.00";
$mini_totalrecur = "0.00";
$mini_weight = "0.000";
$mini_items = "";


if (-e "$data_temp_path/$fd_usr.$data_table_ext") {

my @mini = ();
my $row = "";

$sql_statement = "

SELECT cart_prodquantity,cart_prodname,cart_prodnumber,cart_amtprod,cart_amtrecur,cart_prodshipweight
FROM cart

";

@mini = database_call('cart','SELECT',$sql_statement);

foreach $row(@mini) {

($cart_prodquantity,$cart_prodname,$cart_prodnumber,$cart_amtprod,$cart_amtrecur) = @$row;

$mini_items .= "Item: $cart_prodnumber - $cart_prodname<BR>";

$mini_quantity   = ($mini_quantity + $cart_prodquantity);
$mini_total      = ($mini_total + $cart_amtprod);
$mini_totalrecur = ($mini_totalrecur + $cart_amtrecur);
$mini_weight = ($mini_weight + ($cart_prodshipweight * $cart_prodquantity));

} ######### End of foreach statement.

if ($mini_items =~ /\<BR\>$/) {

chop($mini_items);
chop($mini_items);
chop($mini_items);
chop($mini_items);

} ######### End of if statement.

$mini_total      = sprintf("%.2f", $mini_total);
$mini_totalrecur = sprintf("%.2f", $mini_totalrecur);
$mini_weight = sprintf("%.3f", $mini_weight);

@mini = ();

} ######### End of if statement.

&initialize_sub_remove('ste_cart_mini');

} ######### End of subroutine.

Code:

(CGIGET TYPE="SUB" VALUE="ste_cart_mini")

You have a total of (CGIVAR)mini_quantity(/CGIVAR) items in your cart.<BR>
The total one-time charge is  (CGIVAR)currency_symbol(/CGIVAR)(CGIVAR)mini_total(/CGIVAR).
<br>
The total weight is (CGIVAR)mini_weight(/CGIVAR) Pounds.
<br><br>
(CGIVAR)mini_items(/CGIVAR)
<br><br>

Offline

 

#10 03-19-2004 10:52:11

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Req: 5.1 Mini Cart Shows Items In Cart

Change:

Code:


$mini_items .= "Item: $cart_prodnumber - $cart_prodname<BR>";

To:

Code:


$mini_items .= "Item: $cart_prodnumber - $cart_prodname - (Qty: $cart_prodquantity)<BR>";


Nick Hendler

Offline

 

#11 03-19-2004 11:25:32

Big Dave
Member
Registered: 10-24-2003
Posts: 742

Re: Req: 5.1 Mini Cart Shows Items In Cart

Thank you Nick, but I have one other question.
Below is how it shows:


You have a total of 8 items in your cart.
The total one-time charge is $87.92.
The total weight is 28.000 Pounds.

Item: Blue Wigit - Blue Wigit - (Qty: 1)
Item: Red Wigit - Blue Wigit - (Qty: 2)
Item: Green Wigit - Green Wigit - (Qty: 5) - 5

Please note the
It puts the number after which ever the last item added is, and is equal to the quantity of the last item added.
How do we get rid of that?

Thank you again.

Offline

 

#12 03-19-2004 11:31:24

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Req: 5.1 Mini Cart Shows Items In Cart

I think you have:

- (CGIVAR)mini_quantity(/CGIVAR)

In your HTML.


Nick Hendler

Offline

 

#13 03-19-2004 12:14:37

Big Dave
Member
Registered: 10-24-2003
Posts: 742

Re: Req: 5.1 Mini Cart Shows Items In Cart

Thank you again!

Offline

 

#14 04-08-2004 16:01:35

acetracer
Member
Registered: 02-20-2004
Posts: 48

Re: Req: 5.1 Mini Cart Shows Items In Cart

How do I add the price for each item instead of just the subtotal? I want like a $mini_price variable, but when I look for a regular product price field to call from SQL, I couldn't find it.

For example, I want

You have a total of # items in your cart.
Item: ID - Name - Item Price
Item: ID - Name - Item Price
Item: ID - Name - Item Price

Your subtotal is $SubtotalPrice.

Offline

 

#15 10-11-2005 19:04:19

celdirect
Member
From: UK
Registered: 04-01-2005
Posts: 782

Re: Req: 5.1 Mini Cart Shows Items In Cart

HI,

Is there anyway to make the item display in to clickable url to the products that are in the mini cart?

cheers
Charlie

Offline

 

#16 10-15-2005 12:39:26

tifosi
Member
Registered: 07-28-2004
Posts: 29

Re: Req: 5.1 Mini Cart Shows Items In Cart

acetracer,04/08/2004 04:01:35 PM wrote:

How do I add the price for each item instead of just the subtotal? I want like a $mini_price variable, but when I look for a regular product price field to call from SQL, I couldn't find it.

For example, I want

You have a total of # items in your cart.
Item: ID - Name - Item Price
Item: ID - Name - Item Price
Item: ID - Name - Item Price

Your subtotal is?$SubtotalPrice.

a quick fix

below

Code:

$mini_quantity   = "0";
$mini_total      = "0.00";
$mini_totalrecur = "0.00";
$mini_items      = "";

add

Code:

$cart_prodprice = "0.00";

in the foreach $row(@mini)  loop add

Code:

$cart_prodprice = ($cart_amtprod / $cart_prodnumber);
$cart_prodprice = sprintf("%.2f", $cart_prodprice);

and change mini_items to:

Code:

$mini_items .= "Item: $cart_prodnumber - $cart_prodname - (Price: $cart_prodprice)<BR>";

and if you want the item price to be the product of price*qty then ignore the above and just change the mini_items to

Code:

$mini_items .= "Item: $cart_prodnumber - $cart_prodname - (Price: $cart_amtprod)<BR>";

Offline

 

Board footer