Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
woocommerce_bpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wordpress
woocommerce_bpd
Commits
325f8764
Commit
325f8764
authored
Aug 08, 2015
by
Farooq Azam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added class field to addon group
parent
8ba8127d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
class-product-addon-admin.php
admin/class-product-addon-admin.php
+2
-0
html-addon.php
admin/html-addon.php
+6
-0
class-product-addon-display.php
classes/class-product-addon-display.php
+1
-0
addon-start.php
templates/addons/addon-start.php
+11
-1
No files found.
admin/class-product-addon-admin.php
View file @
325f8764
...
@@ -227,6 +227,7 @@ class Product_Addon_Admin {
...
@@ -227,6 +227,7 @@ class Product_Addon_Admin {
$addon_type
=
$_POST
[
'product_addon_type'
];
$addon_type
=
$_POST
[
'product_addon_type'
];
$addon_position
=
$_POST
[
'product_addon_position'
];
$addon_position
=
$_POST
[
'product_addon_position'
];
$addon_required
=
isset
(
$_POST
[
'product_addon_required'
]
)
?
$_POST
[
'product_addon_required'
]
:
array
();
$addon_required
=
isset
(
$_POST
[
'product_addon_required'
]
)
?
$_POST
[
'product_addon_required'
]
:
array
();
$addon_class
=
$_POST
[
'product_addon_class'
];
$addon_option_label
=
$_POST
[
'product_addon_option_label'
];
$addon_option_label
=
$_POST
[
'product_addon_option_label'
];
$addon_option_price
=
$_POST
[
'product_addon_option_price'
];
$addon_option_price
=
$_POST
[
'product_addon_option_price'
];
...
@@ -269,6 +270,7 @@ class Product_Addon_Admin {
...
@@ -269,6 +270,7 @@ class Product_Addon_Admin {
'position'
=>
absint
(
$addon_position
[
$i
]
),
'position'
=>
absint
(
$addon_position
[
$i
]
),
'options'
=>
$addon_options
,
'options'
=>
$addon_options
,
'required'
=>
isset
(
$addon_required
[
$i
]
)
?
1
:
0
,
'required'
=>
isset
(
$addon_required
[
$i
]
)
?
1
:
0
,
'class'
=>
sanitize_text_field
(
stripslashes
(
$addon_class
[
$i
]
)
),
);
);
}
}
}
}
...
...
admin/html-addon.php
View file @
325f8764
...
@@ -36,6 +36,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
...
@@ -36,6 +36,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<textarea
cols=
"20"
id=
"addon_description_
<?php
echo
$loop
;
?>
"
rows=
"3"
name=
"product_addon_description[
<?php
echo
$loop
;
?>
]"
>
<?php
echo
esc_textarea
(
$addon
[
'description'
]
)
?>
</textarea>
<textarea
cols=
"20"
id=
"addon_description_
<?php
echo
$loop
;
?>
"
rows=
"3"
name=
"product_addon_description[
<?php
echo
$loop
;
?>
]"
>
<?php
echo
esc_textarea
(
$addon
[
'description'
]
)
?>
</textarea>
</td>
</td>
</tr>
</tr>
<tr>
<td
class=
"addon_class"
width=
"50%"
>
<label
for=
"addon_class_
<?php
echo
$loop
;
?>
"
>
<?php
_e
(
'Group Class'
,
'woocommerce-product-addons'
);
?>
</label>
<input
type=
"text"
id=
"addon_class_
<?php
echo
$loop
;
?>
"
name=
"product_addon_class[
<?php
echo
$loop
;
?>
]"
value=
"
<?php
echo
esc_attr
(
$addon
[
'class'
]
)
?>
"
/>
</td>
</tr>
<tr>
<tr>
<td
class=
"data"
colspan=
"3"
>
<td
class=
"data"
colspan=
"3"
>
<table
cellspacing=
"0"
cellpadding=
"0"
>
<table
cellspacing=
"0"
cellpadding=
"0"
>
...
...
classes/class-product-addon-display.php
View file @
325f8764
...
@@ -145,6 +145,7 @@ class Product_Addon_Display {
...
@@ -145,6 +145,7 @@ class Product_Addon_Display {
'name'
=>
$addon
[
'name'
],
'name'
=>
$addon
[
'name'
],
'description'
=>
$addon
[
'description'
],
'description'
=>
$addon
[
'description'
],
'type'
=>
$addon
[
'type'
],
'type'
=>
$addon
[
'type'
],
'class'
=>
$addon
[
'class'
],
),
'woocommerce-product-addons'
,
$this
->
plugin_path
()
.
'/templates/'
);
),
'woocommerce-product-addons'
,
$this
->
plugin_path
()
.
'/templates/'
);
echo
$this
->
get_addon_html
(
$addon
);
echo
$this
->
get_addon_html
(
$addon
);
...
...
templates/addons/addon-start.php
View file @
325f8764
<div
class=
"
<?php
if
(
1
==
$required
)
echo
'required-product-addon'
;
?>
product-addon product-addon-
<?php
echo
sanitize_title
(
$name
);
?>
"
>
<?php
$classes
=
array
();
if
(
1
==
$required
)
{
$classes
[]
=
'required-product-addon'
;
}
$classes
[]
=
'product-addon product-addon-'
.
sanitize_title
(
$name
);
$classes
[]
=
$class
;
?>
<div
class=
"
<?php
echo
implode
(
' '
,
$classes
);
?>
"
>
<?php
do_action
(
'wc_product_addon_start'
,
$addon
);
?>
<?php
do_action
(
'wc_product_addon_start'
,
$addon
);
?>
...
...
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