Workaround inventory tab – add a tag on product

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WC Vendors Workaround inventory tab – add a tag on product

This topic contains 3 replies, has 2 voices, and was last updated by WCFM Forum WCFM Forum 1 month, 3 weeks ago.

  • Author
    Posts
  • #85105

    Hello,

    I would like to give the possibility for the vendor to change the status of a product (add a tag “sold” or “reserved” on the product image).
    My website offers only unique products (paintings). I don’t need to have the tab “inventory”
    I find a workaround : use the status of stock in the tab “inventory” to do this. Add code lines in functions.php on my theme.

    In the add product page, could you tell me how I can modify the wording of the tab “inventory” (replaced by “statut objet”) ?
    In tab “inventory”, Could you tell me how I can modify the wording of “State of Stock” (replaced by “statut de votre objet”) ?
    In the dropdown list of “state of stock”, Could you tell me how I can modify the wording of sold out (replaced by “sold”) and “out of stock” (replaced by “reserved”) ?

    Screenshot attached

    Thanks a lot for your help
    Regards
    Aurélien

    Attachments:
    You must be logged in to view attached files.
  • #86460
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    Please add this code to your site –

    function wcfm_custom_1010_translate_text( $translated ) {
    	$translated = str_ireplace( 'inventory', 'Statut Objet', $translated );
    	$translated = str_ireplace( 'Stock status', 'Statut de votre objet', $translated );
    	$translated = str_ireplace( 'out of stock', 'Sold', $translated );
    	$translated = str_ireplace( 'on backorder', 'Reserved', $translated );
    	return $translated;
    }
    add_filter('gettext', 'wcfm_custom_1010_translate_text');
    add_filter('ngettext', 'wcfm_custom_1010_translate_text');

    Add this code to your child theme’s functions.php
    In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

    Thank You

  • #87026

    Hello,

    Thanks a lot it works well !
    I would like to give the possibility for the vendor to put on his product image either “sold” or “Reserved”
    For the moment, only the possibility to put “sold” on the image works (code used below)(by using “soldout”).
    Now, I would like to add the possibility to put “Reserved” on the image. So I thnink I have to use the same type of code and use the third status object but I don’t know his name. There are “In stock”, “soldout or out of stock”, “repunishment”…I don’t know the exact name

    Do you have an idea of the code to make ?

    /* Display “Sold”=”vendu” (in french) on the image */

    add_action( ‘woocommerce_before_shop_loop_item_title’, ‘wpm_display_sold_out_loop_woocommerce’ );// On l’affiche sur la page boutique
    add_action( ‘woocommerce_single_product_summary’, ‘wpm_display_sold_out_loop_woocommerce’ );// On l’affiche sur la page du produit seul

    function wpm_display_sold_out_loop_woocommerce() {
    global $product;
    //Si le produit est en rupture de stock, on affiche :
    if ( !$product->is_in_stock() ) {
    echo ‘<span class=”soldout”>’ . __( ‘Vendu’, ‘woocommerce’ ) . ‘</span>’;
    }
    }

  • #87376
    WCFM Forum
    WCFM Forum
    Keymaster

You must be logged in to reply to this topic.