現在、e コマース ソフトウェア Volusion にスライダーを実装しようとしています。
価格が変更された場合に情報を変更したいので、名前、価格、画像を含むいくつかの製品を動的に移植できるようにしたいと考えています。
私は Volusion ヘルプ チャットで複数の担当者とチャットしていましたが、CSV ファイルを使用するように言われましたが、製品が変更されるたびにダウンロードする必要があるため、役に立ちません。私自身で調べてみたところ、Volusion では URL を使用して XML 情報を取得できることがわかりました。
誰かが情報を解析して、スライダーで設定できるようにしてくれると助かります。以下のコードを提供しました。
ありがとう!
URL の例:
http://www.companyname.com/net/WebService.aspx?Login=usr@companyname.com&EncryptedPassword=xxxx&EDI_Name=Generic \Products&SELECT_Columns=p.ProductName,pe.ProductPrice
XML 出力の例:
<xmldata>
<Products>
<ProductName>ABC Widget</ProductName>
<ProductPrice>4445545</ProductPrice>
</Products>
<Products>
<ProductName>XYZ Widget</ProductName>
<ProductPrice>99494</ProductPrice>
</Products>
</xmldata>
HTML:
<img class="arrow" src="vspfiles/templates/default/images/arrow-left.png">
<div class="product">
<a href="#"><img src="vspfiles/templates/default/images/product-1.jpg"></a>
<h4>Product Title and description</h4>
<h5>$00.00</h5>
</div>
<div class="product">
<a href="#"><img src="vspfiles/templates/default/images/product-1.jpg"></a>
<h4>Product Title and description</h4>
<h5>$00.00</h5>
</div>
<div class="product">
<a href="#"><img src="vspfiles/templates/default/images/product-1.jpg"></a>
<h4>Product Title and description</h4>
<h5>$00.00</h5>
</div>
<div class="product">
<a href="#"><img src="vspfiles/templates/default/images/product-1.jpg"></a>
<h4>Product Title and description</h4>
<h5>$00.00</h5>
</div>
<img class="arrow" src="vspfiles/templates/default/images/arrow-right.png">
Javascript:
$(document).ready(function(){
$.ajax({
type: "GET",
url: "Insert URL",
dataType: "xml",
success: function (xml) {
$(xml).find('Products').each(function(){
var $p = $(this);
var pId = $p.find('ProductId').text();
var html = 'Testing: ' + pId + '<br />';
$('#output').append($(html));
});
}
});
});