質問編集履歴
3
補足のコードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -38,5 +38,37 @@
|
|
38
38
|
}
|
39
39
|
```
|
40
40
|
という記述があります。
|
41
|
+
|
42
|
+
また、wc_product1_is_in_the_cart()の定義は以下の通りです。
|
43
|
+
```php
|
44
|
+
function wc_product1_is_in_the_cart()
|
45
|
+
{
|
46
|
+
// Add your special product IDs here
|
47
|
+
$ids = array(
|
48
|
+
'6231',
|
49
|
+
'6277',
|
50
|
+
'6233',
|
51
|
+
'6278',
|
52
|
+
'6234',
|
53
|
+
);;
|
54
|
+
|
55
|
+
// Products currently in the cart
|
56
|
+
$cart_ids = array();
|
57
|
+
|
58
|
+
// Find each product in the cart and add it to the $cart_ids array
|
59
|
+
foreach (WC()->cart->get_cart() as $cart_item_key => $values) {
|
60
|
+
$cart_product = $values['data'];
|
61
|
+
$cart_ids[] = $cart_product->get_id();
|
62
|
+
}
|
63
|
+
|
64
|
+
// If one of the special products are in the cart, return true.
|
65
|
+
if (!empty(array_intersect($ids, $cart_ids))) {
|
66
|
+
return true;
|
67
|
+
} else {
|
68
|
+
return false;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
```
|
72
|
+
|
41
73
|
他に必要な情報がありましたら、追加で記述いたします。
|
42
74
|
どなたかお力を貸していただければ幸いです。
|
2
内容の訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
}
|
23
23
|
}
|
24
24
|
```
|
25
|
-
動作確認のため、Product2を注文・確定すると、確認メールには「
|
25
|
+
動作確認のため、Product2を注文・確定すると、確認メールには「Non refundable.」と表示されてしまいます。
|
26
26
|
|
27
27
|
|
28
28
|
### 補足
|
1
タグの追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|