LemonStand Documentation

Shop_ExtraOption

The Shop_ExtraOption class represents a product extra option. You can access a list of product extra options with the $extra_options field or list_extra_option_groups() method of the Shop_Product class.

Class fields

  • $description - extra option description
  • $price - extra option price
  • $group_name - extra option group name
  • $images - a collection of the option images. Each element in the collection is an object of the Db_File class.

Class methods

  • get_price($product, $force_tax = false) - returns the extra option price taking into account the tax inclusive settings. Pass the product instance the extra option belongs to, to the first parameter. The second parameter should have the TRUE value if you want the tax to be applied regardless of the tax inclusive settings. Example:
    <? foreach ($product->extra_options as $option): ?>
      <?= h($option->description) ?>: <?= format_currency($option->get_price($product)) ?>
    <? endforeach ?>

Next: Shop_Manufacturer
Previous: Shop_CustomerGroup
Return to Reference

Comments

No comments posted so far.

Add your comment

Loading form...