- ステータス
- 未解決
- 報告対象
- WPML Multilingual & Multicurrency for WooCommerce 5.2.0
- 関連するプラグイン/テーマ
- WooCommerce Memberships
- トピックタグ
- Compatibility
問題の概要
セカンダリ言語で製品を購入すると、メンバーシップが付与されないことがわかります。これは特に、注文後に表示される「Thank you」ページで確認できます。このページには、本来表示されるはずのメンバーシップの詳細がありません。
回避策
続行する前に、サイトの完全なバックアップを作成していることを確認してください。
- …/wp-content/plugins/woocommerce-memberships/src/class-wc-memberships-membership-plan.php ファイルを開きます。
- 218行目を探します。
- 以下のコードを:
public function get_product_ids() { if ( null === $this->product_ids ) { $this->product_ids = get_post_meta( $this->id, $this->product_ids_meta, true ); $this->product_ids = is_array( $this->product_ids ) ? array_unique( array_map( 'absint', $this->product_ids ) ) : []; } return $this->product_ids; } - 次のコードに置き換えます:
public function get_product_ids() { if ( null === $this->product_ids ) { $this->product_ids = get_post_meta( $this->id, $this->product_ids_meta, true ); $this->product_ids = apply_filters( 'wc_memberships_rule_object_ids', $this->product_ids ); $this->product_ids = is_array( $this->product_ids ) ? array_unique( array_map( 'absint', $this->product_ids ) ) : []; } return $this->product_ids; }