Created
January 5, 2012 17:26
-
-
Save pnomolos/1566247 to your computer and use it in GitHub Desktop.
Lemonstand - Minimize memory when using products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$grouped_product = new Shop_Product(null, array('no_validation' => true, 'no_column_init' => true, 'no_timestamps' => true)); | |
$data = $_POST['Shop_Product']; | |
$data['grouped'] = 1; | |
$data['name'] = $product->name . ' ('.$attributes->name.')'; | |
$data['url_name'] .= '_'.uniqid('', true); | |
$data['sku'] .= '-' . strtolower($attributes->sku.uniqid('', true)); | |
$data['grouped_option_desc'] = $attributes->name; | |
$data['x_aga_ids'] = join(':', $ids); | |
$data['product_id'] = $product->id; | |
$grouped_product->save($data, $controller->formGetEditSessionKey()); | |
unset($grouped_product); | |
unset($attributes); | |
gc_collect_cycles(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment