Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Vendors › Workaround inventory tab – add a tag on product
- This topic has 3 replies, 2 voices, and was last updated 5 years, 1 month ago by WCFM Forum.
- AuthorPosts
- October 4, 2019 at 7:37 pm #85105aurelien_boutillierParticipant
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élienAttachments:
You must be logged in to view attached files. - October 12, 2019 at 11:57 am #86460WCFM ForumMember
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
- October 16, 2019 at 3:35 am #87026aurelien_boutillierParticipant
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 nameDo 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 seulfunction 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>’;
}
} - October 17, 2019 at 5:06 pm #87376WCFM ForumMember
Well, for do such thing use this plugin – https://woocommerce.com/products/woocommerce-advanced-product-labels/
- AuthorPosts
- The topic ‘Workaround inventory tab – add a tag on product’ is closed to new replies.