$pb->deal_tot += $product->list_price * $product->quantity; $pb->new_sub += $product->list_price * $product->quantity; $pb->total += $product->list_price * $product->quantity; $product_id = $product->save(); $pb->set_productbundle_product_relationship($product_id, $product_key, $product_bundle_id); break; } //while } //foreach $pb->tax = 0; $pb->shipping = 0; $pb->save(); //Save any product bundle comment if (isset($bundle['comment'])) { $product_bundle_note = new ProductBundleNote(); $product_bundle_note->description = $bundle['comment']; $product_bundle_note->save(); $pb->set_product_bundle_note_relationship($bundle_key, $product_bundle_note->id, $product_bundle_id); } $pb->set_productbundle_quote_relationship($focus->id, $product_bundle_id, $bundle_key); $focus->tax += $pb->tax; $focus->shipping += $pb->shipping; $focus->subtotal += $pb->subtotal; $focus->deal_tot += $pb->deal_tot; $focus->new_sub += $pb->new_sub; $focus->total += $pb->total; } //foreach //Save the quote $focus->save();
$product->ignoreQuoteSave = true; $product_id = $product->save(); $product->load_relationship('quotes'); $product->quotes->add($focus); $pb->load_relationship('products'); $pb->products->add($product, array('product_index' => $product_key)); break; } //while } //foreach unset($pb->products); $pb->save(); //Save any product bundle comment if (isset($bundle['comment'])) { $product_bundle_note = new ProductBundleNote(); $product_bundle_note->description = $bundle['comment']; $product_bundle_note->save(); $pb->load_relationship('product_bundle_notes'); $pb->product_bundle_notes->add($product_bundle_note, array('note_index' => $bundle_key)); } $focus->load_relationship('product_bundles'); $focus->product_bundles->add($pb, array('bundle_index' => $bundle_key)); } //foreach unset($focus->product_bundles); //Save the quote $focus->save(); } //foreach }