Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi kkriss,

    Do you mean the SKU?

    In this case, you’l need to add a custom column to your wishlist template; follow this steps:

    1. Copy wishlist-view.php template from wp-content/plugins/yith-woocommerce-wishlist/templates to your theme root
    2. Edit this new file as follow

    a. Increase non-optional column count from 2 to 3 at line 53

    <?php $column_count = 3; ?>

    b. Add a column to thead (i.e. after product name, at line 80)

    <th class="product-sku">
        <span class="nobr"><?php _e( 'Cod.', 'yith-woocommerce-wishlist' ) ?></span>
    </th>

    c. Add column content to tbody (if you want to insert this after product name, you will add td at around line 162)

    <td class="product-sku">
        <?php echo ( ! empty( $product->sku ) ) ? $product->sku : __( 'N/A', 'yith-woocommerce-wishlist' ) ?>
    </td>

    Here there are some screen of the test on my local installation

    https://screencast.com/t/w0w9mBCqOwD
    https://screencast.com/t/WjXKpQ0E

    Let me know if this helps
    Have a nice day ??

    Thread Starter kkriss

    (@kkriss)

    Hi.
    Thanks for your answer but I meant the ordinary Product Code, the one that is shown on the right of the product image in the single product page (front end), not the SKU. And, in case of adding those lines of code, everything else regarding Woocommerce would work nicely or maybe it can cause some issues? Thank you

    Plugin Author YITHEMES

    (@yithemes)

    Hi

    I’m sorry, but I’m not sure what code you want to print. Unfortunately I can’t find the code you’re describing on default woocomerce single product page (maybe your theme add this information in your page)

    Do you mean WP post ID (the one that you can find in your product admin page here)?

    As regards your second question, I’d be very surprised if something in the code I suggested you could manage to break some woocommerce default behaviour ??

    Anyway, before customize something, is always a good practice to make a backup copy of your files, just in case ??

    Thread Starter kkriss

    (@kkriss)

    Plugin Author YITHEMES

    (@yithemes)

    Ciao

    vedo che sei italiano, quindi ti rispondo anche in italiano ??
    Mi spiace, ma anche avendo lo screen che mi hai mandato, non posso capire che tipo di dato viene recuperato dal database (se un postmeta – e in tal caso qual è la sua key – se lo sku, o se qualcosa calcolato dall’id del prodotto)
    Puoi trovare il pezzo di codice che stampa questo codice?

    Fammi sapere!

    Hi,

    I’m sorry, but the screen doesn’t help me to understand what data is print in single product page, and where it is stored in WP database.
    Can you find php code that prints this cod?

    Let me know!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Product code’ is closed to new replies.