• Resolved ruseau

    (@ruseau)


    Hi,

    Can you add for the next version or do you have a additional code for extract the Store Name or ID when I do a Product Export ?

    Best Regards

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Well, if you export products with “Export custom meta?” option then it’s generated CSV has this column “Meta: _wcfm_product_author” – https://ibb.co/py29pkQ

    It actually holds product’s author/vendor user id.

    Is this will helpful for you or you want to have “store name” column separately?

    Thank You

    Thread Starter ruseau

    (@ruseau)

    Hi,

    thanks for this first information,

    Yes it’s can be usefull to have store name and column separately

    It’s can be possible to import or export also the type of margin $ or % and the number ?
    it’s can be helpful to have it too

    Regards,

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Add this code to your site to export store id and name column separately –

    function add_export_column( $columns ) {
    	$columns['store_id'] = 'Store ID';
    	$columns['store_name'] = 'Store Name';
    	return $columns;
    }
    add_filter( 'woocommerce_product_export_column_names', 'add_export_column' );
    add_filter( 'woocommerce_product_export_product_default_columns', 'add_export_column' );
    function add_export_data_store_id( $value, $product ) {
    	$value = wcfm_get_vendor_id_by_post( $product->get_id() );
    	return $value;
    }
    add_filter( 'woocommerce_product_export_product_column_store_id', 'add_export_data_store_id', 10, 2 );
    function add_export_data_store_name( $value, $product ) {
    	$value = wcfm_get_vendor_store_name_by_post( $product->get_id() );
    	return $value;
    }
    add_filter( 'woocommerce_product_export_product_column_store_name', 'add_export_data_store_name', 10, 2 );

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

    Thank You

    Thread Starter ruseau

    (@ruseau)

    Hi,

    It’s work well !

    Do you have the same code for the margin type and the price or percentage (of marging) ?

    Regards

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Do you have the same code for the margin type and the price or percentage (of marging) ?

    – Sorry, what do you mean by margin? Commission?

    Thank You

    Thread Starter ruseau

    (@ruseau)

    Hi,

    yes commission,

    Sorry my website is in Spanish i don’t use the right word.

    there is 3 types of commission in WCFM : % / $ / %+$

    i would like to have the possibility to manage the Type of commission that i want (% / $ / %+$) and define the % or Price with one CSV

    do you think it’s can be possible ?

    Regards

    Plugin Author WC Lovers

    (@wclovers)

    HI,

    Sorry, commission import not supported right now!

    Between, do you want to set commission for each products individual?

    Thank You

    Thread Starter ruseau

    (@ruseau)

    Hi,

    Yes for the same store we can have different % of commission by category of product for exemple so it’s easier to do it with a CSV

    Regards,

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    It’s not impossible.

    But WooCommerce default importer does not support this, so you have create this custom.
    https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter#adding-custom-import-columns-developers

    Most importantly, commission data stored as serialized format, so you have to generate data in that format.

    Thank You

    Thread Starter ruseau

    (@ruseau)

    Hi,

    Can you help me again with this ?

    i’ve starting to write the code for generate the Export but i’m not sure that it will work

    function add_export_column( $columns ) {
    	$columns['commission_rule'] = 'Commission Rule';
    	$columns['product_commission'] = 'Product Commission';
    	return $columns;
    }
    add_filter( 'woocommerce_product_export_column_names', 'add_export_column' );
    add_filter( 'woocommerce_product_export_product_default_columns', 'add_export_column' );
    function add_export_data_commission_rule( $value, $product ) {
    	$value = wcfmmp_get_product_commission_rule( $product->get_id() );
    	return $value;
    }
    add_filter( 'woocommerce_product_export_product_column_commission_rule', 'add_export_data_commission_rule', 10, 2 );
    function add_export_data_product_commission( $value, $product ) {
    	$value = wcfmmp_get_commission_cost( $product->get_id() );
    	return $value;
    }
    add_filter( 'woocommerce_product_export_product_column_product_commission', 'add_export_data_product_commission', 10, 2 );

    i’ve find the way to show com in the product creation page, and i’m 99% sure that i can use this code for find the inforation :
    but i need you’re help for finalize it…

    /* show com */
    add_action( 'after_wcfm_products_manage_pricing_fields', function( $product_id ) {
    global $WCFM, $WCFMmp;
    echo '<p class="description" style="color:#f86c6b; font-size:15px;">(Solo para producto simple) Su ganancia sobre la venta: ';
    if( $product_id ) {
    $product = wc_get_product( $product_id );
    $regular_price = $product->get_regular_price();
    $sale_price = $product->get_sale_price();
    $commission_rule = $WCFMmp->wcfmmp_product->wcfmmp_get_product_commission_rule( $product_id );
    if( $sale_price ) {
    $item_commission = $WCFMmp->wcfmmp_commission->wcfmmp_generate_commission_cost( $sale_price, $commission_rule );
    } else {
    $item_commission = $WCFMmp->wcfmmp_commission->wcfmmp_generate_commission_cost( $regular_price, $commission_rule );
    }
    echo wc_price( $item_commission );
    } else {
    echo "Publique el producto para ver este informacion";
    }
    echo "</p>";
    }, 9 );'

    Regards

    • This reply was modified 5 years, 9 months ago by ruseau.
    Plugin Author WC Lovers

    (@wclovers)

    i’ve find the way to show com in the product creation page, and i’m 99% sure that i can use this code for find the inforation :

    – Do you want to show product’s estimated commission under “Add product” page?

    If so, then code is fine.

    But export code is not right as there is no such methods “wcfmmp_get_product_commission_rule” and “wcfmmp_get_commission_cost”

    Thank You

    Thread Starter ruseau

    (@ruseau)

    Hi,

    yes the first code is working, but i was trying to find a solution for use part of this code for generate the export and if it’s possible the import also.

    i’m paying for the support and i’m also ready to paid an extra for having the solution, it’s very important for me to have it

    Best Regards

    Thread Starter ruseau

    (@ruseau)

    Sorry for my mistake, i don’t paid for the support but for plugins :

    WooCommerce Frontend Manager – Ultimate – Upto 2 Sites for 1 Year – $49 × 1
    WooCommerce Frontend Manager – Product HUB – Upto 2 Sites for 1 year – $11 × 1

    there is a way to have the solution from you ?

    Best regards

    Plugin Author WC Lovers

    (@wclovers)

    What you want to export?

    Product related commission data?

    Are you using product specific commissions?

    Thread Starter ruseau

    (@ruseau)

    Hi,

    yes i would like to have the posibility to export in the first time my products commissions

    (i don’t know what is possible : “commission total” or the detail of “rule” “valor” “com”)

    that the problem i’m using on the product : fixed / porcentage

    and also the global rule or the store rule

    Regards

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Export CSV Store’ is closed to new replies.