View Single Post
  #21  
Old 05-31-2015, 02:39 AM
SteveOrg's Avatar
SteveOrg SteveOrg is offline
 
Join Date: Mar 2013
Posts: 56
Default

Since I had already been turned down by tech support for the old code, I assume that Ecwid will not post it here. I'd sure like to know why.

In any case, I tracked down a website that is still using the old single product widget, and I used the sample to develop the code I need on my site. The only drawback is that the code does not include pricing or discounts. I had to put them in manually. Maybe Ecwid could post the additional code for prices and discounts?

The source of the code is http://www.squeaky-kids.co.uk/handma...let-shoes.html, but the site seems to be down now. The product has options. Here's the code. "519141" is the store number.

Code:
<div class='ecwid-Product'><form>
<div style='text-align: center; padding-bottom: 10px;'><script type="text/javascript" src="http://app.ecwid.com/script.js?519141" charset="utf-8"></script><script type="text/javascript">xProductThumbnail('productid=6302363');</script></div>
<div class='ecwid-productBrowser-head' style='text-align: center; padding-bottom: 15px; font: normal 20px tahoma, geneva, verdana, sans-serif'>Silver Ballet Shoes (Soft leather Sole Baby Shoes, toddlers slippers, would be a great gift for 1st Birthday or Christmas)</div>
<div class="ecwid-productBrowser-price" style='text-align: center; padding-bottom: 15px'><span>&pound;</span>13.50</div>
<table align='center' border='0'><tr><td align='left' class='ecwid'><div class="ecwid-productBrowser-details-optionPanel ecwid-productBrowser-details-optionPanel-radio ecwid-productoption-Size-container" id="ecwid-productoption-6302363-Size-container"><label for="gwt-uid-759" class="ecwid-fieldLabel">Size</label><div id="gwt-uid-759"><span id="ecwid-productoption-6302363-Size-12-18_months:002c_12.5cm" class="gwt-RadioButton ecwid-productBrowser-details-optionRadioButton ecwid-productoption-Size-12-18_months:002c_12.5cm"><input checked="" tabindex="0" id="gwt-uid-757" value="on" name="6302363-Size" type="radio"><label for="gwt-uid-757"><span class="ecwid-productBrowser-details-optionRadioButton-name">12-18 months, 12.5cm</span></label></span><span id="ecwid-productoption-6302363-Size-18-24_months:002c_13.5cm" class="gwt-RadioButton ecwid-productBrowser-details-optionRadioButton ecwid-productoption-Size-18-24_months:002c_13.5cm"><input tabindex="0" id="gwt-uid-758" value="on" name="6302363-Size" type="radio"><label for="gwt-uid-758"><span class="ecwid-productBrowser-details-optionRadioButton-name">18-24 months, 13.5cm</span></label></span></div></div><div class="ecwid-productBrowser-details-optionPanel ecwid-productBrowser-details-optionPanel-radio ecwid-productoption-Gift_Wrapping-container" id="ecwid-productoption-6302363-Gift_Wrapping-container"><label for="gwt-uid-762" class="ecwid-fieldLabel">Gift Wrapping</label><div id="gwt-uid-762"><span id="ecwid-productoption-6302363-Gift_Wrapping-No:002c_thank_you" class="gwt-RadioButton ecwid-productBrowser-details-optionRadioButton ecwid-productoption-Gift_Wrapping-No:002c_thank_you"><input checked="" tabindex="0" id="gwt-uid-760" value="on" name="6302363-Gift Wrapping" type="radio"><label for="gwt-uid-760"><span class="ecwid-productBrowser-details-optionRadioButton-name">No, thank you</span></label></span><span id="ecwid-productoption-6302363-Gift_Wrapping-Birthday_Wrapping" class="gwt-RadioButton ecwid-productBrowser-details-optionRadioButton ecwid-productoption-Gift_Wrapping-Birthday_Wrapping"><input tabindex="0" id="gwt-uid-761" value="on" name="6302363-Gift Wrapping" type="radio"><label for="gwt-uid-761"><span class="ecwid-productBrowser-details-optionRadioButton-name">Birthday Wrapping</span> <span class="ecwid-productBrowser-details-optionRadioButton-price"> <span class="ecwid-productBrowser-details-optionRadioButton-bracket">(</span><span class="ecwid-productBrowser-details-optionRadioButton-sign">+</span><span>£</span>2.00<span class="ecwid-productBrowser-details-optionRadioButton-bracket">)</span></span></label></span></div></div></td></tr></table><div style='text-align: center'><script type="text/javascript" src="http://app.ecwid.com/script.js?519141" charset="utf-8"></script><script type="text/javascript">xAddToBag('productid=6302363');</script></div>
</form></div>
All I needed is the Add to bag button. Here's the code that I extracted for that:
Code:
    
<div>
     <form>
      <div ><script type="text/javascript" src="http://app.ecwid.com/script.js?STOREID" charset="utf-8"></script></div>
      <div><script type="text/javascript" src="http://app.ecwid.com/script.js?STOREID" charset="utf-8"></script><script type="text/javascript">xAddToBag('productid=PRODUCTID');</script></div>
     </form>
    </div>
One last point. Even if Ecwid ever fixes the structured data, it will only be good for one product per page. Google will ignore the snippets if two or more are put on a page.