VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: micropalla on July 15, 2022, 19:12:56 PM

Title: Some questions about configuring VM
Post by: micropalla on July 15, 2022, 19:12:56 PM
Hi! I have last VM version on J4.1.5.
I have an item that costs 500 euro and want to sell it at 200 euro.
Why it is not possible to do this? I just would like to strike the 500 Euros and to have 200 in green...
If you look at the image it makes a nonsense...
Moreover in the prices configuration in products I have not "Override" possibility.
What's wrong?

Thank you for your help!
Title: Re: Some questions about configuring VM
Post by: Jörgen on July 15, 2022, 19:17:35 PM
Of course You can.  8)
Create a discount Rule for 300 euro, there You can set start and stop date and create other connections. Price override doesn´t do this.

Jörgen @ Kreativ Fotografi
Title: Re: Some questions about configuring VM
Post by: jenkinhill on July 16, 2022, 11:45:34 AM
Alternatively in Configuration/Pricing/   Price Configuration

Select Show expert pricing options - Yes. Then the price override function will appear for products.
Title: Re: Some questions about configuring VM
Post by: micropalla on July 19, 2022, 07:48:24 AM
Thank you!! It works!
One more question.
My customer sells paintings. They are mostly vertical but in the preview it stretches the image and that's not good.
Is there a way not the program to do this?
I attach an image to show what i mean.
Thank you in advance!
Title: Re: Some questions about configuring VM
Post by: Studio 42 on July 19, 2022, 10:31:29 AM
For the stretching, it's a CSS problem.
I think
max-width:100%;
for the product image should work
I cannot verify, because you do not provide link to the shop.
Title: Re: Some questions about configuring VM
Post by: micropalla on July 19, 2022, 15:29:14 PM
Thank you. Here it is: http://atena.sviluppo.host/index.php/it/shop/giovanfrancesco-gonzaga
Title: Re: Some questions about configuring VM
Post by: GJC Web Design on July 19, 2022, 15:36:55 PM
no idea where the css is coming from ..your css is combined by the T3 framework but to correct

.productdetails-view .vm-product-media-container .main-image a img {
    max-height: 360px;
    width: auto;
}
Title: Re: Some questions about configuring VM
Post by: micropalla on July 19, 2022, 17:02:41 PM
Oh, cool.
Can I ask you where to add it?
Thank you, I am not so "in" with css, unfortunately :(
Title: Re: Some questions about configuring VM
Post by: GJC Web Design on July 19, 2022, 17:27:33 PM
as I say->  "no idea where the css is coming from ..your css is combined by the T3 framework but to correct"

you add it where it works...  there must be somewhere in these awful frameworks for custom css

put

width: auto !important;

as a last resort
Title: Re: Some questions about configuring VM
Post by: micropalla on July 19, 2022, 17:37:32 PM
Ok thank you, it works.
Just had to create /templates/ja_elicyon/css/custom.css.
I was in doubt since the file didn't exist.
Thank you!
Title: Re: Some questions about configuring VM
Post by: pinochico on July 19, 2022, 20:05:52 PM
The file did not exist because it is your responsibility to create it. :)
If you understand the T3 framework and the Elycion template, it's in the documentation on how to work with custom code.

Otherwise, there is no need to put in cusom.less, but there is a file com_virtuemart.less in the extra folder where you can edit it straight away and you don't need to set the !important flag - that's just a last ditch brake and I'm breaking our coders' hands for that kind of work.

Again - it's all in the documentation or just a simple click through the folders after installation and look at the template settings

And there is also paid support - where they will be happy to help you, because elycion is a paid template and then you are entitled to a support ticket.
Title: Re: Some questions about configuring VM
Post by: micropalla on July 20, 2022, 08:26:23 AM
Quote from: pinochico on July 19, 2022, 20:05:52 PM
And there is also paid support - where they will be happy to help you, because elycion is a paid template and then you are entitled to a support ticket.

About this i wont' share private messages but I asked I think 3 times them to pay for support but no answers at all.
The guy that realizes themes is very helpful but it answers just once per day and not all days...
I want to repeat, he is very kind and he has been very kind but he answers with a big delay and he seems not interested in paid support.
Maybe I asked in the wrong way and it is my fault...

Anyway i will try again :)
Title: Re: Some questions about configuring VM
Post by: micropalla on July 20, 2022, 10:01:52 AM
Back to the main subject, how do I avoid things like these?
First item base price 1200 and discount to 850.
Secondo item only base price 400 but i have in any case the discount price to 400...
How do I avoid publishing the sell price if there is no discount?
Thank you
Title: Re: Some questions about configuring VM
Post by: Jörgen on July 20, 2022, 10:38:53 AM
Uncheck the price override.

