MultivendorX
-
AuthorPosts
-
-
January 24, 2024 at 10:13 PM #216676l.ganParticipant
Hello, thanks for your support. I recently updated and see this error in the debug. Could you help me with the code, I don’t quite understand what I should fix, because Your team previously provided me with this code.
I get an error:
Deprecated: The WP_User->id function was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID. in /wp-includes/functions.php on line 6031//code that causes an error. Output in the product tab.
<?php
/*$vendor = get_userdata(get_the_author_meta(‘ID’));
$vendor_dni_vozv_vend = get_user_meta($vendor->id, ‘_dni_vozv_vend’, true );
if ( $vendor_dni_vozv_vend ) {
if ( $vendor_dni_vozv_vend ) {
echo ‘<span class=”grtxt”>’
.’free return ‘
.'</span>’
.'<div class=”dnivozvvend”>’ . $vendor_dni_vozv_vend
. ‘ day.’
. ‘</div>’;
} else {
echo ”;
}
echo ”;
}
?>code into PHP functionality.
add_action( ‘mvx_after_shop_front’, ‘extra_setting_fields’ );
/*form for vendor dashboard set field*/
function extra_setting_fields() {
global $MVX;
$vendor_id = get_current_vendor_id();
$dni_vozv_vend = ”;
$dni_vozv_vend = get_user_meta($vendor_id, ‘_dni_vozv_vend’, true) ? get_user_meta($vendor_id, ‘_dni_vozv_vend’, true) : $dni_vozv_vend;
?>
<div class=”panel panel-default panel-outer-heading”>
<div class=”panel-heading d-flex”>
<h3><?php _e(‘Return of goods’, ‘multivendorx’); ?></h3>
</div>
<div class=”panel-body panel-content-padding form-horizontal”>
<div class=”mvx_media_block”>
<div class=”form-group”>
<label class=”control-label col-sm-3 col-md-3″><?php _e(‘How many days after setting the status as “Completed” can the buyer return the product: (For example: 14 days)’, ‘ multivendorx’); ?></label>
<div class=”col-md-6 col-sm-9″>
<input type=”text” name=”dni_vozv_vend” class=”form-control” value= “<?php echo $dni_vozv_vend; ?>” >
</div>
</div>
</div>
</div>
</div>
<?php
}Thank you
-
January 25, 2024 at 6:15 PM #216709Sangita Support SquadKeymaster
@l.gan Sorry to hear that you have faced an issue on your end. But it is really difficult for our support team to check your custom code line by line.
Our team predicted that you are getting the deprecated issue because of the following line in your code –/*$vendor = get_userdata(get_the_author_meta(‘ID’));
CopyWe would suggest you replace the above line with the below one as the function has been updated from wordpress’s end. You can go through this doc https://developer.wordpress.org/reference/functions/get_userdata/ to know why the function has been updated by WordPress –
get_userdata(get_the_author_meta('ID'))->ID;
Copy -
January 26, 2024 at 6:39 PM #216726l.ganParticipant
Thank you for your help.
Could you check (this is not related to my custom code).
I don’t use the vendor sidebar from the MultivendoX plugin, I use the store sidebar for the vendor page.
In order to display the coupons provided by the vendor, on the vendor’s store page I added a widget to the sidebar of the store to display coupons from the MultivendoX plugin.
Everything is ok on the vendor’s store page. (widget is displayed, no errors)
On the product catalog page (site.com/catalog) I see a message in the place where the coupon display widget is located (the widget itself is not displayed – that’s ok)Error text:
Warning: Undefined property: WP_Post_Type::$term_id in public_html/wp-content/plugins/dc-woocommerce-multi-vendor/includes/mvx-core-functions.php on line 4206
Copy -
January 27, 2024 at 1:39 PM #216743Sangita Support SquadKeymaster
We are able to recreate this on our end. Our team is looking into this. We will add a fix for this soon and keep you posted regarding the same.
You can keep track of the issue from here https://github.com/multivendorx/MultiVendorX/issues/644. -
January 27, 2024 at 5:34 PM #216748Sangita Support SquadKeymasterThis reply has been marked as private.
-
February 7, 2024 at 9:42 AM #216983Sangita Support SquadKeymaster
You are welcome.
Let us know if you need any further assistance.
-
April 8, 2024 at 2:09 PM #218861Sangita Support SquadKeymaster
It’s been long and we have not heard back from you. We are closing this thread. If you need help or face issue in future please create a new support ticket.
-
-
AuthorPosts
The topic ‘Deprecated: The WP_User->id function was called with an argument’ is closed to new replies.