php - How to pass an EAV value to the Paypal payment information -
i've introduced custom eav attribute customer object. let's call myvalue. within several places in magento, i'm printing value this:
echo mage::getsingleton('customer/session')->getcustomer()->getmyvalue();   when customer pays paypal, i'd have myvalue in reason addition order number. intent match order shop-side process. 
so, how can pass myvalue paypal make visible order number?
you can try override class mage_paypal_block_standard_redirect this:
protected function _tohtml() {     $standard = mage::getmodel('paypal/standard');      //...      foreach ($standard->getstandardcheckoutformfields() $field=>$value) {         if ($field == 'reason_code') {             $myvalue = mage::getsingleton('customer/session')->getcustomer()->getmyvalue();             $value .= $myvalue;         }         $form->addfield($field, 'hidden', array('name'=>$field, 'value'=>$value));     }      //...      return $html; }   i have added condition in foreach edit reason special customer value.
i don't know code reason speak about, if don't can first log in foreach:
mage::log($field); mage::log($value);   then don't forget edit 'reason_code' , getcustomer()->getmyvalue() in example.
Comments
Post a Comment