Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Advanced Ordernumbers for VirtueMart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VirtueMart
Advanced Ordernumbers for VirtueMart
Commits
ce6b3827
Commit
ce6b3827
authored
12 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Version 1.4: Fix randomString (forgot to move to callback class)
parent
1a6682c0
Branches
Branches containing commit
Tags
V1.4
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
ordernumber.php
+10
-10
10 additions, 10 deletions
ordernumber.php
ordernumber.xml
+2
-2
2 additions, 2 deletions
ordernumber.xml
releases/plg_vmshopper_ordernumber_v1.4.zip
+0
-0
0 additions, 0 deletions
releases/plg_vmshopper_ordernumber_v1.4.zip
with
13 additions
and
13 deletions
Makefile
+
1
−
1
View file @
ce6b3827
BASE
=
ordernumber
PLUGINTYPE
=
vmshopper
VERSION
=
1.
3
VERSION
=
1.
4
PLUGINFILES
=
$(
BASE
)
.php
$(
BASE
)
.xml index.html
# TRANSDIR=../../../administrator/language/
...
...
This diff is collapsed.
Click to expand it.
ordernumber.php
+
10
−
10
View file @
ce6b3827
...
...
@@ -20,6 +20,16 @@ class ReplacementCallback {
$this
->
orderDetails
=
$orderDetails
;
}
/* Return a random "string" of the given length taken from the given alphabet */
static
function
randomString
(
$alphabet
,
$len
)
{
$alen
=
strlen
(
$alphabet
);
$r
=
""
;
for
(
$n
=
0
;
$n
<
$len
;
$n
++
)
{
$r
.
=
$alphabet
[
mt_rand
(
0
,
$alen
-
1
)];
}
return
$r
;
}
function
replace
(
$match
)
{
$varname
=
strtolower
(
$match
[
1
]);
switch
(
$varname
)
{
...
...
@@ -93,16 +103,6 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
// We don't need this function, but the parent class declares it abstract, so we need to overload
function
plgVmOnUpdateOrderBEShopper
(
$_orderID
)
{}
/* Return a random "string" of the given length taken from the given alphabet */
static
function
randomString
(
$alphabet
,
$len
)
{
$alen
=
strlen
(
$alphabet
);
$r
=
""
;
for
(
$n
=
0
;
$n
<
$len
;
$n
++
)
{
$r
.
=
$alphabet
[
mt_rand
(
0
,
$alen
-
1
)];
}
return
$r
;
}
/* Replace the format variables, match[1] is the variable name, match[2] and match[3] are only used for random fields */
function
replace_fields
(
$fmt
,
$orderDetails
)
{
...
...
This diff is collapsed.
Click to expand it.
ordernumber.xml
+
2
−
2
View file @
ce6b3827
...
...
@@ -7,9 +7,9 @@
<authorUrl>
http://www.kainhofer.com/
</authorUrl>
<copyright>
Copyright (C) 2012 Reinhold Kainhofer. All rights reserved.
</copyright>
<license>
http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
</license>
<version>
1.
3
.0
</version>
<version>
1.
4
.0
</version>
<releaseDate>
2012-11-13
</releaseDate>
<releaseType>
M
aj
or update
</releaseType>
<releaseType>
M
in
or update
</releaseType>
<downloadUrl>
http://www.kainhofer.com/virtuemart-2-extensions/
</downloadUrl>
<description>
VMSHOPPER_ORDERNUMBER_DESC
</description>
...
...
This diff is collapsed.
Click to expand it.
releases/plg_vmshopper_ordernumber_v1.4.zip
0 → 100644
+
0
−
0
View file @
ce6b3827
File added
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment