1

I have a field in the checkout where the user can put a PO Number. This field worked fine in 1.8.0, but it doesn't save anymore in 1.8.1, the database field stays empty.

template/payment/form/checkmo.phtml has the following code added to it:

<ul class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
    <li>
        <label for="po_number" class="not-required"><?php echo $this->__('Purchase Order Number') ?></label>
        <div class="input-box">
            <input type="text" id="po_number" name="payment[po_number]" title="<?php echo $this->__('Purchase Order Number') ?>" class="input-text" value="<?php echo $this->htmlEscape($this->getInfoData('po_number')) ?>" />
        </div>
    </li>
</ul>

Since there was a lot of problems with the formkey stuff around the login system, I went ahead and added the following code the template/checkout/onepage/payment.phtml inside the form tag:

<?php echo $this->getBlockHtml('formkey'); ?>

This to add the form key in case that was the problem, which is not.

The PO Number is a very important item in our store, so it is vital that this works, but I currently can not find a reason why it doesn't save it. Any help and/or hints are greatly appreciated!

UPDATE After bit of debugging, I found out that is does save on one payment (iDeal), but it doesn't on another (checkmo), even though it does get sent anyway. I still do not know where or how exactly it gets lost though..

Marius
  • 197,939
  • 53
  • 422
  • 830
Deep Frozen
  • 1,033
  • 1
  • 11
  • 19
  • 1
    Please have a look in the great debugging tutorial and report back. Check the old system against the new. Is it passed to the controller, did you clean the cache, does the field still exist in the database? You sure, that it is payment and not order? – Fabian Blechschmidt Mar 04 '14 at 11:39
  • @FabianBlechschmidt The field exists in the database, it definately is payment, cache is off, var/cache folder emptied. That made no difference. How can I check if it is passed to the controller? – Deep Frozen Mar 07 '14 at 09:35
  • Does a folder Mage exists in app/code/local? Or did you had any modifications done directly on the core files? – Emi Mar 14 '14 at 09:39
  • @Emi folder does exist, but is empty so I might as well get rid of the folder there. – Deep Frozen Mar 14 '14 at 09:40
  • @Emi Core files are not editted, as it should. As far as I have found there are no other modules overriding the savePaymentAction. – Deep Frozen Mar 14 '14 at 09:47
  • @Rune does a folder Mage exist in app/code/community? I know you mentioned local doesn't contain one, but community would also override. – Moose Mar 14 '14 at 09:49
  • @moose Nope, not there either. – Deep Frozen Mar 14 '14 at 09:50
  • I've had problems losing values during checkout in ce 1.7.0.2, but it was a custom field, are you in the same situation? – Julien Lachal Mar 14 '14 at 09:51
  • @JulienLachal I didn't create this part, so I'm not sure, but po_number seems to be a standard thing in Magento, although I am pretty sure I am using it slightly different. The PO number is a field for the customer to write a reference for his invoices etc. It is currently a text input underneath every payment method, so when you click a payment method, the textbox for that method shows up. I'd love to have one single textbox for it, but I couldn't find a way to fix that. The value that gets sent is the correct one though. – Deep Frozen Mar 14 '14 at 09:56
  • Haven't seen this field yet, it's maybe new to 1.8, but I don't undertsand what's the process, just to make things clear, does the customer have to enter a custom Purchase Order number of their liking when in the checkout or am I getting it wrong...? – Julien Lachal Mar 14 '14 at 10:00
  • @JulienLachal check your sales_flat_quote_payment for the po_number field. It is not new in 1.8, because we already had it in 1.7. And yes, the customer can put anything they want there, for a reference to their administration. Not mandatory though. – Deep Frozen Mar 14 '14 at 10:02
  • Yh, I can see it in my DB too, sorry. Although it might not be the cleanest of solutions, have you tried storing it in the checkout/session or customer/session in Mage_Checkout_Model_Type_Onepage's savePayment() method if you are using Onepage checkout. – Julien Lachal Mar 14 '14 at 10:07
  • @JulienLachal Since it is a normal database field, and the AJAX POST sends it to the controller, it should pick it up and save it in the database. This works for one, but not the other. I'd rather just have it work like it works now but for the other too, than storing it in the database is completely fine with me. I honestly don't want to mess with everything again if there's a quicker solution. – Deep Frozen Mar 14 '14 at 10:17
  • I hear you, but I have no other solution to offer you as it never happened to me and as it looked like it should be working. Sorry. – Julien Lachal Mar 14 '14 at 10:19
  • @JulienLachal No problem, thanks for trying to help me with this. – Deep Frozen Mar 14 '14 at 10:21

0 Answers0