I'm trying to get up to speed with a MODX Evo site I inherited and updated to 1.0.5. Have made a local copy for testing on my Wamp server and the installation was all green lights; the manager looks fine and is working properly.
However, the site preview gives me this:
documentIdentifier == 359){ return; } if($modx->getLoginUserID() > 0){ $user = $modx->getWebUserInfo($modx->getLoginUserID()); } else { $user = array( "id" => '0' ); } $modx->toPlaceholders($user, "user."); include_once('cart.php'); $cart = new cart; $basket = $cart->load(); if(isset($_REQUEST['cart'])){ $quantity = (int)$_REQUEST['cart']; if($quantity > 0){ $cart->add_to_cart($modx->documentIdentifier, $quantity); $modx->sendRedirect($modx->makeURL(15)); } } if(isset($_POST['post']) && $_POST['post'] == "update_cart"){ //here //var_dump($_POST['product']); if( isset($_POST['product']) && is_array($_POST['product']) ){ $cart->emptyCart(); foreach($_POST['product'] as $product_id => $quantity){ //var_dump($quantity); $cart->add_to_cart($product_id, $quantity, "yes"); } $basket = $cart->load(); $modx->sendRedirect($modx->makeURL(15)); } } $modx->toPlaceholders($basket, "cart."); ?>
Parse error: parse error in C:\wamp\www\KnitCollage\web\content\web_assets\snippets\mgr.php on line 15
The mgr.php file:
<?php
$user = $modx->getLoginUserID('mgr');
if($user > 0){
?>
<style type="text/css">
.shop_left .patterns {
display: block;
}
</style>
<?
}
I've never seen a snippet file that didn't end with a closing php tag, but adding one doesn't fix the error. Strangely, the remote site works and doesn't give the parse error so it doesn't seem to mind the strange snippet.
Any suggestions for fixing this snippet, if it is if fact broken...?
[ed. note: lucy last edited this post 14 years, 7 months ago.]