Public static function settingstab woocommerce admin fields selfgetsettings public static function updatesettings woocommerce update options selfgetsettings public static function getsettings settings array sectiontitle array name , woocommerce settings tab convert price , type title, desc , id wcsettingstabconvertpricesectiontitle , curse array name , woocommerce settings tab convert price , type text, desc ., woocommerce settings tab convert price , id wcsettingstabextrapricecurse , percent array name , woocommerce settings tab convert price , type text, desc , id wcsettingstabextrapricepercent , sectionend array type sectionend, id wcsettingstabconvertpricesectionend .
Return applyfilters wcsettingstabconvertpricesettings, settings denmark telegram data WCSettingsTabConvertPriceinit Paste the code into the functions file of the child theme or using the Custom Functions plugin After inserting the code, a new tab Added value will appear in the WooCommerce Settings section. On the tab page there will be fields Rate with tenge and Percentage. Now you can specify the exchange rate of tenge to ruble in the fields currently it is .. And in the second field specify the additional percentage, for example Step Recalculate the price of the product and add.
A percentage the functions file of a child theme or using the Custom addextraprice function addextrapriceprice global product curse getoption wcsettingstabextrapricecurse percent getoption wcsettingstabextrapricepercent return price percent price curse The code changes the product cent according to the specified parameters and adds a filter to rawwoocommerceprice. The math here is simple divide the price indicated in the product in tenge by , multiply by the percentage and add the price you get the price in tenge percentage. Then multiply.
Functions plugin addfilter raw woocommerce price
-
- Posts: 540
- Joined: Tue Dec 24, 2024 4:06 am