News:

Support the VirtueMart project and become a member

Main Menu

Price modifacation with installments

Started by TaDrik, April 10, 2021, 18:30:09 PM

Previous topic - Next topic

TaDrik

Hello to all.

I am developing an eshop and I have the below issue.
I am using the "SalesPrice" in the productdetails page, and I have a custom field that modifies the price. Below the "SalesPrice" I need to have 4 more prices, that will display the price with installments (SalesPrice multiplied by 1.3%, 1.7% etc) I have managed to show the prices by adding some php rows in the default.php in the productdetails directory, but in this way the prices are not modified when I use the custom field. What can I do for that?
Thank you in advance

Jörgen

This is probably wrong approach. The price You modify will not show in checkout right ?

either You buy a custom plugin or make one yourself. The vmcustom text plugin is a good start to make some changes.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

TaDrik

Thank you all for your answers. Maybe I didn't describe the issue well.
I am using the plugin that GJC Web Design posted. With this plugin I have a custom field that adds a 15.5% fee if the customer choose it. Everything works fine there. Below the price I have 4 more prices that are for the price modification when installments are chossen. (6, 12, 18, 24 installments) These prices are not changed, when the custom field is choosen, because are calculated in the default.php file of the productdetails directory with php that make the calculation of the salesprice * 1.079 . I beleieve that the calculation of the installments must be done somewhere else. Thats where I need help.
See screenshots below.
Screen1 is with the custom field to "no"
Screen2 is with the custom field to "yes"
Thank you again

pinochico

Ok,
then change your calculation from Sales price to Value of customfield (plugin from GJC) * value of your TAX (not 1.079)
If I'm correct, then if you change pieces on product details or TAX in admin, result from calulation will be changed dynamic nad right.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

AH

Do you have to show the price of the spread payment on the product details - before it is selected

If not then just do it using the plugin

The variable for the plugin will be something like

Pay all now,6 months@*1.17,12 months@*1.2 


The price would then be displayed when a drop is chosen - the default being the price without and deferred payment term
etc

You could show the options as radio buttons - for better display - along with the final price for that option
Regards
A

Joomla 3.10.11
php 8.0

AH

#6
If you are using the * modifier - you can easily change the default.php display to show the prices calculated for each radio button  as shown in my included image

I have just enhanced the plugin to cater for the display of a calculated value when a multiplier is used - it is the full value of the sales price - but you can modify that if you desire.  The option to display this is a new configuration in the customfield setting at customfield and product/customfield level

https://forum.virtuemart.net/index.php?topic=127362.0
Regards
A

Joomla 3.10.11
php 8.0

TaDrik

Quote from: AH on April 12, 2021, 12:15:35 PM
If you are using the * modifier - you can easily change the default.php display to show the prices calculated for each radio button  as shown in my included image

I have just enhanced the plugin to cater for the display of a calculated value when a multiplier is used - it is the full value of the sales price - but you can modify that if you desire.  The option to display this is a new configuration in the customfield setting at customfield and product/customfield level

https://forum.virtuemart.net/index.php?topic=127362.0

Thnak you for your answer. That did the trick.
I have a problem with the prices when checking the option "Show price when using a Multiply modifier" whitch are not incuding TAX, but I will post it to the plugin's topic. 

AH

If you look in the template code tmpl/default.php

I have included the option for you to use the vat inclusive price


// new config option to allow price to be shown for multiplier 2021
if(isset( $params->custom_qvariant_multiplier_showprice ) && $params->custom_qvariant_multiplier_showprice === "1"){
if($modifier == "*" and !empty( $price )) {
// Decide what you want to show - may not be right for you all
$net_multiplied_price = $product->prices["priceWithoutTax"] * $price;
$vat_inclusive_multiplied_price = $product->prices["salesPrice"] * $price;
$variantselect = $variantselect .' ('.$currency->priceDisplay( $net_multiplied_price ).')';
}
}


You just need to change this line:

$variantselect = $variantselect .' ('.$currency->priceDisplay( $net_multiplied_price ).')';

to

$variantselect = $variantselect .' ('.$currency->priceDisplay( $vat_inclusive_multiplied_price ).')';
Regards
A

Joomla 3.10.11
php 8.0