Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - CleanMart (SKU# FLEX-00015)

TOPIC: VM3. Parse error in select_shipment.php on line 49

VM3. Parse error in select_shipment.php on line 49 9 years 4 months ago #11518

I've upgraded my site to J3.3.6 and VM 3.0.2 and I've installed the new CleanMart template. During checkout, I'm unable to choose a shipping option, and the following error occurs:

Parse error: syntax error, unexpected '}' in [webroot]/html/templates/[mytemplate]/html/com_virtuemart/cart/select_shipment.php on line 49
The administrator has disabled public write access.

VM3. Parse error in select_shipment.php on line 49 9 years 3 months ago #11548

Hi,

That's interesting. I just checked the select_shipment.php file on my localhost and there shouldn't be any syntax error on line 46.
i am copy-pasting the select_shipment.php source below. Copy the lines below and paste them to yours:
<?php
/*------------------------------------------------------------------------
 # Virtuemart Template - CleanMart
 # ------------------------------------------------------------------------
 # Copyright (C) 2009-2014 Flexible Web Design. All Rights Reserved.
 # @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
 # Author: Flexible Web Design
 # Website: http://www.flexiblewebdesign.com
 # Email: [email protected]
 -------------------------------------------------------------------------*/
 
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
include_once dirname(__FILE__) . '/../assets/includes/flexibleMartGlobal.php';
 
?>
 
 
 
<form method="post" id="userForm" target="_parent" name="chooseShipmentRate" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=cart'); ?>" class="form-validate">
<?php
 
 
	echo "<div class=\"checkout-content-inner\">";
		$buttonclass = 'default'; 
	?> 
 
 
 
 
<? echo "<div id=\"checkoutbarInner\" class=\"active\">".JText::_('COM_VIRTUEMART_CART_SELECT_SHIPMENT')."</div>";    
 
 if ($this->found_shipment_method) { ?>
	<div class="floatright">
	<button class="<?php echo $buttonclass ?>" type="submit" ><?php echo JText::_('COM_VIRTUEMART_SAVE'); ?></button>  &nbsp;
	<button class="<?php echo $buttonclass ?>" type="reset" onClick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=cart'); ?>'" ><?php echo JText::_('COM_VIRTUEMART_CANCEL'); ?></button>
	</div>
 
	 <?php  echo "<fieldset>\n";
	// if only one Shipment , should be checked by default
	    foreach ($this->shipments_shipment_rates as $shipment_shipment_rates) {
		if (is_array($shipment_shipment_rates)) {
		    foreach ($shipment_shipment_rates as $shipment_shipment_rate) {
			echo $shipment_shipment_rate."<br />\n";
		    }
		}
	    }
	    echo "</fieldset>\n";
    } else {
	 echo '<dl id="system-message">
<dd class="info message">
<ul>
<li>'.JTEXT::_('PLG_FLEXIBLE_REGISTER_FOR_SHIPPING_RATES').'</li>
 </ul>
</dd>
</dl>';
    }
 
    ?>
 
    <input type="hidden" name="option" value="com_virtuemart" />
    <input type="hidden" name="view" value="cart" />
    <input type="hidden" name="task" value="setshipment" />
    <input type="hidden" name="controller" value="cart" />
 
 
</div>
 
 
</form>
The administrator has disabled public write access.

VM3. Parse error in select_shipment.php on line 49 5 years 7 months ago #15660

My solution:
replace "<?" to "<?php"
In templates\<your-template>\html\com_virtuemart\cart\select_shipment.php at line 32.

(Alternatively simple set short_open_tag=On in your php.ini)
The administrator has disabled public write access.

VM3. Parse error in select_shipment.php on line 49 5 years 7 months ago #15668

Hi,

Thanks for the info Agria, <? was being used long long time ago. PHP doesn't support it by default (but can be enabled via php.ini like you mentioned).

Although I recommend not to enable that feature via PHP.ini file; but correct all the php files that has <? open tag.

Regards.
The administrator has disabled public write access.
Time to create page: 0.218 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo