- Details
- Written by: Valérie Isaksen
- Category: Custom Fields
- Hits: 25787
The plugin Custom size allows your customers to easily adjust the price of your products, based on the size they require, which can be by dimension, surface, or volume.
Installation
- Browse in the menu Extensions > Entension Manager, and install the plugin
- Browse in the Extensions > Plug-in Manager, and enable the plugin named VM - Custom - iStraxx customsize
Create a custom field prototype
Create a custom field
- Browse to Components > VirtueMart
- Select the menu Products > Custom Fields
- Click on the button New
- Select for the field Custom Field Type: Plug-ins
- Enter a Title
- Select for the field Cart Input the value Yes
- For the field Select a plug-in, select VM - Custom - iStraxx customsize
- Fill in the default values
- Width of input field
- Unit
- Offset for calculation
- Dimension or a surface ?
- Minimum value for length
- Maximum value for length
- Number of decimal values for length
- Minimum value for width
- Maximum value for width
- Number of decimal values for width
- Click on Save
Note: In the customfield prototype the default values are set. You can override settings by changing values for product details as explained in steps below.
Attach the Custom field to your product
- Select the menu Products > Products
- Click on the product you would like to add the custom field
- Select the tab Custom Fields
- In the Custom Field Type area, select the custom field you created
- Click on Save
Note: In product details customfield you can set different values then default to fit your certain product configuration.
How to use the different variants
The plugin provides different strategies.
- Product price + calculated price by input and customs price.
- Product price + calculated price by input and product variant price
- Unit price using product price
- Unit price using product variant price
Use the product price makes only sense, if you have a cart variant with own prices. If you choose this the variant prices are not just added to the product, they are used for the calculation with the input. With this option you can easily reflect different materials for example.
Use offset as default unit size is meant for a price system working with unit prices. The offset reflects the unit size. For example, you want that your customers enter the value in cm, select as unit mm. But you want as unit price per meter, than use as offset 100 (=1 meter).
The offset for calculation is most time the minimum size. It defines at which value the input value is calculated.
For example you sell a rope, the first 10 meters are already in the product price, the minimum is 1. But the customer must only pay for more than 10 meters. Then use offset 10.
The last field with the value 5 is the additional amount to pay (netto).
Template overriding
You can customize the plugin output displayed in the product view, and/or in the cart view.
Store your files in yourtemplate/html/com_virtuemart/vmcustom/customsize. More explanations here how-to-overwrite-plugins.html
Options overview
Basic settings
Custom price: set price per unit - only required if price per unit differ from vm product price
Width of input field: specifies the width of an input element at fe > product details view
Unit: Set used unit e.g. cm, m or inch, display on fe > product details view and cart view
Use offset as unit size: The usual value is enabled. So for values below the offset the price is decreased. For example you sell boards, the price 5/m. If the option is enabled, an entered value of 0.5 creates a price of 2.5
Use the product variant price: Activate this to use the variant price of the product. Be aware this works only if you have different customfield variants of your product.
Dimension, surface, or volume: Select number of dimension input used for calculation. Dimension for length only, Surface for length and height, Volume for three dimension.
Settings for each dimension
Fieldname Dimension: By default use VMCUSTOM_ISTRAXX_CUSTOMSIZE_A, to use the language delivered in language pack. If you desire to use custom text add placeholders for value and unit according to: LoremIpsum %1$s %2$s
Minimum value for length: Input field restriction, let empty or 0 for no restriction. If restriction is present and user input does not meet restricted area a popup displays hinting the user to the limits. Additionally the input value is corrected automatically to meet the limits.
Additional feature: use semicolon to create selection e.g. 100;200;300 results in a dropdown select field instead the userinput field in fe product details view.
Maximum value for length: Same according to minimum value
Number of decimal values for length: Set precision for rounding of user input. The used value depends on maximum precision which can be ordered by shopper
e.g. 3 for 1.234 or 5 for 1.23456 as userinput, 0 or empty for no decimals.
Offset for length: set offset for calculation purpose. e.g. product price 100€, customfield price empty, the product price includes 1m, set value 1 as offset. 1 meter is now included in product base price. If you would use 0 as offset userinput 1 would cost 200€ in this example.
You can also see the offset as the default value, which should be already entered, when entering the product. When we sell for example a rope, the price for 0 meter rope is 0. But of course we want to advertise our product, so the normal case is to display the price per meter. VirtueMart expects a price for the product. The common way is to use for example 1 meter. In this example the offset would be 1.
Advanced settings
Time to wait for checking the values in seconds: delay time in miliseconds after userinput. Good values differ based on expected input. If you have simple input with no digits values around 1000 are good, for more digits to insert use higher delay value, e.g. 2000
Calculation Divisor: use this option only for specific cases e.g. your user input is cm but calculation and price is based on m. use 100 for this case. It is also possible to use this option for inch/feet calculation or similar. If using this option the offset for each dimension has to be adjusted according this setting, e.g. if previous offset was 1.0 and you change calculation divisor to 100 your new offset for the dimension has to be 100 (for each dimension). Also check your total offset.
Quantity Steps: use this option if there are minimum steps of user input that cannot be handled by precision, you sell chains at 2.5m steps, so 5 and 7.5 is allowed input but 6 is not, instead the plugin automatically rounds up to the next step resulting in the suggestion of 7.5 instead of 6.
Optionally this option can be used to calculate with fractions e.g. 1 1/2 is allowed input if set.
Enable for ceil() else round(): on some machines we have encountered rounding issues when using fractions. In case you experience rounding issues this option enabled might solve the problem.
Weight/unit: optionally set custom weight per unit, product settings for weight unit are used.
Dimension ration: optionally set dimension ratio e.g. for photo format or posters, insert values with colons example 1:2
FAQ
Question rounding: My input value in frontend is always rounded: e.g. 1.25 will display as 1. How do I set round precision?
Answer: In product details > customfield > in the field "Number of decimal values" set your precision, 1.23 requires option value 2, 1.234 requires option value 3. If zero or no value is set the input is rounded with no decimals.
Question cart display lenght and unit: In cart view I see neither value nor unit of user input. For our need we have changed the Fieldname of Dimension. Our fieldname is present but no value nor unit - how to solve?
Answer: By default Fieldname Dimension contains a string VMCUSTOM_ISTRAXX_CUSTOMSIZE_A. When you browse the language file you will find this content for the language key: Length %1$s %2$s
In most cases it is solved by adding %1$s %2$s to your dimension string e.g.: LoremIpsum %1$s %2$s
Examples
Lets sell a rope with 5 euro per meter (net). We want that the product appears with a product price of 5 euro. We do not sell less than a half meter and in 10 cm steps. We just add the product price of 5 euro, leave the customfield price empty.
In our example here we have a tax of 10%. The unit price is by default with vat (gross). Our prices range from 2.50 - 500.00 euro. This is of course the simpelst case.
Now we want to offer a better quality of the rope and just provide it as variant. There is now an important rule of VirtueMart in the game. The order of customfields is very important. The ordering in the product edit view defines which customfield is handled first. So when we want to change the price per unit of the rope, we must put the customfields changing the price above. It can be also usefull to change the price after the calculation of the customsize. The plugin just takes the "sum of all modifications done so far". The simple setup just uses the String customfield and additionally we activate the "Use the product variant price".
The results of this configuration (version 1.2.0)
Note: The system worked different in versions before 1.26.x and need an empty product price (or very tiny one like 0.00001). Variant prices were also entered as endprice, in our example 5.00 and 5.20. This system has some disadvantages, unintuitiv, js needs to set the price for any reload and so on. So the new system uses the variant price which is added to the product price (as normal variants do).
We can add now more fancy things like a dropdown for entering in cm. For that we just enter "cm" in "Alternative Unit" below the topic "Advanced". The system needs to know the calculation factor. We use here a divisor which is just the inverse of the factor. So in our case it is 100 (100 cm for 1 m). Or we could quantity steps instead, for example 1/4, to allow only steps of 0.25. The system recognises fractions.
More dimensional examples are analogue. 2 dimensional examples have an additional area offset (or default).
customsize QUANTITY (not part of the standard customsize)
The quantity customsize plugin provides different prices and/or discounts for different inputs. We use the example from above and just add this to our table.
This means the price per meter is 5 euro from 0.5-9.9 meters. And 5 euro for at least 10 and 5 euro for at least 50 meters. But as you can see in the second line, we give a discount of 5% when you buy at least 10 meters. The results look like this.
The table becomes really interesting, when it is used for 2 dimensional wares like a textils. Here the price changes to 6 euro the m² when the length is at least 50 meters. When the width is at least 50 and also the length, we give a discount of 20%.
Some examle results:
General intro
- Details
- Written by: Matej Dubovsky
- Category: Custom Fields
- Hits: 4160
Our Package size plugin allows your customer to enter the size of a product and the plugin automatically suggests the amount of product units to be added to cart. You can configure the size of the certain product package using custom fields. For each product you can define unique settings for minimum and maximum values, predefine unit and define number of decimals. It can be used for each kind of prepacked products as flooring packs, wallpaper, screw packs, electronic component packs and much more.
Imagine you sell flooring, your shopper is going to buy certain amount of prepacked parquet packages. The shopper knows how many squarefoot he requires, so he just enters the total size. The plugin calculates the roundup amount of packages based on the given size and the product setting within each package. The amount is updated dynamically.
INSTALLATION
- Install the plugin with the Joomla Extension Manager
- Browse Joomla extensions > Manage, filter by name iStraxx Quantity Package or filter by type: vmcustom
- Enable the iStraxx Quantity Package by size plugin
HOW TO CREATE CUSTOM FIELD PROTOTYPE
- Browse to Components > VirtueMart
- Select the menu Products > Custom Fields
- Click on the button New
- Select for the field Custom Field Type: Plug-ins
- Enter a Title
- For the field Select a plug-in: select from dropdown VM - Custom, iStraxx Quantity Package by size
- Define the package size - enter the size in units (e.g. if your pack contains 3.500 pieces enter 3500)
- Restrict width of input - set the input field size (e.g. 10)
- Set unit - your unit to be used to display (e.g. inch, m², sqf, pieces)
- Set minimum and maximum values to be accepted for calculation as input
- Set number of decimals - set precision in amount of digits used, for 1.12 use value 2; for 1.123 use value 3 a.s.o.
- Click on Save
HOW TO USE
- Browse product details page
- Select tab customfields on the right
- Add the Package size customfield by selecting the item from the dropdown list
- Change settings in case this certain products requires different config then default
- Save & Browse product details frontend
- Test it
Hint: Follow the VirtueMart standarts, precreate customfield prototypes as customfield masks for different types of products. Add customfield mask to product patterns to achieve best performance when presenting a lot of similar products with little differences in detail.
See what it does at package size demo page http://demo.virtuemart.net/package-size
FAQ
Q: The calculation result is completely wrong, what shall I do?
A: Check number of decimals settings - if it is empty the plugin will assume zero digits, enter the amount of digits that are used for calculation, in metric system 2 is a common value
Q: The calculation is still completely wrong, what shall I do?
A: Please submit a support ticket, please provide your settings and numbers used for testing, most common reason is the used value.
- Details
- Written by: Matej Dubovsky
- Category: Custom Fields
- Hits: 5934
The Rawforms customfield plugin allows to use custom html and php snippet to display forms allowing the shopper to personalize his product and allows the store owner to provide customized prices. All of that just by using few lines of simply readable code.
INSTALLATION
- Install the plugin with the Joomla Extension Manager
- Browse Joomla Extensions > Manage, filter by name Rawform or filter by type: vmcustom
- Enable the Rawform plugin
HOW TO USE
- Browse VirtueMart administration, choose the menu Product > Custom Fields
- Create new customfields, select type plugin, at the bottom select Rawform, name it e.g. my raw form
- Enable option Cart Attribute
- Enable option Cart Input
- In Additional Parameters insert internal comment for your identification convenience (optional)
- Select snippet files to use for each view: productdetails, cart, order, data preparation
- Browse containing template files containing form snippets, physical path on server is: Your Joomla Root\plugins\vmcustom\istraxx_rawforms\tmp\
We recommend to either clone the files or create template overwrite (how to overwrite plugins: https://docs.virtuemart.net/tutorials/templating-layouts/101-how-to-overwrite-plugins.html) - Browse VirtueMart administration product details where you like to add the form. In product details browse to the tab customfields and add the Rawform by selecting my raw form, set the customfield price and save the product entry.
HOW TO MODIFY CODE SNIPPETS
product.php - display form in product details, uses html <input>, you can modify according to html standards (http://www.w3schools.com/html/html_form_input_types.asp)
(...)
<input class=""
type="text" value=""
size="10"
name=""
> (...)
prepcart.php - form calculation, if the form is filled by shopper the following snippet will add x=(1.0 x customfield_price)
to the product price:
(...)
if (!empty($selected['comment'])) {
if ($customfield->custom_price_by_letter ==1) {
$charcount = strlen (html_entity_decode ($selected['comment']));
} else {
$charcount = 1.0;
}
$modificatorSum += $charcount * $customfield->customfield_price;
} (...)
To change the price e.g. to be added for each letter, set statement $customfield->custom_price_by_letter = 1;
between first and second line of this snippet.
The cart.php and order.php do work in the same way, please note: neither change the top code block, nor change the Javascript if you do not know what you do!
You can define different snippet files to be used for each rawform custom prototype.
See some samples here:
FAQ
Q: Can I use template overrides to modify rawforms?
A: Yes, same way as you know from Joomla and VM https://docs.virtuemart.net/tutorials/templating-layouts/101-how-to-overwrite-plugins.html
Q: Actually, how do I modify snippet files?
A: Use your file browser extension, alternatively dependant on your host ssh or sftp \plugins\vmcustom\istraxx_rawforms\tmp\ (product.php, prepcart.php, cart.php, order.php)
Q: Can I have more then one custom proto per product?
A: No, currently single raw form is allowed, use single <form> and multiple <input> in rawfield. Contact us for custom solution.
Q: Somehow I broke my snippets, how to restore original files?
A: No problem at all, as always: update of the plugin resets the plugin files.
- Details
- Written by: Valérie Isaksen
- Category: Custom Fields
- Hits: 60011
The plugin Shipment for Virtual Products allows you to ship virtual products (software, music, videos, books) to your customers. It is a custom field product plugin. This tutorial explains how to install and configure the plugin Shipment for Virtual Products.
Installation
- Go inthe menu Extensions > Entension Manager, and install the plugin
- Go in the Extensions > Plug-in Manager, and enable the plugin named Virtuemart 2 | product download
Create a custom field
- Go to Components > VirtueMart
- Select the menu Products > Custom Fields
- Click on the button New
- Select for the field Custom Field Type: Plug-ins
- Enter a Title
- Select for the field Cart Attribute the value Yes
- For the field Select a plug-in, select Virtuemart 2 | product download
- Click on Save
Configure your Safe Path
The files to sell are stored in the folder Safe Path given in the VirtueMart configuration.
- Select the menu Configuration > Configuration
- Select the Templates tab
- The parameter Safe Path is the folder where the files to sell are stored. It should be a path outside your web directory.
Upload your files to sell
- In VirtueMart administration, choose the menu Shop > Media Files.
- Click on the button New, to create a new media.
- Set the role to "for Sale". Set the "Image Action" to "Upload" and press save/store.
When your files are too big for the http upload, use your ftp client. Upload the files into the directory to your safe path. And then use Synchronise media button in your media view
Attach your media to your product
- Select the menu Products > Products
- Click on the product you would like to add a file to sale
- Select the tab Custom Fields
- In the Custom Field Type area, select the custom field you created to attach a downloadable file
- In the downloadable area, select the file you want to attach to your product
- Check the box Provide as stream, if you want to provide the download as a stream.
- If you provide the download as a stream, change the parameter For the field Maximum speed in kb.
- Click on Save & Close
WARNING
When your customers should be able to get files which you do connect later to your product, then it is very important that you never delete your custom and that your first product customfield stays the same. Change the used files, just do not delete it, else prior shoppers are not able to access the download anylonger.
To replace existing file we recommend replace action in vmbe > shop > mediafiles.
Configuration of limits, restrictions and timeframes
- Maximum Downloads means all downloads alltogether
- Maximum downloads per interval in days means how often people are allowed to download your product when you enter a time intervall
- Interval in days is the time in days for the interval
- Maximum number of days for download after the first download is the time how long someone is allowed to download it
- You can set a start or/and a end date for a timeframe
Test your downloadable plugin
On the frontend, select your product, and checkout.
Q: On cart I cannot checkout, instead message appears:
"We are sorry, no shipment method matches the characteristics of your order."
A: Create at least one shipment method named e.g. Download.
Q: I sell virtual and real products. What shall I do?
A: For all your virtual products, set the weigth to 0. For the other products, set the weigth to a value different from 0.
Create at least two shipment methods:
- one free of charge with the weigth condition =0. This shipment will be selected when the shopper only buys virtual products
- one or more other shipment methods for weigth different from 0. Those shipment methods will be selected when non virtual products are in the cart.
Once the order has been confirmed, your client will receive an order containg a link to downloadable file. He can also download the file via his account using his order number and order password.
The download is created using streaming technics. Be aware that the streaming option does not prevent people using “save target as ...”
Important: the download is activated when the order status is set to confirmed/shipped. Downloading the file changes the status of the order item to shipped.
Q: I wanna give free downloads
Adjust your configured paymentmethods and add, if not already set a minimum value of 0.01. Then create another default payment (method: standard) and set the maximum to 0.001 and the "Order Status for Pending transactions" to "confirmed by shopper". Then your customers will recieve an email with the link.
Q: I want to reenable a download
A: You can do this with the the version 2.0.20, but the core needs a small adjustment (wil be in the core with the next release), just search for administrator\components\com_virtuemart\controllers\plugin.php go to line 49 and replace the word getWord with getString, line 49 should look like this then: $name = JRequest::getString('name','');
Another variant to reenable download: View the order (VM > Orders) and click on the green symbol to reset the download counter.
Q: I cannot find my media in the dropdown of the plugin
A: You did not upload your media as “file for sale”
Q: I get file, which size is too small (1-2 kb).
A: Rename the file and add a .html, then open it in a browser, there you can see the error message. Most likely the safe path is not set correctly. Check if your safepath has an ending slash (windows machines a backslash)
Q: How do I set the correct safe path?
Q: The download link does not appear in the email to the client.
A: The download link should be in the email to the client, where the product is listed. Furthermore your client can find the link, checking the order online.
If the link does not appear in the email and/or the order, then this happens almost anytime due a template override of the email or the product details layout. Sometimes people say the link is sometimes there, sometimes not, in this case they have a template providing not correct "add to cart" buttons in the category view.
Q: I get a blank page when clicking on downloading link.
A: The reason can be your bandwidth lowering your server ram usage. Try again with lower value in the Field Maximum speed in kb (1024 = 1MB php RAM) in your Product customfield view.
Q: I moved from VM2 to VM3, on Download plugin now I get error message: 1054-Unknown column 'virtuemart_product_id' in 'field list' SQL=INSERT INTO `'#_virtuemart_product_custom_plg_st42_download` (`id`, ...
What shall I do?
A: Browse in VMBE to the customfields and save the customfield proto, the column is added then.
Q: In the email to vendor there is no download link - is it missing?
A: Currently the download link appears only in shopper email. As admin you can access the download via the order details view.
Q: After the update to version 2.8.8 my downloads are not working anylonger
There is a new feature, which allows to select the order status to deliver the download. Sometimes the fallback to C,S does not work. Open your customfield prototype (/administrator/index.php?option=com_virtuemart&view=custom) and just set the order stati there and all should work again.