VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: superpupervest on January 19, 2020, 13:21:24 PM

Title: Update On virtueMart
Post by: superpupervest on January 19, 2020, 13:21:24 PM
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>
        <
Title: Re: Update On virtueMart
Post by: pinochico on January 20, 2020, 02:48:09 AM
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? :)
Title: Re: Update On virtueMart
Post by: Jörgen on January 20, 2020, 08:05:15 AM
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
Title: Re: Update On virtueMart
Post by: superpupervest on January 21, 2020, 11:22:46 AM
I need another replenishment field for an alternative price. And I want to understand how I can save and withdraw it.
Title: Re: Update On virtueMart
Post by: pinochico on January 21, 2020, 13:04:43 PM
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)
Title: Re: Update On virtueMart
Post by: Jörgen on January 21, 2020, 15:00:37 PM
@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
Title: Re: Update On virtueMart
Post by: pinochico on January 21, 2020, 21:42:47 PM
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
Title: Re: Update On virtueMart
Post by: Jörgen on January 21, 2020, 22:28:05 PM
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
Title: Re: Update On virtueMart
Post by: superpupervest on January 28, 2020, 17:15:20 PM
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.
Title: Re: Update On virtueMart
Post by: pinochico on January 28, 2020, 19:41:04 PM
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 :)


Title: Re: Update On virtueMart
Post by: GJC Web Design on January 28, 2020, 22:23:21 PM
You can also use the override price and leave it disabled but displayed in the template

Title: Re: Update On virtueMart
Post by: pinochico on January 29, 2020, 01:51:34 AM
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...
Title: Re: Update On virtueMart
Post by: GJC Web Design on January 29, 2020, 09:31:42 AM
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