Or modify the discount display code in Your template. 
if (abs(base prise -new price) <= diff) then do not show base price

This code should be in your template files. Modify in terms of above

Jörgen
Title: Re: Some questions about configuring VM
Post by: micropalla on July 20, 2022, 14:43:27 PM
Price override is not checked.
I have this as below.
Title: Re: Some questions about configuring VM
Post by: Jörgen on July 20, 2022, 14:57:14 PM
Check your code in the template for updating prices in the view.

There is a check if discount price is equal to base price. You have to check with diff. Not ==, rounding errors makes this impossible with float.

Jörgen
Title: Re: Some questions about configuring VM
Post by: micropalla on July 22, 2022, 10:26:27 AM
Is it in /public_html/templates/ja_elicyon/html/com_virtuemart/productdetails/default.php?
Title: Re: Some questions about configuring VM
Post by: pinochico on July 22, 2022, 10:34:53 AM
no

sublayout price
Title: Re: Some questions about configuring VM
Post by: micropalla on July 22, 2022, 10:53:00 AM
This is the code I have:


defined ('_JEXEC') or die('Restricted access');
$product = $viewData['product'];
$currency = $viewData['currency'];
?>
<div class="product-price <?php echo (empty($product->prices['salesPrice']) ? '':'salesprice'?>" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if (!empty(
$product->prices['salesPrice'])) {
//echo '<div class="vm-cart-price">' . vmText::_ ('COM_VIRTUEMART_CART_PRICE') . '</div>';
}

if ($product->prices['salesPrice']<=and VmConfig::get ('askprice'1) and isset($product->images[0]) and !$product->images[0]->file_is_downloadable) {
$askquestion_url JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' $product->virtuemart_product_id '&virtuemart_category_id=' $product->virtuemart_category_id '&tmpl=component'FALSE);
?>

<a class="ask-a-question bold" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::('COM_VIRTUEMART_PRODUCT_ASKPRICE'?></a>
<?php
} else {
//if ($showBasePrice) {
echo $currency->createPriceDiv ('basePrice''COM_VIRTUEMART_PRODUCT_BASEPRICE'$product->prices);
//if (round($product->prices['basePrice'],$currency->_priceConfig['basePriceVariant'][1]) != $product->prices['basePriceVariant']) {
echo $currency->createPriceDiv ('basePriceVariant''COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT'$product->prices);
//}

//}
echo $currency->createPriceDiv ('variantModification''COM_VIRTUEMART_PRODUCT_VARIANT_MOD'$product->prices);
if (round($product->prices['basePriceWithTax'],$currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$currency->_priceConfig['salesPrice'][1])) {
echo '<span class="price-crossed" >' $currency->createPriceDiv ('basePriceWithTax''COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX'$product->prices) . "</span>";
}
if (round($product->prices['salesPriceWithDiscount'],$currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$currency->_priceConfig['salesPrice'][1])) {
echo $currency->createPriceDiv ('salesPriceWithDiscount''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT'$product->prices);
}
echo $currency->createPriceDiv ('salesPrice''COM_VIRTUEMART_PRODUCT_SALESPRICE'$product->prices);
if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
echo $currency->createPriceDiv ('discountedPriceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$product->prices);
} else {
echo $currency->createPriceDiv ('priceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$product->prices);
}
echo $currency->createPriceDiv ('discountAmount''COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT'$product->prices);
echo $currency->createPriceDiv ('taxAmount''COM_VIRTUEMART_PRODUCT_TAX_AMOUNT'$product->prices);
$unitPriceDescription vmText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE'vmText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$product->product_unit));
echo $currency->createPriceDiv ('unitPrice'$unitPriceDescription$product->prices);
}
?>

</div>
Title: Re: Some questions about configuring VM
Post by: Jörgen on July 22, 2022, 12:28:02 PM
Prices.php cotains the logic that shows the correct price in the orrect moment and in the correct place. Customize as you like, but make a template override first for this file or else your changes will soon be lost.

Check these lines:

if (round($product->prices['basePriceWithTax'],$currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$currency->_priceConfig['salesPrice'][1])) {

if (round($product->prices['salesPriceWithDiscount'],$currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$currency->_priceConfig['salesPrice'][1])) {

if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {

I guess the last line is the one that makes trouble.

Jörgen

Title: Re: Some questions about configuring VM
Post by: micropalla on July 22, 2022, 14:59:27 PM
I was trying to modify as followign but with bad results:

if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
echo $currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
}
if ($product->prices['discountedPriceWithoutTax'] == $product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
}

Where do I wrong?