I don’t know if this is possible or not. I’m importing a price list into custom fields. I need another field that takes whatever is in the price field and increases it by 20% for warranty pricing. Do you know how I can do that?
Hello. Thank you for contacting the Toolset support.
- Can you please tell me how exactly you are importing the price list?
Do you want to increase the price by 20% based on the available value when you display it on frontend or you want to save the increased value by 20% to another custom field - if yes, do you want to increase the price field value by 20% when user publish/save the post?
We are using Ultimate CSV Importer Pro to import a xml file daily at 6pm. Every time the importer runs, it removes all of the records and imports the file new into custom post type fields. A potential issue is that the price field is being imported as a text field not a number field because the file contains the dollar sign already.
I'm not sure which option would be better for performance if either are still an option. If the calculation is saved to another custom field, then that calculation would need to be performed after every import as the price may change. If there's a way to get it to show on the frontend based on the available value without that causing any performance issues, that would probably be the best option. Right now there are 779 prices that would need to be calculated.
There are two things - if you want to run some code after the import process has been done, you will have to check with the "Ultimate CSV Importer Pro" plugin support what action/hooks you can run after the import based on the imported data.
If you agree to display the calculated price based on custom shortcode when the content/post is displyed on the frontend then you will have to write the custom shortcode where we can grab the existing price field value and do the calculation on that price and return the calculated price.
Can you please tell at what place exactly on the frontend you want to display the calculated price and based on the what field you want to calculate the price.
Can you please share problem URL and admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.