RO CSVI
Replace line breaks with an HTML br tag on import
| RO CSVI
This document explains on how to make RO CSVI replace line breaks with an HTML br tag on import using the Multi-Replace rule.
Dependent custom fields for all
| RO CSVI
RO CSVI has extended its support to Dependent custom fields for all in its RO CSVI Customfieldsforall extension. The procedure to run this import is same as Customfieldsforall except the part that there is a new available field custom_parent_value which is used for inserting parent_id.
Using Developer Tools to analyze problems
| RO CSVI
Sometimes a process generates an error notification or it simply seems to run forever. In this case the error happens in the background and you can't see what is happening. To make it possible to see what is happening, you can use the developer tools from your browser.
Installation
The developer tools are generally available by pressing F12 or CTRL-SHIFT-I.
Analyze the problem
With the developer tools open we can analyze what happens. Follow these steps:
- Prepare your template if you are doing an import or export, otherwise you can skip this step.
- Activate the developer tools.
- Click on the Network tab. The network tab will tell us what is going on. Your screen should look like this:
- Click on the Preserve log button to make sure that the import information is not lost.
- Start the import/export/maintenance task
- During the execution you can get a screen like this:
- What to look for is the URL shown in the red box that ends with index.php?option=com_csvi Click on this URL to see the contents.
- Click on the Response tab
- Here you will either see the error that is causing the problem or some code you may not understand. That is not a problem.
- Either look to fix the error or post the full output on the forum and we will have a look
- You can now close the developer tools.
Margin plugin
| RO CSVI
The Margin plugin let's you set a margin to the product price (for example) and imports the new price according to the value set.
From Components -> RO CSVI ->Templates tab -> Rules, Click New to add a new rule for margin plugin.
For example to create a rule to set 20% margin for product_price field of a virtuemart product.
- Give a Descriptive name for the rule in name field.
- Select Action as Import.
- Select Plugin as RO CSVI margin.
- Click on load plugin button.
You will now see three new fields appears
- Value type field to select how the margin is calculated either percentage or value.
- Margin field to set how much percentage or value to be added, For example here its 20.
- Operation type used to calculate the margin.
Example
Here is an example on how to create a rule using margin plugin for a product_price field in virtuemart.
Explanation on the fields
Value type
Take the percentage of value or the value itself.
Margin
Value to be taken for percentage, with the example in the above screenshot, 20% is taken as margin.
Operation
The type of arithmetic operation to be used for calculating the margin. This example uses Multiplication. So for 100 as product_price, margin as 20% with the rule applied, final product_price would be 120 on import.
Comparison Operator
Compare product_price value before applying the margin.
Product price value
The value to compare product_price with. With the above settings in the screenshot, product_price is compared if it is greater than 100 before applying the margin.
Decimals
The number of decimals to be taken after the margin calculation. In this case 4 decimals are taken.
Now set this rule to template fields to use the margin plugin like below
When the fields are set with rules you can see a small fire icon next to the field name in Template fields tab.
Important Note :
- Make sure that product_price (example used in this template) are added in template fields list.
- Use file for configuration option in templates->template name->file tab set to No.
Now that all rules and fields are set, CSVI will automatically calculate the product_price according to the new margin set. Say here for an example the product_price in CSV file has been given as 100. While import CSVI will calculate the price and show as below.
Import multiple files from folder
| RO CSVI
Its more often that users think that CSVI can import only one file at a time but that is not the case at all, CSVI can run import for multiple files if the location is set to be a folder instead of file. The below steps will explain how an import from folder can be set for an import routine.
1. Create a import template needed for the routine as explained in the Create template tutorial.
2. Now edit the template and go to Source tab.
3. In the drop down list, select the option "Load from Server".
4. A text box to give the path is shown, enter the path of the folder where CSVI needs to read the files from.
5. Save the template.
And thats all has to be done for importing multiple files. Now run the import and CSVI will read the files one by one from the folder and does the import.