2014-11-04 88 views
0

我得到这个错误:解析错误:语法错误,意外'(T_STRING)

Parse error: syntax error, unexpected ' ' (T_STRING) in >/home/bijouven/public_html/app/design/frontend/default/magikjewellery/template/checkout/success.phtml >on line 30

这是行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> 
      [email protected] 
      <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="bi[email protected]"> 

       <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&amp;page=checkout.resultdm&amp;er=1&amp;order_id=2558"> 
       <input type="hidden" name="error_url" value="http://casamundial.com.ar/index.php?option=com_virtuemart&amp;page=checkout.resultdm&amp;er=2&amp;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&amp;currency_code=ARS&amp;label=5-yCCOSYgAgQ9JKh0QM&amp;guid=ON&amp;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&amp;cd[value]=0.00&amp;cd[currency]=ARS&amp;noscript=1" /></noscript> 

增加了“;”并根据回声消除“(”&“)”。仍然得到同样的错误 新的代码行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

* Hm ... *,可能是'/销售/订单'造成的。 – 2014-11-04 21:12:03

+1

你应该**使用分号关闭**所有**你的PHP语句,例如'<?php echo $ this - > __('')?>'到'<?php echo $此 - > __( ''); ?>'。我在第1-29行之间发现三条违规行为,请修复这些违规行为,看看您是否仍有问题。 – MonkeyZeus 2014-11-04 21:18:56

+0

(不相关(可能):'echo'不是一个函数:'echo($ this-> getSkinUrl(.....') – Rudie 2014-11-04 21:19:01

回答

0

有可能<?php和第一$之间的非空间。使用BACKSPACE删除所有内容,包括评论,然后使用ENTER重新创建它们。有很多鬼鬼祟祟的人物看起来像是白​​色空间,但实际上并非如此。

unexpected ' ' (T_STRING)看起来像一个非空白字符。

+0

第30行包含'('sales/order')',它有两个引号,所以这是我怀疑的一件事情;有些东西没有被填充或者模型出现问题。我尽可能多地测试了OP的代码,但无法重现。 – 2014-11-04 21:41:26

+0

@Rudie 新错误解析错误:语法错误,意外的'$ orderObj'(T_VARIABLE)位于/home/bijouven/public_html/app/design/frontend/default/magikjewellery/template/checkout/success.phtml on line 30 – 2014-11-04 22:25:46

+0

Did你手动删除所有的空格?删除'<?php'和'$'并且手动替换它们。在那里肯定有一个奇怪的角色。 – Rudie 2014-11-04 23:47:50

相关问题