Question

I have multiple products that have many different custom options for the customer to choose from. One of these products must have a different custom option naming implementation than the rest of them (one that doesn't correspond to the naming in the backend). Therefore, I have created an attribute that only this product possesses.

I plan to check the products with custom options for this attribute. If this attribute is found I plan to have alternate naming functionality.

However, I can't seem to find where exactly custom option dropdown names are generated.

Was it helpful?

Solution

If you want to know where it's rendered, you'll need to start with what type of custom option you have (drop-down, text, radio, etc). Once you know that, you can locate the template in: app/design/frontend/base/default/template/catalog/product/view/options/type/*.

Each template should have its own renderer. For example, if you are dealing with a select field, it's template will be found in the folder shown above, and it's rendering block will be found in: app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php -- see a snippet of it here:

public function getValuesHtml()
{
...
    foreach ($_option->getValues() as $_value) {
        $priceStr = $this->_formatPrice(array(
            'is_percent' => ($_value->getPriceType() == 'percent') ? true : false,
            'pricing_value' => $_value->getPrice(true)
        ), false);
        $select->addOption(
            $_value->getOptionTypeId(),
            $_value->getTitle() . ' ' . $priceStr . ''
        );
    }
    ...

You can see how it generates that title ... so you'll want to modify this based on what attribute that option corresponds to. Hopefully that gets you in the right direction.

OTHER TIPS

Are you looking for Admin->Catalog->Manage Products-> ->Custom Options where you can edit the existing options or add new product options.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top