This user has no favorite topics.
Favorite Forum Topics
Forum Topics Created
| Status |
Topic
|
Supporter | Voices | Posts | Freshness |
|---|---|---|---|---|---|
|
WooCommerce Smart Coupons
Started by: maartenv-15
in: English Support
Problem: add_filter('woocommerce_coupon_get_wc_sc_add_product_details', 'testing_coupon_discount_after_adding_to_cart');
function testing_coupon_discount_after_adding_to_cart($var) {
foreach ($var as $key => $prod ) {
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
$type = get_post_type($prod["product_id"]);
$translations = apply_filters( 'wpml_get_element_translations', NULL, $prod["product_id"], 'post_'. $type );
$var[$key]["product_id"] = $translations[$my_current_lang]->element_id;<br /> }
return $var;
}5. Save the changes. Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket. |
|
2 | 14 | 1 year, 5 months ago |