Results 1 to 6 of 6

Thread: Custom checkout fields

  1. #1
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Custom checkout fields

    Hi,

    I need to add some custom fields to the checkout.

    For example I need to add a 'Delivery notes' field to my shipping address form. The Delivery Note also needs to be displayed with the order information in the Backend.

    Does anyone know how I would achieve this? At the moment i'm thinking something along the lines of extending the checkout module and overwriting the getShippingAddressInterface() method but i'm not sure if that would work.

    Thanks

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Custom checkout fields

    Aren't the current field dca fields? If so, extend the dca with a discriptionfield. Not sure if t would be displayed, but that can also be done because the getinterface function (I think) of each module gets called. Perhaps youmust add another module to shipping. In fact, that should also be able to do the shipping note field if the first option does not work well.

  3. #3
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: Custom checkout fields

    Thanks for the reply.

    I've had another look and I think I can do this by adding my own module as you said. That should work nicely, thanks for pointing me in the right direction.

  4. #4
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: Custom checkout fields

    I've managed to add my interface to the address step.

    I now need to save the data to the order. I'm not sure how to do this.

    Here is my code so far:

    Code:
    public function getDeliveryNoteInterface($blnReview=false)
    {       
    		$objTemplate = new IsotopeTemplate('iso_checkout_delivery_notes');
    
    		$objTemplate->headline = 'Delivery Notes';
    		$objTemplate->message = '';
    		$objTemplate->fields = '';
    
    		if (!$this->doNotSubmit)
    		{
    			
    		}
    		return $objTemplate->parse();
    	}
    Not sure about the $blnReview variable either. In the Isotope Checkout module this is a boolean value which returns true if the customer is on the review page. In the method above it passes the ModuleIsotopeCheckout object.

    I THINK isotope stores all of the checkout data in an array that is saved to an Order at the end of the checkout process. I'm not clear on how it works exactly though and how I can add my own data.

    Does anyone know?

    Thanks

  5. #5
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Custom checkout fields

    Take a look at the session var. It stores all filled in data afaik. Something like $_SESSION['CHECKOUT_DATA']['checkout_note'] = $varValue; Later on you can use these in the confirmation e-mail as well using $objCheckout->arrOrderData['checkout_note'] = 'the message';

    You got the variables for that function wrong. It should be ($objCheckout, $blnReview=false)

    Ps, you add to the session var yourself when ($this->Input->post('FORM_SUBMIT') == $this->strFormId). And fill with addOrderData if (!$this->doNotSubmit).

  6. #6
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: Custom checkout fields

    Thanks Ruud, that clears things up a bit!

    I should be able to get this sorted now

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •