Hello. There was a need to add the Old price to the site. I decided to do it as follows. Added an additional Input to the /administrator/components/com_virtuemart/views/product/tmpl/product_edit_price.php file, as well as an additional column in the biclp_virtuemart_product_prices table.
But I did not understand where and how to save the whole thing. Tell me please.
<tr class="row<?php echo $rowColor?>">
<td width="120px">
<div style="text-align: right; font-weight: bold;">
<span
class="hasTip"
title="Старая цена">
Старая цена
</span>
</div>
</td>
<td width="140px"><input
type="text"
class="inputbox"
name="mprices[old_price][]"
size="12"
style="text-align:right;"
value="<?php echo $this->calculatedPrices['costPrice']; ?>"/>
<? /* <input type="hidden"
name="mprices[virtuemart_product_price_id][]"
value="<?php echo $this->tempProduct->virtuemart_product_price_id; ?>"/> */?>
</td>
<td colspan="3">
</td>
<
QuoteThere was a need to add the Old price to the site
The use only override price fo existing price on admin and setup view for price in admin and control your template.
You dont need programmable adding new input and change core Virtuemart . why? :)
What Do You mean with old price is this price before discount or an old costprice. If it is an old costprice, why only one ? Would it not great to implement historical costprices. Is This You want? This means a change to the core since only present price is supported.
Displaying one "old price" is easier and done in the same way as all overrides in Joomla under templates/your_template/html/com_virtuemart/...
Of course changes to the admin template views are also neccessary to make.
Jörgen @ Kreativ Fotografi
I need another replenishment field for an alternative price. And I want to understand how I can save and withdraw it.
You can create new second price for every products and then override template for category or product for another view this price.
I use this option for view
price for sale
price for wholesale
price recommended
in one time on one place (detail product, category)
@pinochio
Do You create wholesale [wholseagroup] and recommended prices [rec group] and display the two extra prices this using these two user groups ?
Jörgen @ Kreativ Fotografi
Yes, we use three groups:
- default
- wholesale
- recommended - without custommer, only for showing price
And in template we call all prices for show
- default == only default
- wholesale == wholesale and recommended price
with all functions (override price, max-min,...)
For this situation we use override template - call internall function createpricediv from VM for specific group.
Or we are wrong? :)
Look on the www.hanf-gesundheit.de
AFAIK it sounds like a great idea. Wish I had thought of it myself. Besides the extra template changes it uses VM standard price structure :)
Jörgen @ Kreativ Fotografi
The fact is that there is a wholesale price and retail and other types of prices. But I need that among them there should already be a separate field with the old price, which will have an exclusively informational character.
But I use a separate price for a virtual customer group MOC that has REALLY BUT REALLY REALLY only the INFORMATION CHARACTER.
Why is it so hard to understand?
Please translate - price for MOC == OLD PRICE
In our country we say == Who does not believe, let there run == meant Let him find out himself == he doesn't need help from me.
And here on the forum - you do not have to run anywhere, just create duplicate posts (which in the meantime really happened :)
You can also use the override price and leave it disabled but displayed in the template
GJC:
It is a great option too, but I must change a little code in VM Email Manager, Easy Feeder, Connector for ERP for using disabled option override price now - all time we don't use it. :(
P.S.
Yes, I remember why we don't use this option - calculation VAT for override price is wrong and not function according to the Czech TAX law...
If the override price is left disabled then it is purely informational and not used in any calc or invoicing etc.
So effectively it is just a label
the "you save" I do at template level