Andrii Gorkovenko
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Hey hey, this is my solution:
<?php
// add to functions.php
include_once('class-wpml-rest-extend-args.php');
?>
<?php
// file create in your theme class-wpml-rest-extend-args.php
class Fix_WPML_REST_Extend_Args extends WPML_REST_Extend_Args {
// Prefix of endpoints from which need remove param REST_LANGUAGE_ARGUMENT
// Here example: /wp/v means all endpoint which started from wp/v1, wp/v2, wp/vqwr, ...
private $excluded_prefix = '/wp/p';
public function rest_endpoints( array $endpoints ) {
foreach ( $endpoints as $route => &$endpoint ) {
if ( strpos($route, $this->excluded_prefix) === 0 ) { // Проверяем, начинается ли маршрут с /wapi/v
foreach ( $endpoint as $key => &$data ) {
if ( is_numeric( $key ) && isset($data['args'][self::REST_LANGUAGE_ARGUMENT])) {
unset($data['args'][self::REST_LANGUAGE_ARGUMENT]);
}
}
}
}
return $endpoints;
}
}
// Replace original object
global $sitepress;
$custom_wpml = new Fix_WPML_REST_Extend_Args($sitepress);
$custom_wpml->add_hooks();
?>- This reply was modified 4 days, 1 hour ago by Andrii Gorkovenko.
Ок, спасибо! Решено
@kotyarashop подскажите как вы решили вопрос с подтягиванием городов и отделений НП
Автор плагина указал два варианта как из вы задействовали?
Спасибо!
### Не актально ###
Снес плагин Checkout.
И дописал пару строк в своем плагине который удалил ненужные поля.
Пример кода:add_filter('woocommerce_billing_fields', 'goa_override_checkout_fields') function goa_override_checkout_fields($fields) { unset($fields['billing']['billing_company']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_postcode']); return $fields; }
- This reply was modified 4 years, 10 months ago by Andrii Gorkovenko.
- This reply was modified 4 years, 10 months ago by Andrii Gorkovenko.
Forum: Plugins
In reply to: [Price Based on Country for WooCommerce] Got warning and a fatal errorThank you!
Very quickly!
Viewing 4 replies - 1 through 4 (of 4 total)