After setting up a Yahoo store through their Merchant Service, I was impressed by their user-friendly store catalog. This led me to use the service for another business I own as well. However, I encountered some issues when trying to call the Yahoo Catalog Tags, which essentially act as comments within the code (
<!--#ystore_order id=item_id -->
). These tags are supposed to load product details on the site.
Although most aspects were functioning correctly, I struggled with setting the action attribute for my form.
Various attempts were made to resolve this issue, including hardcoding the tag, but this would require creating separate pages for each product. One approach involved adding the comment/tag to the form's action attribute using JavaScript and jQuery.
<script language="javascript">
$.ajaxSetup({cache: false});
$(document).ready(function(){
var obj = getUrlVars()["Object"];
$('form').attr('action', '<!--#ystore_order id='+ obj +' -->');
});
</script>
I also experimented with dynamically generating the form using JavaScript, still without success.
<script language="javascript">
$.ajaxSetup({cache: false});
$(document).ready(function(){
var obj = getUrlVars()["Object"];
var new_form = '<form method="post" action="<!--#ystore_order id='+obj + ' -->">' +
'<input type="submit" value="Add To Cart" id="btnSubmit">' +
'</form>';
$('#list').append(new_form);
});
</script>
Even attempts to escape certain characters have not yielded any positive results. It seems that the issue lies in the syntax of the comments, making it difficult to dynamically incorporate them into the form.
If anyone has a potential solution, I am willing to provide access to my site for testing purposes. This problem has consumed over 30 hours of troubleshooting without resolution.