Okay
  Public Ticket #3647661
The issue with setting the course price
Closed

Comments

  •  1
    kezalkoatlj started the conversation

    Hello,

    We noticed an issue with the prices when purchasing a course. The problem is that in the settings of the test course, the full price is set to $594, and the discounted price is $396: https://prnt.sc/m4D3P7skc7CU

    However, on the homepage, the course price is displayed as follows: full price - $594, discounted price - $15,681. So, it seems that the full price is not being converted, only the currency sign is changed, while the discounted price is converted: https://prnt.sc/In9iySRllPBw.

    All attempts to change the price from the instructor dashboard have been unsuccessful.  https://fex.net/uk/s/2vnbsol

    From the admin panel, it shows the full price as $15, as we tried to set from the instructor dashboard initially, and the discounted price as $396, as it was initially: https://prnt.sc/chEV0zPBxxTy

    However, when editing from the admin panel, the price is set correctly:

    https://prnt.sc/TevxSWDH5ZxP
    https://prnt.sc/QFENRfGaajG

    What could be causing this problem?

  • [deleted] replied

    well in wpml each language version of course is treated as different

    https://prnt.sc/In9iySRllPBw

    this price is fetched from the product that is connected to this course in that language please edit the course in front end and check its price  in accessibility tab


  •  1
    kezalkoatlj replied

    But we are doing it.
    The course is created in Ukrainian, as you can see in the accessibility tab, which is also in Ukrainian. I'm also editing the course (video) in the Ukrainian version from the instructor's dashboard. And it's not working.

  • [deleted] replied

    as you can see the course has this product set in it and its price is showing correctly there : 

    7559945433.png


  •  1
    kezalkoatlj replied

    As we mentioned, the price became correct because we changed it from the admin panel.
    Please take a look at another course where the price is not displaying correctly.  https://fex.net/uk/s/pk2v2yr

  • [deleted] replied

    im not able to play the video can you attach the video here . 

    also share the url of course to check.

  •  1
    kezalkoatlj replied

    Attached files:  msedge_16lIU1HZN5.mp4

  • [deleted] replied

    hi when createing the or editing the price from front end there is some plugin cuasing the price change there automatically : https://somup.com/cZh36k5ge9

    please check your wpml settings on this , i guess its converting the price while setting the product there .

  •  1
    kezalkoatlj replied

    Hello,

    We contacted WPML about this issue, and they checked everything and wrote: "If the price conversion issue was happening from the WordPress admin area, our development team would be able to add a fix for this. But for any issues arising from the front-end course management screen, WPLMS developers will need to include the necessary changes or fixes." https://wpml.org/forums/topic/the-issue-with-setting-the-course-price/

  • [deleted] replied

    well we are creating / editing the price of product in api call which calls to this code : 

    which as you can see we are using proper wp and woocommerce functions and there is no code involved in currency exchange . 

    the wpml is running thier filter in this core woocommerce function from WC_product class : 


    $product->get_price_html()


    if(function_exists('wc_get_product') && $cpt == 'product'){
                    wp_set_object_terms($id, 'simple', 'product_type');
                    update_post_meta($id,'vibe_wplms',1);
                    $product = wc_get_product($id);
                    if(!empty( $product)){
                        
                        $sale_price = $product->get_sale_price();
                      
                        $regular_price = $product->get_regular_price();
                        if(empty($regular_price)){
                            $price = $product->get_price();
                            if(empty($price)){
                                $price = 0;
                            }
                            
                        }  
                        if(!empty($sale_price)){
                            update_post_meta($id,'_price',$sale_price);
                            $product->set_price($sale_price);//to show correct value in get_price_html
                            
                        }else{
                            if(isset($regular_price)){
                                update_post_meta($id,'_price',$regular_price);
                                $product->set_price($regular_price);
                                
                            }else{
                                update_post_meta($id,'_price',$price);
                                $product->set_price($price);
                                
                            }
                        }
                        if(empty($return['data']['text'])){
                            $return['data']['text'] = $product->get_title();
                        }
                        $return['data']['text'] .= ' - '.$product->get_price_html();
                    }else{
                        $return = array('status'=>false,'message' => _x('Some error occured','',''));
                    }
                    
                }