mhac rojas
mhac rojas

Reputation: 33

Opencart cart page error in localhost

Can someone help me on this simple problem? I have using opencart and hosted it in GoDaddy. I created development server so that I could test the design and functions before I upload it to live. But this made me crazy because everything is working fine when I upload the live site to development server. But when I create a test order, I got an error in checkout/cart which says "Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\catalog\view\theme\default\template\checkout\cart.tpl on line 308"

I am so confused because the cart.tpl is working on the live site and that error showed on the development server. I don't have any idea why it is happening.

Info: I am using XAMPP as my php server I am using Opencart v1.5.6.4 on the development server while v.1.5.5.1 on the live site. Is there any problem with it? Hope you guys throw some help.

Thanks, Mark

Upvotes: 0

Views: 492

Answers (2)

Debflav
Debflav

Reputation: 1151

Concerning this error you have few unclosed braces }.

The error occured at line 60:

<?php if (!$product['stock']) { ?>
<div class="list_produ_name"><a href="<?php echo $product['href']; ?>"><font color="red"><?php echo $product['name']; ?></font></a><?php $product['custID']; ?>
<? } else { ?>
<div class="list_produ_name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a><?php $product['custID']; ?>
<? } ?>

I guess it's not working because you are using php short open tag tag "<?" and short_open_tagare disabled by default. So the solution is to change the "<?" to "<?php"

<?php if (!$product['stock']) { ?>
<div class="list_produ_name"><a href="<?php echo $product['href']; ?>"><font color="red"><?php echo $product['name']; ?></font></a><?php $product['custID']; ?>
<?php } else { ?>
<div class="list_produ_name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a><?php $product['custID']; ?>
<?php } ?>

Upvotes: 1

Shajibur Rahman
Shajibur Rahman

Reputation: 466

I think you forgot to put closing braces}, Better you post your code. Also, you can see by changing the PHP tag weather problem solve or not

Upvotes: 0

Related Questions