1

I want to show the SKU of a customizable article. Have a look at the screenshot below.

If I select color, length and so, the price will be updated via ajax. So far, very good. But I want to display the SKU of the article too.

The site calls this url via ajax:

http://SERVER/oi/ajax/co/?id=5106&pid=5114

and returns me the following code:

<script type="text/javascript">
    //<![CDATA[
    window.opConfig = new Product.Options([]);
    $('product_addtocart_form').encoding = 'multipart/form-data';
    //]]>
</script>

which file should I update / alter for this change ?? Where the correct js for this new Product.Options ??

enter image description here

4

1 回答 1

2

我解决了它......好吧。休息后,我想出了以下解决方案:

我已将此代码放在产品的 view.pthtml 中(实际显示产品的 html)

<div style="text-align:left; font-size:11px; font-weight:bold;">
<div id="pv_article_sup_art_no" style="display:none;text-align:right;"></div>
</div>

然后我将以下代码添加到 scpajaxoptions.phtml

<?php 
$data = $this->getProduct()->toArray();
?>

<script type="text/javascript">
    jQuery('#pv_article_sup_art_no').html("Artikelnummer: <?php echo $data['a_sup_artno']; ?>");
    jQuery('#pv_article_sup_art_no').show();
</script>

嗯,瞧……它有效!

于 2012-04-24T10:57:19.040 回答