Permalink
Browse files

Fixes for the dynamic loading tab when copying products(also created …

…a changed in the view for the theme mus where the ajax loading is implemented)
  • Loading branch information...
1 parent 03d859d commit 932f5f049d06845bd82f987280f3c13382153182 @rasseljandavid rasseljandavid committed Sep 28, 2011
View
8 framework/modules/ecommerce/controllers/storeController.php
@@ -724,12 +724,12 @@ function search_by_model_form() {
function edit() {
global $db;
expHistory::set('editable', $this->params);
-
// first we need to figure out what type of ecomm product we are dealing with
if (!empty($this->params['id'])) {
// if we have an id lets pull the product type from the products table.
$product_type = $db->selectValue('product', 'product_type', 'id='.$this->params['id']);
} else {
+
if (empty($this->params['product_type'])) redirect_to(array('controller'=>'store', 'action'=>'picktype'));
$product_type = $this->params['product_type'];
}
@@ -910,9 +910,9 @@ function copyProduct() {
$record->original_id = $record->id;
$record->original_model = $record->model;
- $record->id = NULL;
$record->sef_url = NULL;
$record->previous_id = NULL;
+ $record->editor = NULL;
if ($record->isChild())
{
@@ -941,6 +941,10 @@ function picktype() {
function update() {
global $db;
+
+ if(isset($this->params['original_id'])) {
+ unset($this->params['id']);
+ }
// eDebug($this->params['optiongroups'],true);
//eDebug($this->params,true);
$product_type = isset($this->params['product_type']) ? $this->params['product_type'] : 'product';
View
4 framework/modules/ecommerce/products/views/product/edit.tpl
@@ -28,6 +28,10 @@
{form action=update}
{control type="hidden" name="id" value=$record->id}
+ <!-- if it copied -->
+ {if $record->original_id}
+ {control type="hidden" name="original_id" value=$record->original_id}
+ {/if}
<div id="demo" class="yui-navset">
<ul class="yui-nav">
<li class="selected"><a href="#general"><em>General</em></a></li>

0 comments on commit 932f5f0

Please sign in to comment.