0

What are the steps to be taken care while calling function through controller? I have created button in admin/system/configuration. On button click , function is called. But it is not calling controller function.

URL path is

Mage::getUrl('price/marketplaceprice/ringsbands14k'),

controller file is MarketPlacepriceController.php

  • if you added this in js then do that url: "<?php echo Mage::getUrl('price/marketplaceprice/ringsbands14k');?>", – Qaisar Satti Aug 26 '16 at 6:38
1

In ajax call Write Url like below

function update_14k_rings_bands() { 
    alert("14k rings");
    new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', { 
        url: "url:"<?php echo Mage::getUrl('marketplacereport/marketplacereport/check'); ?>", 
        method:'post', data: { product_id: 1, ggg : 'hhh' }, 
        onSuccess: function(result){ 
            if (result.responseText){ alert(result.responseText); } 
        } 
    }); 
} 

Change config.xml Below code

<admin>
  <!-- This Is For Admin Routers -->
  <routers>
    <adminhtml> 
      <args>
        <modules>
           <marketplacereport before="Mage_Adminhtml">Marketplace_Report_Adminhtml
           </marketplacereport>
        </modules>
      </args>
   </adminhtml>
 </routers>
</admin>

This will work for you .

  • yes, I have written same format only. – jassi Aug 26 '16 at 6:44
  • Can you give full code of that ajax call, and also check my updated answer – Murtuza Zabuawala Aug 26 '16 at 6:45
  • function update_14k_rings_bands() { new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', { url: "<?php echo Mage::getUrl('price/marketPlaceprice/check');?>", method:'get', data: { product_id: 1 }, onSuccess: function(result){ if (result.responseText){ alert(result.responseText); } } }); } – jassi Aug 26 '16 at 6:46
  • Check My updated answer – Murtuza Zabuawala Aug 26 '16 at 6:48
  • I have checked your updated answer but still no effect – jassi Aug 26 '16 at 7:30
1

Use marketPlaceprice instead of marketplaceprice. Uppercase P.

  • i changed to P but no effect – jassi Aug 26 '16 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.