How to remove "none" option in customer choices?
Permalink Browser Info Environment
I made a product option "Size" (Select - Product Price) but I don't want to show the "None" option. How can I remove it?
Type: | Discussion |
---|---|
Status: | In Progress |
Works as a charm. You are a great help. Thanks.
I've added some customer choice check boxes. How do I remove the +£price and Yes next to the checkbox?
I found in /packages/core_commerce/models/attribute/types/product_price_adjustment_boolean/controller.php
public function getDisplayValue() {
$v = $this->getValue();
$txt = ($v == 1) ? t('Yes') : t('No'). " ";
if($this->adjustmentValue != 0) {
if($this->adjustmentValue > 0) {
$txt .= "+";
} else {
$txt .= "-";
}
$txt .= " ";
$txt .= CoreCommercePrice::format($this->adjustmentValue);
}
return $txt;
}
But editing this doesn't appear to help. Any pointers would be great.
I found in /packages/core_commerce/models/attribute/types/product_price_adjustment_boolean/controller.php
public function getDisplayValue() {
$v = $this->getValue();
$txt = ($v == 1) ? t('Yes') : t('No'). " ";
if($this->adjustmentValue != 0) {
if($this->adjustmentValue > 0) {
$txt .= "+";
} else {
$txt .= "-";
}
$txt .= " ";
$txt .= CoreCommercePrice::format($this->adjustmentValue);
}
return $txt;
}
But editing this doesn't appear to help. Any pointers would be great.
models/attribute/types/product_price_adjustment_select/form.php
in the core commerce package directory, and copy it to your [web root]/models/ directory, with its full path. Then you can change
and it should be fine. It made the "**None" go away on my end but it's untested as far as how it works with orders but looking at the code it's not doing anything important that makes it need to be there. Just sayin'