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?
1 Answer
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()
.
$Items=$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