by
7,300 16
0
6
2,641
0
Top 1% !
Popular
Famous
Tagged
Specified
OpenSource
Popularity: 6548th place
Extensionphtml
LanguagePHP
LicenseMIT_X11
TechnologyAJAX

Magento PHTML Ajax with parameter

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/111768/Magento-PHTML-Ajax-with-parameter?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
function generatereport() { var AjaxURL = "<?php echo $this->getURL('inventorycostadmin/adminhtml_report/generateestgrprofitcogs');?>"; AjaxURL = AjaxURL + (AjaxURL.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true'); new Ajax.Request(AjaxURL, { parameters: {querystr: "<?php echo $newQuery; ?>"}, onSuccess: function(valueinfo) { if (valueinfo.responseText.isJSON()) { var response = valueinfo.responseText.evalJSON(); if (response.error) { alert(response.message); } else { $('reportdiv').update('<b>Total Gross Profit for filtered period : </b>'+response.formattedgrossprofit+'<br><b>Total Cost of Goods Sold for filtered period : </b>'+response.formattedcostofgoodssold+'<br><b>Total Sales for filtered period : </b>'+response.formattedgoodssoldprice); } } } }); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus