我收到此错误:
解析错误:第30行> /home/bijouven/public_html/app/design/frontend/default/magikjewellery/template/checkout/success.phtml>中的语法错误,意外''(T_STRING)
这是success.phtml的第30行:
$ orderObj = Mage :: getModel('sales / order') - > loadByIncrementId($ this-> getOrderId());
这是整个代码:
<?php
/**
* Theme: Magik Jewellery
* Author: MagentoMagik.com
* Version: 1.5
* URL: http://www.magentomagik.com/magento-themes/free-magento-themes/magik-jewellery-magento-theme/
* Source: http://www.magentomagik.com/ piono checkout success dineromail
**/
?>
<div style="text-align:center;">
<div class="page-head">
<h2><?php echo $this->__('') ?></h2>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div style="position: absolute; z-index: 0;">
<img src="<?php echo($this->getSkinUrl('images/success.png')) ?>" alt="" usemap="#Map" style="border:5px solid #333; margin-top:4px;">
</div>
<div style="position: relative; z-index: 1;">
<br>
<br>
<br>
<br>
<br>
<br>
<?php
//loading the order object
$orderObj = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
//get all the items included on the order.
/* $orderItems = $orderObj->getAllItems();
//do a loop to get the sku of each item
foreach($orderItems as $item)
{
//you can either echo each sku of the order / you can use array variable to pass items sku’s
echo $item->getSku();
} */
$orderSubTotal = $orderObj ->subtotal;
$orderGrandTotal = $orderObj ->grand_total;
$orderGrandTotal = number_format($orderGrandTotal, 2, '.', '');
$email = $orderObj ->customer_email;
$firstname = $orderObj ->customer_firstname;
$lastname = $orderObj ->customer_lastname;
$payment_method = $orderObj->getPayment()->getMethodInstance()->getCode();
$phone = $orderObj ->getShippingAddress()->getData("telephone");
switch ($payment_method){
case cashondelivery:
$payment_method = "contra";
break;
case banktransfer:
$payment_method = "deposito";
break;
case checkmo2:
$payment_method = "ar_visa;ar_master;ar_argencard;ar_amex;ar_tnaranja;ar_cabal;ar_tshopping;ar_italcred;";
break;
case checkmo1:
$payment_method = "ar_pagofacil;ar_rapipago;ar_cobroexpress;ar_bapropago;";
break;
default:
$payment_method = "other";
}
if ($payment_method == "contra")
{
?>
<strong>
<?php if ($this->canPrint()) :?>
<?php echo $this->__('Tu número de pedido es el #: <a href="%s">%s</a>', $this->getViewOrderUrl(), $this->getOrderId()) ?>.
<?php else :?>
<?php echo $this->__('Tu número de pedido es el #: %s', $this->getOrderId()) ?>.
<?php endif;?><br><br>
</strong>
<br/><br><br>
<strong>
<?php echo $this->__('En breve recibirás un mail de confirmación con los detalles') ?>
</strong>
<br/><br><br><br><br><br>
<?php if ($this->canPrint()) :?>
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
<?php endif;?>
<?php echo $this->getChildHtml() ?>
</div>
<?php /*?><div class="button-set">
<button type="button" class="form-button" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><?php echo $this->__('Continue Shopping') ?></span></button>
</div><?php */?>
</div><?php
}
if ($payment_method == "deposito")
{
?>
<span>Se ha enviado un mail con los detalles del pedido a <?php echo $email?></span>
<br>
<br>
<strong>
Datos de la cuenta bancaria donde efectuar el depósito/transferencia:
</strong>
<span>
<br>
BANCO SANTANDER RIO
<br>
CUENTA CORRIENTE NUMERO: 367303/6
<br>
SUCURSAL FLORESTA 020
<br>
TITULAR: Martin Kruszyn
<br>
CUIT: 20345839489
<br>
CBU: 0720020588000036730368
Una vez realizado el depósito/transferencia por favor enviar comprobante a:<br>
info@bijouventas.com.ar.
<br>
Una vez acreditado el pago, le enviaremos su pedido en un plazo de 48-72 horas hábiles.
</span>
<br/>
<?php if ($this->canPrint()) :?>
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
<?php endif;?>
<?php echo $this->getChildHtml() ?>
</p>
</div>
<?php /*?><div class="button-set">
<button type="button" class="form-button" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><?php echo $this->__('Continue Shopping') ?></span></button>
</div><?php */?>
</div>
<?php
}
if ($payment_method != "other" && $payment_method != "deposito" && $payment_method != "contra")
{ ?>
<strong>
<?php if ($this->canPrint()) :?>
<?php echo $this->__('Tu número de pedido es el #: <a href="%s">%s</a>', $this->getViewOrderUrl(), $this->getOrderId()) ?>.
<?php else :?>
<?php echo $this->__('Tu número de pedido es el #: %s', $this->getOrderId()) ?>.
<?php endif;?><br><br>
</strong>
<td width="100%" align="center">
<form action="https://checkout.dineromail.com/CheckOut" target="_self" method="post" id="dineromail">
<input type="hidden" name="merchant" value="bijouventaspagina@gmail.com">
<input type="hidden" name="country_id" value="1">
<input type="hidden" name="language" value="es">
<input type="hidden" name="currency" value="ars">
<input type="hidden" name="change_quantity" value="0">
<input type="hidden" name="display_shipping" value="0">
<input type="hidden" name="payment_method_available" value="<?php echo $payment_method?>">
<input type="hidden" name="transaction_id" value="<?php echo $this->getOrderId() ?>">
<input type="hidden" name="display_additional_charge" value="0">
<input type="hidden" name="seller_name" value="Bijou Ventas">
<input type="hidden" name="buyer_name" value="<?php echo $firstname ?>">
<input type="hidden" name="buyer_lastname" value="<?php echo $lastname ?>">
<input type="hidden" name="buyer_phone" value="<?php echo $phone ?>">
<input type="hidden" name="buyer_email" value="<?php echo $email ?>">
<input type="hidden" name="header_image" value="http://bijouventas.com.ar/skin/frontend/default/magikjewellery/images/logo.png">
<?php /*<input type="hidden" name="pending_url" value="http://casamundial.com.ar/index.php?option=com_virtuemart&page=checkout.resultdm&er=1&order_id=2558">
<input type="hidden" name="error_url" value="http://casamundial.com.ar/index.php?option=com_virtuemart&page=checkout.resultdm&er=2&order_id=2558">
*/ ?>
<input type="hidden" name="ok_url" value="http://bijouventas.com.ar/index.php/">
<input type="hidden" name="item_name_1" value="A pagar">
<input type="hidden" name="item_quantity_1" value="1">
<input type="hidden" name="item_ammount_1" value="<?php echo $orderGrandTotal ?>">
<input type="hidden" name="item_currency_1" value="ars">
<br><b>PARA TERMINAR SU COMPRA, DEBE EFECTUAR EL PAGO.</b>
<br><b>EN CASO DE NO SER REDIRECCIONADO AL SITIO DE DINERO MAIL, HAGA CLICK EN EL BOTON DE ABAJO</b><br><br>
<input type="image" src="https://argentina.dineromail.com/imagenes/botones/pagar-medios_c.gif" border="0" name="submit" alt="Pagar con Dineromail">
<br>Usted sera redirigido a nuestra plataforma de pago online automaticamente <br><br>
<!-- Google Code for Compra Carrito Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 975718772;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "5-yCCOSYgAgQ9JKh0QM";
var google_conversion_value = 1.00;
var google_conversion_currency = "ARS";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/975718772/?value=1.00&currency_code=ARS&label=5-yCCOSYgAgQ9JKh0QM&guid=ON&script=0"/>
</div>
</noscript>
<script>setTimeout('document.getElementById("dineromail").submit();',1500);</script>
</form>
</td>
<?php
} ?>
<!-- Facebook Conversion Code for Pixel Comprar -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6016863737486', {'value':'0.00','currency':'ARS'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6016863737486&cd[value]=0.00&cd[currency]=ARS&noscript=1" /></noscript>
添加“;”并从回声中消除“(”&amp;“)”。仍然得到同样的错误 第1-30行之间的新代码:
<?php
/**
* Theme: Magik Jewellery
* Author: MagentoMagik.com
* Version: 1.5
* URL: http://www.magentomagik.com/magento-themes/free-magento-themes/magik-jewellery-magento-theme/
* Source: http://www.magentomagik.com/ piono checkout success dineromail
**/
?>
<div style="text-align:center;">
<div class="page-head">
<h2><?php echo $this->__(''); ?></h2>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>
<div style="position: absolute; z-index: 0;">
<img src="<?php echo $this->getSkinUrl('images/success.png'); ?>" alt="" usemap="#Map" style="border:5px solid #333; margin-top:4px;">
</div>
<div style="position: relative; z-index: 1;">
<br>
<br>
<br>
<br>
<br>
<br>
<?php
//loading the order object
$orderObj = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
答案 0 :(得分:1)
<?php
和第一个$
之间可能存在非空格。使用BACKSPACE删除所有内容,包括注释,然后使用ENTER重新创建它们。有很多偷偷摸摸的角色看起来像白色空间,但实际上并非如此。
unexpected ' ' (T_STRING)
看起来像一个非空白字符。