Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VirtueMart
Name the Price for Virtuemart
Commits
95399dca
Commit
95399dca
authored
Oct 10, 2015
by
Reinhold Kainhofer
Browse files
V1.4: When lower bound is given, automatically initialize the product price with that bound
parent
70d48de2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
95399dca
BASE
=
nametheprice
PLUGINTYPE
=
vmcustom
VERSION
=
1.
3
FILEBASE
=
opentools_vm
2
VERSION
=
1.
4
FILEBASE
=
opentools_vm
PLUGINFILES
=
$(BASE)
.php
$(BASE)
.script.php
$(BASE)
.xml index.html
...
...
nametheprice.xml
View file @
95399dca
...
...
@@ -6,7 +6,7 @@
<authorUrl>
http://www.open-tools.net/
</authorUrl>
<copyright>
Copyright (C) 2013-2014 Reinhold Kainhofer. All rights reserved.
</copyright>
<license>
http://www.gnu.org/licenses/gpl.html GNU/GPL v3+
</license>
<version>
1.
3
</version>
<version>
1.
4
</version>
<description>
VMCUSTOM_NAMETHEPRICE_DESC
</description>
<files>
<filename
plugin=
"nametheprice"
>
nametheprice.php
</filename>
...
...
nametheprice/tmpl/default.php
View file @
95399dca
...
...
@@ -19,8 +19,7 @@ if (!defined('VM_VERSION') or VM_VERSION < 3) { // VM2:
$name
=
'customProductData['
.
$field
->
virtuemart_product_id
.
']['
.
$field
->
virtuemart_custom_id
.
']['
.
$field
->
virtuemart_customfield_id
.
'][customprice]'
;
}
?>
<input
class=
"
<?php
echo
$class
?>
"
type=
"text"
value=
""
size=
"6"
name=
"
<?php
echo
$name
?>
"
>
<?php
echo
CurrencyDisplay
::
getInstance
()
->
getSymbol
();
?>
<br
/>
<input
class=
"
<?php
echo
$class
?>
"
type=
"text"
value=
"
<?php
if
(
is_numeric
(
$field
->
min_amount
)
and
$field
->
min_amount
>
0
)
echo
$field
->
min_amount
;
?>
"
size=
"6"
name=
"
<?php
echo
$name
?>
"
>
<?php
echo
CurrencyDisplay
::
getInstance
()
->
getSymbol
();
?>
<br
/>
<?php
// preventing 2 x load javascript
static
$namethepricejs
;
...
...
@@ -30,15 +29,23 @@ if (!defined('VM_VERSION') or VM_VERSION < 3) { // VM2:
//javascript to update price
$script
=
'
/* <![CDATA[ */
var namethepricefunc = function($) {
var namethepricefunction = function(formProduct) {
virtuemart_product_id = formProduct.find(\'input[name="virtuemart_product_id[]"]\').val();
Virtuemart.setproducttype(formProduct,virtuemart_product_id);
};
var registernamethepricefunc = function($) {
jQuery(".vmcustom-nametheprice").keyup(function() {
formProduct = $(this).parents("form.product");
virtuemart_product_id = formProduct.find(\'input[name="virtuemart_product_id[]"]\').val();
Virtuemart.setproducttype(formProduct,virtuemart_product_id);
});
formProduct = $(this).parents("form.product");
namethepricefunction(formProduct);
});
};
jQuery("body").on("updateVirtueMartProductDetail", namethepricefunc);
jQuery(document).ready(namethepricefunc);
jQuery("body").on("updateVirtueMartProductDetail", registernamethepricefunc);
jQuery(document).ready(registernamethepricefunc);
jQuery(document).ready(function() {
jQuery(document).find("form.product").each(function() {
namethepricefunction(jQuery(this));
});
});
/* ]]> */
'
;
$document
=
JFactory
::
getDocument
()
->
addScriptDeclaration
(
$script
);
...
...
releases/plg_opentools_vm
2
_nametheprice_v1.2.zip
→
releases/plg_opentools_vm_nametheprice_v1.2.zip
View file @
95399dca
File moved
releases/plg_opentools_vm
2
_nametheprice_v1.3.zip
→
releases/plg_opentools_vm_nametheprice_v1.3.zip
View file @
95399dca
File moved
releases/plg_opentools_vm_nametheprice_v1.4.zip
0 → 100644
View file @
95399dca
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment