Gossamer Forum
Quote Reply
GoCart problem
I've read the manual, placed what is needed in the link.html template but when I try to make a purchase a blank page appears.
Quote Reply
Re: [jaltuve] GoCart problem In reply to
evidently a template is missing... what is the name of the template being used when the cart.cgi is called?
Quote Reply
Re: [jaltuve] GoCart problem In reply to
FYI.

The GoCart has a bug, if you don't use the standard default templates.
Quote Reply
Re: [jaltuve] GoCart problem In reply to
Thanks for pointing that out.

I thought I had it fixed that but apparently not.
Quote Reply
Re: [Aki] GoCart problem In reply to
Aki, found another one. Already corrected it also.

The HTTP referer should have preference over the cookie value when getting the entry_url variable to continue shopping, otherwise if users shop from multiple locations the cookie value will cause some confusion and incorrect continue shopping referers.

the correct code shoud be:

if ($ENV{HTTP_REFERER} =~ /cart\.cgi/) {
$referido = $IN->cookie( "entry_url" );
}
else {
$referido = $ENV{HTTP_REFERER};
}


$tags->{gocart_to_currency} = dollar_str_subroutine();
$tags->{gocart_to_datestr} = \&timestamp_to_datestr;
$tags->{cid} = $IN->param( "cid" ) || $IN->cookie( "cid" );
$tags->{entry_url} = $IN->param( "entry_url" )
|| $referido
|| $IN->cookie( "entry_url" )
|| $cfg->{cart_bounce_url};

Last edited by:

jaltuve: Mar 15, 2003, 8:45 AM
Quote Reply
Re: [jaltuve] GoCart problem In reply to
Which file needs to edited for this ?

--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Sir Up] GoCart problem In reply to
Change the file located in

admin/Plugins/GOCart.pm
Quote Reply
Re: [Aki] GoCart problem In reply to
Aki,

I can't find any code in GOCart.pm which looks like the code above.

Should the code be added to the present code?

If yes, where ?

--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Sir Up] GoCart problem In reply to
I'll email you the updated GOCart.pm file so you can see where the changes need to be made.
Quote Reply
Re: [Aki] GoCart problem In reply to
Aki, found other bug.

under mod_perl the cart can not be updated.

Last edited by:

jaltuve: Mar 31, 2003, 8:59 AM
Quote Reply
Re: [jaltuve] GoCart problem In reply to
I edited mod_perl.pm and added:

Plugins:GOCart

is this necessary? or it is not needed?
Quote Reply
Re: [jaltuve] GoCart problem In reply to
Is there an error?
Quote Reply
Re: [jaltuve] GoCart problem In reply to
Does the shopping cart simply not work or is it something to do with the configuration options?
Quote Reply
Re: [Aki] GoCart problem In reply to
Aki, here's what i've found so far.

The error log shows this:

Code:
[Mon Mar 31 14:49:40 2003] [error] Can't locate Payment.pm in @INC (@INC contains: /home/simrada/public_html/forums/cgi-bin/admin /home/simrada/www/forums/cgi-bin/admin ../.. /home/simrada/public_html/cgi-bin/scripts/admin /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . /usr/local/apache/ /usr/local/apache/lib/perl) at /home/simrada/www/cgi-bin/scripts/cart.cgi line 58."my" variable $db masks earlier declaration in same scope at (eval 706) line 4.
"my" variable $db masks earlier declaration in same scope at (eval 708) line 7.
"my" variable $db masks earlier declaration in same scope at (eval 712) line 5.
"my" variable $db masks earlier declaration in same scope at (eval 717) line 11.
"my" variable $db masks earlier declaration in same scope at (eval 720) line 5.
"my" variable $db masks earlier declaration in same scope at (eval 724) line 4.
"my" variable $db masks earlier declaration in same scope at (eval 727) line 6.
"my" variable $db masks earlier declaration in same scope at (eval 728) line 4.
"my" variable $db masks earlier declaration in same scope at (eval 734) line 6.
"my" variable $row masks earlier declaration in same scope at (eval 734) line 9.
"my" variable $db masks earlier declaration in same scope at (eval 738) line 6.
"my" variable $row masks earlier declaration in same scope at (eval 738) line 9.
"my" variable $db masks earlier declaration in same scope at (eval 741) line 6.
"my" variable $time_norm masks earlier declaration in same scope at (eval 741) line 21.
"my" variable $db masks earlier declaration in same scope at (eval 742) line 6.
"my" variable $time_norm masks earlier declaration in same scope at (eval 742) line 21.
Use of uninitialized value in sprintf at /home/simrada/public_html/cgi-bin/scripts/admin/Plugins/GOCart/Payment/Invoice.pm line 298.


The exact problem i'm having is the following:

user browses products ->

User adds product to car -> (if first time running then error 500) if not then it correctly shows quantity



Now, here's where the problem starts. if yiu try to change quantity when in the cart in get all messed up. sometimes it updates it, sometimes it doens't some times when you try to advance to the next screen it tells you you don't have any products in your cart, altough in the previuous screen (cart) you had the products corretly listed. I'm sure this problem is related to this:

ame="quantity<%order_row%>"

Why is the name of the quantity field appended with <%order_row%> in the templates? now look at the error log I sent you. does it help?
Quote Reply
Re: [jaltuve] GoCart problem In reply to
Never seen that error before from the cart. I've checked my copy of the code and it doesn't have the usual suspects for those errors in it.

Mind PM''ing or emailing me the access information to your server so I can have a look at it? My email is aki@gossamer-threads.com
Quote Reply
Re: [Aki] GoCart problem In reply to
I think the problem could be related to Apache::DBI caching querys or something like that. regarding access to my server I'll send you the details so you can have a look at the problem.
Quote Reply
Re: [jaltuve] GoCart problem In reply to
make sure you update the quantities in your cart, including making it 0 t empty the cart
Quote Reply
Re: [jaltuve] GoCart problem In reply to
That error means two variables are being declared with my() inside the same block.

Can you take a look in the code at the lines mentioned in the errors and see if you can see two same name variables.

eg...

Code:
my $foo = 1;

...some code...

my $foo = 2;

Last edited by:

Paul: Mar 31, 2003, 1:47 PM
Quote Reply
Re: [Paul] GoCart problem In reply to
paul, thanks for pointing that out.

I had globals declaring it twice, hence when the gocart script called this global i had the errors show up. however the problem still exists. I've narrowed the error to just .

Use of uninitialized value in sprintf at /home/simrada/public_html/cgi-bin/scripts/admin/Plugins/GOCart/Payment/Invoice.pm line 298

looks to me that this error is related to a subroutine doing something to detect changes in the cart. something related to a dirty call or something. maybe it was not propertly tested with mod_perl??
Quote Reply
Re: [jaltuve] GoCart problem In reply to
It's not specifically mod_perl related, it's just that when you load modules into mod_perl they are checked for warnings and that is why you see the errors. If you removed the script from mod_perl and added -w to the shebang line then the same errors would show.

eg....

Code:
#!/usr/bin/perl -w

print "Content-type: text/html\n\n";
print sprintf $foo, $bar;

...that would give the same error as you are getting because $foo and $bar don't exist. You will need to check which of the variables being passed into sprintf are undeclared and trace it back to see why it isn't declared.
Quote Reply
Re: [Paul] GoCart problem In reply to
here's the code:

That's the line giving me the problems... $true_grandtotal seems to be properly declared before. however, i don't know how to trace "%.${dec_places}f", that's out of my league.


Code:
$data_payload->{GrandTotal} = sprintf "%.${dec_places}f", $true_grandtotal;
Quote Reply
Re: [jaltuve] GoCart problem In reply to
${dec_places} is just $dec_places - the brackets are put around it do distinguish it from the "f" otherwise perl would think the variable was called $dec_placesf
Quote Reply
Re: [Aki] GoCart problem In reply to
I think the problem is much much worse than what I anticipated.

if I try to change any option in the admin screen the checkout screen does not shows anything but a hash reference. I diff'ed the .cfg files with unchanged ones and every time an autoblock reference was changed or removed the problem was present.

Aki, I don't think this is just ME, this is definitely a major bug in the code, which evidently was untested with mod_perl. I run my enviroment exclusively under mod_perl, so if I had known this before you can bet i've not installed this software. Please, do whatever is in your hands to resolve this matter, I've already emailed you access to my server.