Author Topic: Price modifacation with installments  (Read 4957 times)

TaDrik

  • Beginner
  • *
  • Posts: 15
Price modifacation with installments
« on: April 10, 2021, 18:30:09 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3733
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Price modifacation with installments
« Reply #1 on: April 10, 2021, 21:06:20 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10303
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Price modifacation with installments
« Reply #2 on: April 10, 2021, 21:30:06 pm »
https://forum.virtuemart.net/index.php?topic=127362.0 ?

and keep your displays just as information
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

TaDrik

  • Beginner
  • *
  • Posts: 15
Re: Price modifacation with installments
« Reply #3 on: April 11, 2021, 09:13:38 am »
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

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1244
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Price modifacation with installments
« Reply #4 on: April 11, 2021, 14:52:39 pm »
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 from products, orders and database table
Virtuemart Email Manager - customs email templates

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: Price modifacation with installments
« Reply #5 on: April 12, 2021, 11:14:10 am »
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

Code: [Select]
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.9.27
php 7.4

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: Price modifacation with installments
« Reply #6 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
Regards
A

Joomla 3.9.27
php 7.4

TaDrik

  • Beginner
  • *
  • Posts: 15
Re: Price modifacation with installments
« Reply #7 on: April 14, 2021, 09:41:26 am »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: Price modifacation with installments
« Reply #8 on: April 14, 2021, 10:11:03 am »
If you look in the template code tmpl/default.php

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

Code: [Select]
// 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:

Code: [Select]
$variantselect = $variantselect .' ('.$currency->priceDisplay( $net_multiplied_price ).')';
to

Code: [Select]
$variantselect = $variantselect .' ('.$currency->priceDisplay( $vat_inclusive_multiplied_price ).')';
Regards
A

Joomla 3.9.27
php 7.4