Ajax Problem - Please Help

Ajax Problem - Please Help

mcaleermcaleer Posts: 11Questions: 2Answers: 0

I was finally able to get my Child Rows to work by strictly using Ajax, however, there is an important piece of information that i am trying to include in my table. (add to cart button).

My Ajax Code looks like this:

{
  "data": [
{foreach from=$items item='entry' name='pos'}
{ldelim}
"item":"{$entry->fields.item->value}",
"part_number":"{$entry->product_name}",
"models":"{$entry->details}",
"description":"{$entry->fields.description->value}",
"replacement_instructions":"{$entry->fields.instructions->value}",
"list_price":"{$entry->price}",
"net_price":"{($entry->price*.98)|round:2}",
"cart":"{Cart2 sku={$entry->product_name}}"
{rdelim}{if !$smarty.foreach.pos.last},{/if}
{/foreach}
]
}

Which seems to break my table. When I parse it, it appears as though it does not like what {Cart2 sku={$entry->product_name}} is pulling in for data:

"cart":" <form id="m56561moduleform_1" method="post" action="http://www.nythermal.com/index.php?page=parts-list-trial" class="cms_form" enctype="multipart/form-data"> <div class="hidden"> <input type="hidden" name="mact" value="Cart2,m56561,default,0" /> <input type="hidden" name="m56561returnid" value="137" /> <input type="hidden" name="m56561sku" value="85056" /> <input type="hidden" name="m56561cart_returnto" value="http://www.nythermal.com:0/parts-list-trial?_=1420689904776" /> <input type="hidden" name="m56561supplier" value="Products" /> </div> <input type="submit" name="m56561cart_submit" value="Add to print list"/></form> "

Would there be any possible way work around for this and make it work? Is there such thing as using some ajax data and some other source?? The button works in various other example just not with the ajax call. Any help would be awesome!

Replies

This discussion has been closed.