CartThrob Global Item Options Version 3.0.0

CartThrob Global Item Options is an addon for CartThrob. Like other CartThrob addons, it must be uploaded and installed on your website, and CartThrob must be active for it to run. To use this addon, you will need to configure the settings, and you may also want to add the 2 field types to your products channels. The included field types will override your default settings as needed.

CartThrob Global Item Options lets you create price modifying item options that are automatically available to all products in your store. It also allows you to disable these option groups or individual options on a per-product basis. You can start with a global set of options, and remove any you don't need from items that are special cases. Global Item Options works with CartThrob's Price Modifiers system, so you can set price modifiers on a per-item basis and add other options globally. Outputting the options only requires CartThrob's item_options tag.

Features

  • Settings allow you to create multiple sets of item options that can be applied globally, or to specific channels

  • Included CartThrob Item Options Select fieldtype allows you to override global settings, and apply specific items to certain products

  • Included CartThrob Item Options Group Select fieldtype allows you to override global field groups on a per-product basis

Requirements

  • ExpressionEngine 5+
  • CartThrob 5.4.5+
  • PHP 7.1+

Installation

  • Download the add-on and unzip its contents.
  • Upload the add-on’s folder to your system/user/addons/ folder.
  • Once the add-on is uploaded, you should see it listed in the Add-on Manager in your ExpressionEngine Control Panel. You can then click install!

Upgrading

  • Download the add-on and unzip its contents.
  • Upload the add-on’s folder to your system/user/addons/ folder, replacing the existing copy of the add-on in full.
  • Once the add-on is uploaded, you should see it listed as being available for update in the Add-on Manager in your ExpressionEngine Control Panel. You can then click update!

Settings

Groups

The main settings panel lists the available global item option groups.

Main Panel Settings & list of available option groups

Main Panel Settings & list of available option groups

Add/Edit Option Group

This is where you add global item options & set their prices

Editing an option group settings page

Editing an option group settings page

FieldTypes

There are two different fieldtypes. One fieldtype allows you to set item options on a per-entry basis. The other field type allows you to set entire option groups on a per-item basis. Using these fieldtypes, you can override the global item options in case you have products where these options or groups do not apply.

Fieldtypes in a channel entry

Fieldtypes in a channel entry

Tags

Use CartThrob's standard item_options tag to output these global item options

Changelog

Version 3.0.0

Release December 19, 2020

  • UPDATED: Upgraded for CartThrob 5.4.5+
  • UPDATED: Control Panel screens now use EE styles and Shared Form views.
  • UPDATED: CartThrob Global Item Groups Multi Select Fieldtype now extends EE's OptionFieldtype and uses the shared select field view in the CP.
  • UPDATED: CartThrob Global Item Options Multi Select now extends EE's OptionFieldtype and uses the shared select field view in the CP.
  • UPDATED: The serialized column is removed from the cartthrob_item_options_settings table in favor of using ExpressionEngine's native serialized Composite Type on the data column.
  • UPDATED: The cartthrob_item_options_settings is updated to include a new column of id as the primary key.
  • UPDATED: The cartthrob_item_options_options is updated to include a new column of site_id.
  • UPDATED: If used, the none and all setting for channel selection is migrated during the upgrade to specify the selected channel ids directly.
  • ADDED: New CartThrob\GlobalItemOptions\Model\ItemOption Model.
  • ADDED: New CartThrob\GlobalItemOptions\Model\Setting Model.
Version 1.1.2
  • V1.1.2 Fixed issue where sites using EE Grid Fieldtype would either have problems with the Grid, or with Item options field types when both were in use/installed at the same time.