i am creating a webservice . so i want to set payment method for magento v1.9 based on country details and cash on delivery(cod) for particular products and particular country in magento . how to set programmatically?

  • do you have tried so far
    – Amit Bera
    Commented Feb 25, 2016 at 8:13

1 Answer 1


First checkout this link Payment methods based on billing region?

For your your case, at Devamitbera_Statewisecod_Model_Observer class on function EnableCod function,you can your logic basic of ur require.

At this function you can current quote item from $quote->getAllItems().

foreach ($Items as $item) {
    $productName = $item->getProduct()->getName();
    $productPrice = $item->getProduct()->getPrice();

Now this code,you can do whatever,what u want.

Please let me know if any help u need from me

  • Hi what method(POST or GET) is this webservice?
    – lokesh1212
    Commented Feb 25, 2016 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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