我正在尝试实施基于ajax的产品详细信息页面,点击现有产品详细信息页面中的链接,我们需要使用新产品详细信息更新现有详细信息。在这里,我面临着使用AJAX加载可配置产品及其选项的问题。如果我使用AJAX,可配置产品的选项(下拉)不加载。请帮忙
对于Ex)在产品详细信息页面中加载PRODUCT-A,在同一页面中我有一个链接打开PRODUCT-B,点击链接我需要刷新产品详细信息页面,其中包含PRODUCT-B的数据。但media.phtml应保持不变(无需刷新media.phtml)
目前我的实施方式如下
View.phtml代码
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct();
?>
<script type="text/javascript">
var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
</script>
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml()?></div>
<div class="product-view">
<div class="media-outer" style="border:solid red 1px;">
<?php echo $this->getChildHtml('media') ?>
</div>
<div class="product-essential-outer" style="border:solid green 1px;">
<!-- essential.phtml -->
<?php echo $this->getChildHtml('essential') ?>
<!-- essential.phtml -->
</div>
<div class="review-summary-outer" style="border:solid blue 1px;">
<?php echo $this->getChildHtml('reviewsummary') ?>
</div>
<div class="alert-urls-outer" style="border:solid black 1px;">
<?php echo $this->getChildHtml('alert_urls') ?>
</div>
<div class="product-type-data-outer" style="border:solid #FF00FF 1px;">
<?php echo $this->getChildHtml('product_type_data') ?> <!-- This block loads from Additional block dependant on product type -->
</div>
<div class="tier-price-outer" style="border:solid #0000FF 1px;">
<?php echo $this->getChildHtml('tierprices') ?>
</div>
<div class="extrahint-outer" style="border:solid #003300 1px;">
<?php echo $this->getChildHtml('extrahint') ?>
</div>
<div class="prod-form-outer" style="border:solid #660033 1px;">
<!-- viewform.phtml -->
<?php echo $this->getChildHtml('viewform') ?>
<!-- viewform.phtml -->
</div>
<div class="social-like-buttons-outer" style="border:solid #990000 1px;"> <!-- START OF MAIN SOCIAL GROUP -->
<?php echo $this->getChildHtml('social'); ?>
</div> <!-- eND OF MAIN SOCIAL GROUP -->
<div class="related-outer" style="border:solid #0066FF 1px;">
<?php echo $this->getChildHtml('related'); ?>
</div>
<div class="product-collateral" style="border:solid #000099 1px;">
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
<div class="box-collateral <?php echo "box-{$alias}"?> fltLeft">
<?php if ($title = $this->getChildData($alias, 'title')):?>
<h2><?php echo $this->escapeHtml($title); ?></h2>
<?php endif;?>
<?php echo $html; ?>
</div>
<?php endforeach;?>
<?php echo $this->getChildHtml('upsell_products') ?>
<?php echo $this->getChildHtml('product_additional_data') ?>
</div>
<div class="product-review-data-outer" style="border:solid #333300 1px;">
<?php echo $this->getChildHtml('product_review_data') ?>
</div>
</div>