解析错误:语法错误,PHP代码中意外的文件结束

时间:2017-06-14 19:49:53

标签: php

我已阅读this个问题,但我仍然无法解决错误。

   <?php
$_product = $_product = $this->getProduct();
$expired = Mage::helper('deal')->isProductExpired($_product->getId());
?>
<div id="scroller-anchor">
    <div id="offer-sales-bar">
        <div class="container">
            <div class="row">

                <div class="span3 top-spacer-10">
                    <!-- AddThis Button BEGIN -->
                    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                        <a class="addthis_button_preferred_1"></a>
                        <a class="addthis_button_preferred_2"></a>
                        <a class="addthis_button_preferred_3"></a>
                        <a class="addthis_button_preferred_4"></a>
                    </div>
                    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
                    <script type="text/javascript"
                            src="http://s7.addthis.com/js/300/addthis_widget.js"></script>
                    <!-- AddThis Button END -->
                </div>

                <div class="span9" id="deal-show-vitals">
                    <?php if ($expired): ?>
                    <div class="pull-right" id="deal-show-vitals-buy">
                        <a data-deal_id="<?php echo $_product->getId();?>" href="#"
                           data-toggle="modal" class="btn btn-large btn-teambuy-pink font-large"
                           id="buy-button-disabled">
                            <strong>SOLD OUT</strong> </a>
                    </div>
                    <? else: ?>
                    <div class="pull-right" id="deal-show-vitals-buy">
                        <a onclick="submitform();" data-deal_id="<?php echo $_product->getId();?>" href="#"
                           data-toggle="modal" class="btn btn-large btn-g font-large"
                           id="buy-button">
                            <strong>BUY</strong> <?php echo $this->getPriceCurrency($_product->getPrice()); ?> </a>
                    </div>
                    <?php endif;?>
                    <div id="deal-show-vitals-pricevalue">
                        <span class="font-regular2">
                            <strong><?php echo $this->__('Save') . ': ' . (int)((($_product->getOriginalPrice() - $_product->getPrice()) / $_product->getOriginalPrice()) * 100) . '%'; ?></strong>
                        </span>
                        <br>
                        <?php echo $this->__('Value') . ': ' . $this->getPriceCurrency($_product->getOriginalPrice()); ?>
                    </div>
                    <?php if (!$expired): ?>
                    <div id="deal-show-vitals-numbuys">
                        <span class="font-regular2">
                            <strong><?php echo (int)$this->ordered_qty . ' ' . $this->__('BOUGHT');?></strong>
                        </span>
                        <br>
                    <span class="circles">
                        <?php if ($this->ordered_qty >= $_product->getMinQty()):
                        for ($i = 1; $i <= $_product->getMinQty(); $i++) {
                            ?>
                            <span class="full"></span>
                            <?php
                        } else:
                        for ($i = 1; $i <= $_product->getMinQty(); $i++) {
                            ?>
                            <span class="<?php echo $i <= $this->ordered_qty ? 'full' : 'empty';?>"></span>
                            <?php }endif;?>

                        </span>
                        <!--
                    <span class="min">
                        <?php
                            $left = (int)$_product->getMinQty() - (int)$this->ordered_qty;
                            if ($left <= 0) {
                                echo $this->__('Minimum of %s Reached', (int)$_product->getMinQty());
                            } else {
                                if ($left == 1) {
                                    echo $this->__('Just one more needed!');
                                } else {
                                    echo $this->__('%s more needed', $left);
                                }
                            }
                            ?>
                    </span>
                    -->
                    </div>
                    <?php endif;?>
                    <div id="deal-show-vitals-timeleft">
                        <i class="icon-time"></i>
                        <span class="font-regular2">
                            <strong>
                                <div class="product-time-left">

                                    <?php if ($expired): ?>
                                    <div id="countdowncontainer"><?php echo Mage::helper('deal')->__('Sorry, this deal has already expired')?></div>
                                    <?php else: ?>
                                    <div id="countdowncontainer"></div>
                                    <script type="text/javascript">
                    <?php
                        // Calculate the absolute seconds difference here on the server
                        $end_date = strtotime($_product->getEndDate());
                        $todate = time();
                        $sec_diff = ($end_date - $todate);
                    ?>
                    var target_cs_time = new Date().getTime() + <?php echo $sec_diff; ?> * 1000;
                                        // var futuredate = new cdtime("countdowncontainer", "<?php echo date('F d, Y 00:00:00', strtotime($_product->getEndDate()));?>")
                                        var futuredate = new cdtime("countdowncontainer", target_cs_time);
                                        futuredate.displaycountdown("days", formatresults)
                                    </script>
                                    <?endif;?>
                                </div>
                            </strong>
                        </span>
                        <br>
                        <?php if (!$expired): ?>
                        <?php echo $this->__('Time Left To Buy'); ?>
                        <?php endif;?>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>
<script type="text/javascript">
    function sticky_relocate() {
        var window_top = jQuery(window).scrollTop();
        var div_top = jQuery('#scroller-anchor').offset().top;
        if (window_top > div_top) {
            jQuery('#offer-sales-bar').addClass('stick');
        }
        else
            jQuery('#offer-sales-bar').removeClass('stick');
    }
    jQuery(document).scroll(function () {
        sticky_relocate();
    });
    sticky_relocate();
</script>

0 个答案:

没有答案