Skip to content
  1. Extras
  2. GoogleSheets
  3. Export
  4. msOptionsPrice2

msOptionsPrice2

Product options

Standard fields

FieldName
nameModification name
ridid resource
typeModification type
pricePrice
old_priceOld price
articleSKU
weightWeight
countQuantity
imageImage
activeActive modification
modificationModification options

Export example

Export fields: rid,article,name,price,modification

Table:

Table

System events

Class gsOptionsPrice2 fires these events:

php
<?php
switch ($modx->event->name) {
  // fetches the list of product modifications
  case 'gsOnBeforeGetOptionsPrice2':
    // $query - selection query
    // $range - sheet name, where data will be exported
    break;
  case 'gsOnGetOptionsPrice2':
    // $options - array of modifications with all fields
    // $range - sheet name
    break;
}

Examples

  1. Select all modifications for a specific product
php
<?php
if ($modx->event->name == 'gsOnBeforeGetOptionsPrice2') {
  $query->where(array('rid' => 3)); // 3  - product id
}