Hi,
Is any way to save virtuemart_product_id of a product in product_sku field, in same time?
I tried to find where sql query "INSERT" is, but i finded Nothing!
Any idea?
There is no insert for the pid as it is just the cumulative next increment id....
I would build an onsave triggered plugin that copies the pid to the sku field - since around VM3.4 there is a flag for first save as well so it wouldn't be called every time you updated etc
OVERRIDE THE PRODUCT FORM
administrator/views/product/product_edit_information.php
<td>
<input type="text" class="inputbox" name="product_sku" id="product_sku" value="<?php echo $this->product->product_sku; ?>" size="32" maxlength="255" />
</td>
to
<td>
<input type="text" class="inputbox" name="product_sku" id="product_sku" value="<?php echo $this->product->virtuemart_product_id; ?>" size="32" maxlength="255" />
</td>
the above will only work after the initial save though...
Thank you PRO
I used your solution with a little modification because I needed to add a few more digits for the date and it worked perfectly.
I give the modification I did in case someone else will need it.
<?php
// get current date
$Y = date('y');
$M = date('m');
?>
<input type="text" class="inputbox disabled" name="product_sku" id="product_sku" value="<?php echo $this->product->virtuemart_product_id . $Y . $M; ?>" size="32" maxlength="255" />
So now, the product sku has the product id plus a four digit number for the date it was created or editted.