Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
woocommerce-galaxyfunder
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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-galaxyfunder
Commits
92df61f8
Commit
92df61f8
authored
9 years ago
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support currency switcher for perk boxes
parent
6ceb6446
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
crowdfunding.php
crowdfunding.php
+12
-2
class_perk_metabox.php
inc/class_perk_metabox.php
+3
-2
price.php
woocommerce/single-product/price.php
+1
-1
description.php
woocommerce/single-product/tabs/description.php
+2
-2
No files found.
crowdfunding.php
View file @
92df61f8
...
@@ -1873,7 +1873,7 @@ class CrowdFunding {
...
@@ -1873,7 +1873,7 @@ class CrowdFunding {
jQuery
(
".price-wrapper .button"
).
attr
(
"data-productid"
,
"
<?php
echo
$newid
;
?>
"
);
jQuery
(
".price-wrapper .button"
).
attr
(
"data-productid"
,
"
<?php
echo
$newid
;
?>
"
);
<?php
<?php
if
(
function_exists
(
'get_product'
))
{
if
(
function_exists
(
'get_product'
))
{
$products
=
get_product
(
$post
->
ID
);
$products
=
get_product
(
$post
->
ID
);
if
(
!
$products
->
is_type
(
'variable'
))
{
if
(
!
$products
->
is_type
(
'variable'
))
{
?>
?>
<?php
<?php
...
@@ -3105,7 +3105,6 @@ class CrowdFunding {
...
@@ -3105,7 +3105,6 @@ class CrowdFunding {
foreach
(
$perkrule
as
$key
=>
$perk
)
{
foreach
(
$perkrule
as
$key
=>
$perk
)
{
$perkname
=
str_replace
(
''
,
'_'
,
$perk
[
'name'
]);
$perkname
=
str_replace
(
''
,
'_'
,
$perk
[
'name'
]);
$currentcount
=
(
int
)
get_post_meta
(
$item
[
'product_id'
],
$perkname
.
$perk
[
'amount'
]
.
'update_perk_claim'
,
true
);
$currentcount
=
(
int
)
get_post_meta
(
$item
[
'product_id'
],
$perkname
.
$perk
[
'amount'
]
.
'update_perk_claim'
,
true
);
if
(
$perk
[
'limitperk'
]
==
'cf_limited'
)
{
if
(
$perk
[
'limitperk'
]
==
'cf_limited'
)
{
...
@@ -4222,4 +4221,15 @@ if (get_option('cf_campaign_restrict_other_products') == '1') {
...
@@ -4222,4 +4221,15 @@ if (get_option('cf_campaign_restrict_other_products') == '1') {
add_action
(
'woocommerce_add_to_cart_validation'
,
'cf_restrict_add_to_cart_products'
,
10
,
5
);
add_action
(
'woocommerce_add_to_cart_validation'
,
'cf_restrict_add_to_cart_products'
,
10
,
5
);
}
}
add_action
(
'woocommerce_single_product_summary'
,
array
(
'CrowdFunding'
,
'checkingfrontend_galaxy'
));
add_action
(
'woocommerce_single_product_summary'
,
array
(
'CrowdFunding'
,
'checkingfrontend_galaxy'
));
// Experimental currency switcher support
function
woocs_convert
(
$amount
)
{
if
(
class_exists
(
"WC_Aelia_CurrencySwitcher"
))
{
$woocs_instance
=
WC_Aelia_CurrencySwitcher
::
instance
();
$woocs_settings
=
WC_Aelia_CurrencySwitcher
::
settings
();
$amount
=
$woocs_instance
->
convert
(
$amount
,
$woocs_settings
->
base_currency
(),
$woocs_instance
->
get_selected_currency
());
}
return
$amount
;
}
?>
?>
This diff is collapsed.
Click to expand it.
inc/class_perk_metabox.php
View file @
92df61f8
...
@@ -660,6 +660,7 @@ class CFPerkMetaBox {
...
@@ -660,6 +660,7 @@ class CFPerkMetaBox {
<?php
}
?>
<?php
}
?>
<?php
<?php
foreach
(
$perkrule
as
$i
=>
$perk
)
{
foreach
(
$perkrule
as
$i
=>
$perk
)
{
$perk
[
'amount'
]
=
woocs_convert
(
$perk
[
'amount'
]);
$perkname
=
str_replace
(
''
,
'_'
,
$perk
[
'name'
]);
$perkname
=
str_replace
(
''
,
'_'
,
$perk
[
'name'
]);
//echo $newcounterclaim = (int) get_post_meta($post->ID, $perkname . '[update_perk_claim]', true);
//echo $newcounterclaim = (int) get_post_meta($post->ID, $perkname . '[update_perk_claim]', true);
$newcounterclaim
=
(
int
)
get_post_meta
(
$post
->
ID
,
$perkname
.
$perk
[
'amount'
]
.
'update_perk_claim'
,
true
);
$newcounterclaim
=
(
int
)
get_post_meta
(
$post
->
ID
,
$perkname
.
$perk
[
'amount'
]
.
'update_perk_claim'
,
true
);
...
@@ -1344,6 +1345,7 @@ class CFPerkMetaBox {
...
@@ -1344,6 +1345,7 @@ class CFPerkMetaBox {
<?php
}
?>
<?php
}
?>
<?php
<?php
foreach
(
$perkrule
as
$i
=>
$perk
)
{
foreach
(
$perkrule
as
$i
=>
$perk
)
{
$perk
[
'amount'
]
=
woocs_convert
(
$perk
[
'amount'
]);
$perkname
=
str_replace
(
''
,
'_'
,
$perk
[
'name'
]);
$perkname
=
str_replace
(
''
,
'_'
,
$perk
[
'name'
]);
//echo $newcounterclaim = (int) get_post_meta($post->ID, $perkname . '[update_perk_claim]', true);
//echo $newcounterclaim = (int) get_post_meta($post->ID, $perkname . '[update_perk_claim]', true);
$newcounterclaim
=
(
int
)
get_post_meta
(
$post
->
ID
,
$perkname
.
$perk
[
'amount'
]
.
'update_perk_claim'
,
true
);
$newcounterclaim
=
(
int
)
get_post_meta
(
$post
->
ID
,
$perkname
.
$perk
[
'amount'
]
.
'update_perk_claim'
,
true
);
...
@@ -1689,7 +1691,6 @@ class CFPerkMetaBox {
...
@@ -1689,7 +1691,6 @@ class CFPerkMetaBox {
$perkrule
=
get_post_meta
(
$post
->
ID
,
'perk'
,
true
);
$perkrule
=
get_post_meta
(
$post
->
ID
,
'perk'
,
true
);
$i
=
0
;
$i
=
0
;
foreach
(
$perkrule
as
$perk
)
{
foreach
(
$perkrule
as
$perk
)
{
foreach
(
$listofamount
as
$amount
)
{
foreach
(
$listofamount
as
$amount
)
{
if
(
$perk
[
'amount'
]
==
(
int
)
$amount
)
{
if
(
$perk
[
'amount'
]
==
(
int
)
$amount
)
{
$length
=
count
(
array_keys
(
$listofamount
,
(
int
)
$amount
));
$length
=
count
(
array_keys
(
$listofamount
,
(
int
)
$amount
));
...
@@ -1786,4 +1787,4 @@ add_shortcode('displayperk', array('CFPerkMetaBox', 'cf_perk_rule_front_end_shor
...
@@ -1786,4 +1787,4 @@ add_shortcode('displayperk', array('CFPerkMetaBox', 'cf_perk_rule_front_end_shor
add_action
(
'wp_ajax_nopriv_selectperkoption'
,
array
(
'CFPerkMetaBox'
,
'galaxy_funder_update_perk_rule'
));
add_action
(
'wp_ajax_nopriv_selectperkoption'
,
array
(
'CFPerkMetaBox'
,
'galaxy_funder_update_perk_rule'
));
add_action
(
'wp_ajax_selectperkoption'
,
array
(
'CFPerkMetaBox'
,
'galaxy_funder_update_perk_rule'
));
add_action
(
'wp_ajax_selectperkoption'
,
array
(
'CFPerkMetaBox'
,
'galaxy_funder_update_perk_rule'
));
?>
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
woocommerce/single-product/price.php
View file @
92df61f8
...
@@ -19,4 +19,4 @@ global $post, $product;
...
@@ -19,4 +19,4 @@ global $post, $product;
<meta
itemprop=
"priceCurrency"
content=
"
<?php
echo
get_woocommerce_currency
();
?>
"
/>
<meta
itemprop=
"priceCurrency"
content=
"
<?php
echo
get_woocommerce_currency
();
?>
"
/>
<link
itemprop=
"availability"
href=
"http://schema.org/
<?php
echo
$product
->
is_in_stock
()
?
'InStock'
:
'OutOfStock'
;
?>
"
/>
<link
itemprop=
"availability"
href=
"http://schema.org/
<?php
echo
$product
->
is_in_stock
()
?
'InStock'
:
'OutOfStock'
;
?>
"
/>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
woocommerce/single-product/tabs/description.php
View file @
92df61f8
...
@@ -11,9 +11,9 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
...
@@ -11,9 +11,9 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global
$woocommerce
,
$post
;
global
$woocommerce
,
$post
;
$heading
=
esc_html
(
apply_filters
(
'woocommerce_product_description_heading'
,
__
(
'
Product Description
'
,
'woocommerce'
)
)
);
$heading
=
esc_html
(
apply_filters
(
'woocommerce_product_description_heading'
,
__
(
'
About this project
'
,
'woocommerce'
)
)
);
?>
?>
<h2>
<?php
echo
$heading
;
?>
</h2>
<h2>
<?php
echo
$heading
;
?>
</h2>
<?php
the_content
();
?>
<?php
the_content
();
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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