WCMp Core
-
AuthorPosts
-
-
July 9, 2021 at 6:50 PM #124484MaxenceTPParticipant
Hello,
I have two product descriptions: one in French and one in English. In Woocommerce I can modify both descriptions thanks to the “Advanced Custom Fields” plugin which allows me to add another text field like this: https://prnt.sc/19gugmzAll this works perfectly, the problem is that the seller from his panel can’t modify the 2nd description I added.
How can I copy the “Product description” field to put a second similar one but save the text in the “description_fr” meta?
Here is an example (I just modified the html in my browser): https://prnt.sc/19gwlyxThank you very much for your help, I know it requires some modifications but otherwise it prevents me from using the product creation feature of your plugin correctly.
-
July 9, 2021 at 7:39 PM #124575NerdySupportExpert MoumitaKeymaster
@MaxenceTP, it will be really helpful for us if you can share a video to explain the issue.
Also, do you think if the vendor can access the field of ACF it will solve the issue? -
July 9, 2021 at 8:13 PM #124581MaxenceTPParticipant
Hey!
“do you think if the vendor can access the field of ACF it will solve the issue?”
-> I think, yes 🙂The video is in the next private post to be sure you understand correctly.
-
July 9, 2021 at 8:14 PM #124582MaxenceTPParticipantThis reply has been marked as private.
-
July 10, 2021 at 4:25 PM #124603NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
July 10, 2021 at 8:17 PM #124619MaxenceTPParticipant
I’m not using any multilingual plugin. That’s only custom code to add this 2nd description.
I saw this addon, but that’s a little bit expensive just for adding a 2nd text editor which save the content into the “description_fr” variable :/ -
July 12, 2021 at 6:01 PM #124669MVX Support NinjaKeymaster
hi
can you explain the flow of your custom code !!
-
July 12, 2021 at 6:15 PM #124673MaxenceTPParticipant
The custom code is only to show this 2nd description on the Woocommerce product page.
On the admin side, I use “Advanced Custom Fields” to add a textbox to edit the following post_meta : “description_fr” -
July 12, 2021 at 8:11 PM #124691MVX Support NinjaKeymaster
@MaxenceTP, the only solution would be to add a custom field in the vendor’s add product page and display the same. For help, you can check this : https://multivendorx.com/tech-blog/add-new-tab-in-add-product-page/
-
July 12, 2021 at 11:37 PM #124699MaxenceTPParticipant
Yes I see, but is it possible to add a fiel like that https://prnt.sc/19gwlyx instead ?
-
July 13, 2021 at 6:43 PM #124770MVX Support NinjaKeymaster
Hi,
kindly check out the template link from github.
link – https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/templates/vendor-dashboard/product-manager/views/html-product-data-policy.phpRegards,
-
July 13, 2021 at 9:57 PM #124800MaxenceTPParticipant
Okay so I was able to create the 2nd description editor by overwriting the edit-product.php. The content is correctly loaded, but I don’t know how to save the result of the wp_editor into the meta “description_fr”.
Here is the code I added :
<div class="form-group product-description"> <label class="control-label col-md-12" for="product_description_fr"><?php esc_attr_e( 'Product description - FR', 'dc-woocommerce-multi-vendor' ); ?></label> <div class="col-md-12"> <?php $settings = array( 'textarea_name' => 'product_description_fr', 'textarea_rows' => get_option('default_post_edit_rows', 10), 'quicktags' => array( 'buttons' => 'em,strong,link' ), 'tinymce' => array( 'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator', 'theme_advanced_buttons2' => '', ), 'editor_css' => '<style>#wp-product_description_fr-editor-container .wp-editor-area{height:175px; width:100%;}</style>', ); if( !apply_filters( 'wcmp_vendor_product_description_richedit', true ) ) { $settings['tinymce'] = $settings['quicktags'] = $settings['media_buttons'] = false; } wp_editor( get_post_meta($product_object->id,'description_fr',true), 'product_description_fr', $settings ); ?> </div> </div>
Copy -
July 14, 2021 at 6:44 PM #124836MVX Support NinjaKeymaster
Hi,
Using below hook you can save the data.do_action( 'wcmp_process_product_object', $product, $_POST );
CopyRegards,
-
July 15, 2021 at 12:20 AM #124863MaxenceTPParticipant
Can you help me a bit more on the code I have to use?
The goal is to update the “description_fr” meta of the post -
July 15, 2021 at 6:55 PM #124902MVX Support NinjaKeymaster
Hi,
Please add this code in the function.php of the current active theme and check:
function save_custom_product_data( $product, $post_data ) { if( isset($post_data['post_ID']) && isset($post_data['product_description_fr'])) { update_post_meta( absint( $post_data['post_ID'] ), 'description_fr', $post_data['product_description_fr']); } } add_action( 'wcmp_process_product_object', 'save_custom_product_data', 10, 2 );
CopyRegards,
-
July 15, 2021 at 7:23 PM #124921MaxenceTPParticipant
Thanks !
It’s working :p -
July 15, 2021 at 7:55 PM #124931NerdySupportExpert MoumitaKeymaster
We are happy to help @MaxenceTP
-
September 17, 2021 at 6:56 PM #127774MVX Support NinjaKeymaster
we are happy to help you
We would love it if you shared your experience by giving us 5/5 review here :
https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post
Seeing glowing reviews from existing customers makes others more comfortable knowing they’ll get the support they need with an issue with our services when arise.
-
-
AuthorPosts
The topic ‘Add a 2nd product description field’ is closed to new replies.