Forums / Templates, Stylesheets, Page Layout / Having issue on local wamp set up

Having issue on local wamp set up

Views: 1,419

Results 1 to 7 of 7
10 Feb 2012, 7:58 PM
#1
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Having issue on local wamp set up

I create a website on my local wamp server using Aberdeen Neutral template provided by picaflor-azul.

I'm having an issue on this template: the website I set up on my local wamp server cannot correctly display the shopping cart's content. It shows:

SHOPPING CART - count_contents();?> item(s) - format($_SESSION['cart']->show_total());?>

According to the author Anne of the template's explanation, it is caused by wamp instead of the template.

According to Anne, the problem will get resolved if I switch to xamp from wamp. However, my switch failed after I installed xamp, most likely some setting was wrong or for whatever reason, anyway, I really know little about apache, php etc, the wamp works fine for me except for this shopping cart issue.

I wonder if someone can tell me how to track down the problem and get it sorted out? I'm sure this issue can be resolved within wamp.

Thank you very much.

(I tried to contact Anne, maybe she is busy or for whatever reason, even my question on her website is not approved to show there, so I have to seek help here. Thank you. )

12 Feb 2012, 3:05 AM
#2
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Having issue on local wamp set up

I hardly think this has anything to do with your Wamp server .
looks like missing opening php tag <?php

as result php is not being parsed but being written as just a text .

12 Feb 2012, 8:01 PM
#3
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Having issue on local wamp set up

tony_sar:

I hardly think this has anything to do with your Wamp server .
looks like missing opening php tag <?php

as result php is not being parsed but being written as just a text .

Thanks. I don't think it is caused by Wamp either.

Could you take a look at the following code which I believe is to generate the header (I retrieve this from tpl_header.php):

   <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a> | </li>                                                                        
    <li><?php echo '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">'; ?><?php echo HEADER_TITLE_CONTACT_US; ?></a> | </li>
   <?php if ($_SESSION['customer_id']) { ?>
   <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a> | </li>
   <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | </li>
<?php
  } else {
   if (STORE_STATUS == '0') {
?>
     <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a> | </li>
	<?php } } ?>
  <li><img src="includes/templates/aberdeen_neutral/images/cart.jpg" class="cart-image" alt="the shopping cart" /><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?> - <? echo $_SESSION['cart']->count_contents();?> item(s) - <? echo $currencies->format($_SESSION['cart']->show_total());?></a> | </li>
	<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
	<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
   <?php }?>
12 Feb 2012, 8:03 PM
#4
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Having issue on local wamp set up

Here is the screenshot, thanks.

13 Feb 2012, 6:25 AM
#5
drbyte avatar

drbyte

Sensei

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

Re: Having issue on local wamp set up

mdivk:

<? echo $_SESSION['cart']->cou...
The use of "<?" instead of "<?php" is called "short open tags", and apparently your PHP installation is configured to NOT allow use of short-open-tags.

So, either change all the uses of <? to <?php EVERYWHERE or reconfigure your PHP settings (php.ini) to allow short open tags.

.
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 Feb 2012, 7:45 AM
#6
rtwedt avatar

rtwedt

New Zenner

Join Date:
Feb 2012
Posts:
1
Plugin Contributions:
0

Re: Having issue on local wamp set up

Cool...I had the same issue and this solved the problem....

I thought I read somewhere when I was setting up php to not allow short tags, because all modern code uses the long tags...is that the preferred configuration?

19 Feb 2012, 8:32 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Having issue on local wamp set up

Starting since PHP v5.3.x, which is the current version as of today, prevents the use of short-open-tags by default.

But the upcoming PHP 5.4, which is in release-candidate-testing phase, has allegedly turned the feature back on again by default.

You can see the details here: http://www.php.net/

As far as smart coding practice is concerned, one should generally be in the practice of using the longer tags. That's the most-compatible approach nowadays, and will be the best-practice until PHP 5.3 is no longer used on any servers anywhere ... probably a decade from now LOL

.
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.