Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rodrigowebjump/a805c1d63e92d9b18e97 to your computer and use it in GitHub Desktop.
Save rodrigowebjump/a805c1d63e92d9b18e97 to your computer and use it in GitHub Desktop.
Magento - Checkout campos no cadastro do cliente (data de nascimento e sexo, por exemplo)

Para salvar informações na conta do cliente durante o checkout é preciso fazer um "de para" no config.xml. O nome do nó varia conforme o checkout utilizado, pois ele é acionado em um dispatch como por exemplo:

Mage::helper('core')->copyFieldset('checkout_onepage_billing', 'to_customer', $bill, $customer);

Exemplo do config.xml (ref. /app/code/core/Mage/Checkout/etc/config.xml)

<config>
  <global>
    <fieldsets>
      <checkout_onepage_billing>
        <dob><to_customer>dob</to_customer></dob>
        <gender><to_customer>gender</to_customer></gender>
      </checkout_onepage_billing>
    </fieldsets>
  </global>
</config>

ou

<config>
  <global>
    <fieldsets>
      <checkout_onepage_quote>
        <dob><to_customer>dob</to_customer></dob>
        <gender><to_customer>gender</to_customer></gender>
      </checkout_onepage_quote>
    </fieldsets>
  </global>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment