Advertisement
johncarlson21

Untitled

Jan 6th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. $opts = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
  4. $newOptions = array();
  5.                         foreach($opts['options'] as $ops) {
  6.                             if ($ops['label'] == "Square Ft") {
  7.                                 $ops['value'] = $actualSqFt;
  8.                                 $ops['print_value'] = $actualSqFt;
  9.                                 $ops['option_value'] = $actualSqFt;
  10.                             }
  11.                             $newOptions[] = $ops;
  12.                         }
  13. $opts['info_buyRequest']['options'][$optionId] = $actualSqFt;
  14. $opts['options'] = $newOptions;
  15. $item->setProductOptions($opts);
  16. $item->save();
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement