Home Forums Theme Support Dokan How To Add Field to Stock Status Drop Down Options In Vendor Dashboard

This topic is: resolved

This topic contains 4 replies, has 3 voices, and was last updated by  Nizam Uddin 5 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21728

    Gary
    Member
    Post count: 39

    Hello there, I am looking to add an additional option to the ‘Stock Status' field when vendors are editing a product. Currently under Inventory -> Stock Status there are the two options ‘In Stock/Out Of Stock' I would like to add a third option which will have the same functions as Out Of Stock but named ‘Available In Store Only' So that customers will not be able to purchase the product online but will know that they can collect from the shop in person.

    I imagine I can just create a copy of the ‘out of stock' functions and rename it to ‘Available In Store'. Im not sure what code I would need to duplicate so that I can do this. Could anyone direct me to the files and lines which I would need to copy and alter to do this? It would be really great!

    Kind Regards

    Gary

    #21808

    Gary
    Member
    Post count: 39

    Hello I just wanted to alter this question. Ok so not all my vendors will want to physically online until they are familiar to the site, but I dont want to label products as out of stock. Instead if a product is out of stock I want to replace the text with ‘Contact Store For Availability' I have managed to do this for the frontend store for visitors to see by adding an availability code to functions.php

    //change woocommerce ‘out of stock' product status to any text status you want
    add_filter(‘woocommerce_get_availability', ‘custom_get_availability');

    function custom_get_availability($availability)
    {
    $availability[‘availability'] = str_ireplace(‘Out of stock', ‘Contact Store For Availability', $availability[‘availability']);
    //$availability[‘availability'] = str_ireplace(‘Out of stock', ‘Sold Out!', $availability[‘availability']);
    //$availability[‘availability'] = str_ireplace(‘Out of stock', ‘Call for Price', $availability[‘availability']);

    return $availability;
    }

    on the theme files, but on the dokan vendor dashboard the text is still ‘Out Of Stock'. How can I change this text for vendors to see as ‘Contact Store For Availability' instead.

    One last question, In the vendors stores, only 4 products are shown at one time with the paginator, where can I alter the number of products shown on the Vendors Store to 12?

    Thank you very much, I really appreciate your theme and help so far.

    Kind Regards

    Gary

    #21842

    Sk
    Moderator
    Post count: 371

    Hello Gary,

    woocommerce dosen't have any hook to change the text or add a new option for vendors or admin. They have only option to change the text for customer (you have done that). Dokan bring the options to add or edit products from admin panel. So It's not possible to change the text for vendors.

    Thank you.

    #21875

    Gary
    Member
    Post count: 39

    Ah ok, thanks for letting me know, at least the visitors can see the change in text. As for the vendor shop though, is there a code I can add to functions.php or some way to expand the number of products shown from 4 to 12 in their store? I have managed to do it for the marketplace but I cant seem to figure out how to show more products per page in each of their store.

    Kind Regards

    #21903

    Nizam Uddin
    Keymaster
    Post count: 670

    Hello Gary
    To show more products per page in each of their store, please navigate to WP-Admin-->Settings-->Reading then find Blog pages show at most and increase the number. Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘How To Add Field to Stock Status Drop Down Options In Vendor Dashboard’ is closed to new replies.