Forum Replies Created
-
AuthorPosts
-
waqas-4549ParticipantThis reply has been marked as private.waqas-4549Participant
It did not make any changes to the page 🙁
waqas-4549ParticipantThank you Sir,
I added the following code
do_action( 'wcmp_after_product_excerpt_metabox_panel', $post->ID ); /** * Add Custom Tab in add product page. * @author WC Marketplace * @Version 3.3.0 */ function add_custom_product_data_tabs( $tabs ) { $tabs['advanced'] = array( 'label' => __( 'Brand ID & Part Number', 'your-text-domain' ), 'target' => 'custom_tab_product_data', 'class' => array(), 'priority' => 100, ); return $tabs; } add_filter( 'wcmp_product_data_tabs', 'add_custom_product_data_tabs' ); /** * Add Custom Tab content in add product page. * @author WC Marketplace * @Version 3.3.0 */ function add_custom_product_data_content( $pro_class_obj, $product, $post ) { //prnt_r($product->get_id());die; $hh = get_post_meta($product->get_id() , 'brand_id' ); $hh = get_post_meta($product->get_id() , 'part_number' ); //print_r($hh); ?> <div role="tabpanel" class="tab-pane fade" id="custom_tab_product_data"> <!-- just make sure tabpanel id should replace with your added tab target --> <div class="row-padding"> <div class="form-group"> <label class="control-label col-sm-3 col-md-3">Brand ID</label> <label class="control-label col-sm-3 col-md-3">Part Number</label> <div class="col-md-6 col-sm-9"> <input type="text" name="custom_text_field" class="form-control" value= <?php print_r($hh[0]) ?> /> </div> </div> </div> </div> <?php } add_action( 'wcmp_product_tabs_content', 'add_custom_product_data_content', 10, 3 ); /** * Save Custom Tab content data. * @author WC Marketplace * @Version 3.3.0 */ function save_custom_product_data( $product, $post_data ) { if( isset($post_data['post_ID']) && isset($post_data['custom_text_field'])){ update_post_meta( absint( $post_data['post_ID'] ), 'brand_id', $post_data['custom_text_field']); update_post_meta( absint( $post_data['post_ID'] ), 'part_number', $post_data['custom_text_field']); } } add_action( 'wcmp_process_product_object', 'save_custom_product_data', 10, 2 );
CopyIt does not show the input field for Brand ID now.. as shown in the following screen shot
https://snipboard.io/WZHnab.jpgCan you please help, I do not have any coding skills
waqas-4549ParticipantI have used the following code:
do_action( ‘wcmp_after_product_excerpt_metabox_panel’, $post->ID );
/**
* Add Custom Tab in add product page.
* @author WC Marketplace
* @Version 3.3.0
*/
function add_custom_product_data_tabs( $tabs ) {
$tabs[‘advanced’] = array(
‘label’ => __( ‘Brand ID & Part Number’, ‘your-text-domain’ ),
‘target’ => ‘custom_tab_product_data’,
‘class’ => array(),
‘priority’ => 100,
);
return $tabs;
}
add_filter( ‘wcmp_product_data_tabs’, ‘add_custom_product_data_tabs’ );/**
* Add Custom Tab content in add product page.
* @author WC Marketplace
* @Version 3.3.0
*/
function add_custom_product_data_content( $pro_class_obj, $product, $post ) {
//prnt_r($product->get_id());die;
$hh = get_post_meta($product->get_id() , ‘brand_id’ );
//print_r($hh);
?>
<div role=”tabpanel” class=”tab-pane fade” id=”custom_tab_product_data”> <!– just make sure tabpanel id should replace with your added tab target –>
<div class=”row-padding”>
<div class=”form-group”>
<label class=”control-label col-sm-3 col-md-3″>Brand ID</label>
<div class=”col-md-6 col-sm-9″>
<input type=”text” name=”custom_text_field” class=”form-control” value= <?php print_r($hh[0]) ?> />
</div>
</div>
</div>
</div>
<?php
}
add_action( ‘wcmp_product_tabs_content’, ‘add_custom_product_data_content’, 10, 3 );/**
* Save Custom Tab content data.
* @author WC Marketplace
* @Version 3.3.0
*/
function save_custom_product_data( $product, $post_data ) {
if( isset($post_data[‘post_ID’]) && isset($post_data[‘custom_text_field’])){
update_post_meta( absint( $post_data[‘post_ID’] ), ‘brand_id’, $post_data[‘custom_text_field’]);
}
}
add_action( ‘wcmp_process_product_object’, ‘save_custom_product_data’, 10, 2 );waqas-4549ParticipantThank you for all the help,
I have managed to add one field as you can see from the following screen shot:
https://snipboard.io/WPqkvO.jpgIt also saves to the exact meta data that I want it to.
I would like to add another input box in this same area labelled “Part Number” and it should save in “part_number”
Can you please help with that?waqas-4549ParticipantMessage from GeekyCoder Abhirup (Moderator)
“If you want to add fields on a particular position then kindly share us a screenshot of the position, so we will give you hook to add fields on this position.”I would like place the two input fields on that area.. I am replying to the comment from the Moderator.
waqas-4549ParticipantDear Team,
Do I place that code in the functions file?
Also I would like to place it on following area:
https://pasteboard.co/KebpqJ5.pngwaqas-4549ParticipantThank you for the reply,
All the coding regarding the saving/display had already been conducted. I just require a code to display the two input field while adding the product.
The two field are have the raw name as “Meta: part_number” & “Meta: brand_id” .
If you can display these in while adding a product on Vendor Dashboard, then the rest of the things will be done automatically since our development team has already programmed it in the back end.waqas-4549ParticipantDear Team,
The following screen share shows that the vendor shop page does not show a filter while the categories pages show the product filter.
https://www.loom.com/share/f034adb8c7c6448b95a66330c000b3ddwaqas-4549ParticipantThank you guys, this issue is resolved.
You may mark this thread closed.July 28, 2021 at 10:23 PM in reply to: Add to Carts products and “Products you may like” showing in Vendor Dashboard #125609waqas-4549ParticipantThank you,
You may mark this thread closed 🙂July 28, 2021 at 7:23 PM in reply to: Add to Carts products and “Products you may like” showing in Vendor Dashboard #125593waqas-4549ParticipantThank you so much,
May I know the directory of the file this code has been added to?July 24, 2021 at 6:37 PM in reply to: Add to Carts products and “Products you may like” showing in Vendor Dashboard #125368waqas-4549ParticipantHi,
Can you keep scrolling down till the end, you will see it them. I noticed in the video you shared that you didn’t completely scroll down.July 23, 2021 at 7:00 PM in reply to: Add to Carts products and “Products you may like” showing in Vendor Dashboard #125318waqas-4549ParticipantThis reply has been marked as private.July 23, 2021 at 3:05 PM in reply to: Add to Carts products and “Products you may like” showing in Vendor Dashboard #125303waqas-4549ParticipantThis reply has been marked as private. -
AuthorPosts