Rawforms - price per input +100 €
This plugin allows product price modification by shopper input, e.g. count chars, words, checkbox selection, radio boxes or any other type of user form input using php and html code snippets.
- Uses VirtueMart custom fields to display form field to shopper
- Easy to override template views, adjust the form to your template using joomla html override technique
You can insert your product related forms directly into the product details page. Use VirtueMart customfields to bring up your form in your product. You can use all advantages of customfield pattern, to precreate form patterns to be applied to your products in a breez.
Moreover as VirtueMart follows Joomla override techniques you can change the display of views within your joomla template as an override, to keep plugin core files and template overrides separated for convenient update of your extension.
Which code do I have to know?
Be prepared for short php and html, change only what is intended to be changed, described in tutorial.
- product.php - display form in product details - adjust to meet your template and layout definition
- prepcart.php - form calculation - calculation related modifications belong here
- cart.php - display form in cart view - adjust to meet your template
- order.php - display form in order view - adjust to meet your template
What does this demo product show?
Two basic cases are shown:
1. add price modificator +1 € for every char that is present in form field
2. add price modificator +100 € for every input
Case 1: shopper inserts a value, the custom price is added. In our example here we have added one statement to add +1€ for each char added into the form. The case is described in tutorial.
> for this example here we have added one statement to the snippet file additionally:
> $customfield->custom_price_by_letter = 1; // now the custom price is applied for charcount, respectively for each char added to form field by shopper.
Result: +1€ for each form char added to price modificator sum
Case 2: shopper inserts a value, the custom price is added. In our example here we
> uncommented $customfield->custom_price_by_letter = 1;
> conditional fallback is $charcount = 1, customfield price has been set to 100€ for any string entered in form.
Result: +100€ for each form string added to price modificator sum
See detailed tutorial: https://extensions.virtuemart.net/account-tutorials/9-custom-fields/31-rawforms
Link to product: extensions.virtuemart.net/back-office/tools/rawforms-detail