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
hansmonasso
View Replies: View Best Answer
GregJoyce replied on at Permalink Best Answer Reply
GregJoyce
Not without modifying some of the code, but it isn't a big change. You want to find the file
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
$opts = array('' => t('** None')); //<--change this line
   $opts = array(); // <-- to this

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'
hansmonasso replied on at Permalink Reply
hansmonasso
Works as a charm. You are a great help. Thanks.
nathanfriend replied on at Permalink Reply
nathanfriend
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.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.