I have a solution which is acceptable for the business logic although it does not fix the underlying issue of not being able to retrieve the custom value from the customer and use it as part of the address.
This approach will pre-populate addresses "Company" field where the custom field "company_name" has been set.
It then returns the value "Company" - if it has been amended or not.
Edit \app\design\frontend\base\default\template\MYMODULE\customer\address\edit.phtml
<li class="wide">
<label for="company"><?php echo $this->__('Company') ?></label>
<div class="input-box">
<?php if ($this->getAddress()->getCompany()) {
$companyName = $this->escapeHtml($this->getAddress()->getCompany());//Company name has been filled
}else{
$companyName =$this->escapeHtml($this->getCustomer()->getCompany_name());
}?>
<input type="text" name="company" id="company" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Company')) ?>" value="<?php echo $companyName ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
</div>
</li>
And edit app\design\frontend\base\default\template\MYMODULE\customer\widget\name.phtml
<?php if ($this->getStoreLabel('tamper_company_name')):?>
<div class="field name-companyname">
<label for="<?php echo $this->getFieldId('tamper_company_name')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('company_name') ?></label>
<div class="input-box">
<input type="text" id="<?php echo $this->getFieldId('company_name')?>" name="<?php echo $this->getFieldName('company_name')?>" value="<?php echo $this->escapeHtml($this->getObject()->getCompany_name()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->getStoreLabel('company_name')) ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company_name') ?>" <?php echo $this->getFieldParams() ?> />
</div>
</div>
<?php endif;?>
This means that the custom field "company_name" is asked for when creating an account, but not when entering an address. The default field "company" is populated by "company_name", which the user can update as required.
As it is using the default fields, it populates in all the correct places for address handling without the need to override the default behaviour.
I would still be interested in getting/setting the values in a better way if anyone has some thoughts.
This does appear to be an outstanding issue, though perhaps it is resolved in newer versions of M2. See Magento GitHub issues:
As far as what you can try...
If this is cookie-related, you may be able to rule out some possibilities by visiting your site in a private browsing/incognito browser. Go through your workflow (not logged in, add product to cart, customer log in, look at /checkout/cart and minicart dropdown).
Additionally, it may be helpful to review the M2 dev docs for best practices regarding configuration of the caches in development versus configuration in production. In my experience, in development, it is OK to have all caches enabled in development, and simply flush when required (read docs for descriptions of each cache). Note, as a mostly front-end dev, I personally prefer to develop with FPC, Blocks output, and layout caches disabled - this allows frontend changes to be seen more easily.
Best Answer
Removing the link can be done by commenting it out in the
downloadable.xml
layout file. Copy the file to your template layout directory and edit around line 30 like this:Now if you're not planning on using the downloadable products at all I'd like to suggest turning off this module all together by editing
app/etc/modules/Mage_Downloadable.xml
changing<active>true</active>
to<active>false</active>
.