Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3234352
How to use "Import/export selected products"
Closed

Comments

  •  3
    Rudolf started the conversation

    Hi, Import/export selected products has been added in Version 5.1.0.

    Is there any documentation about how to use this?

    Can you change this serialized data manually?

    Thanks

  •  767
    Janilyn replied

    Hi Rudolf,

    Thanks for contacting us here.

    We're sorry for the delayed response these days. We have spent some days to fix the server and network issues of our system. Today it is working properly again so I am back for support. 

    For your information, the Import/Export feature is added for the purpose of making it convenient for customers to add the exact same list of products as Bought Together to different other products quickly. So users just need to create the list once, then click on the Export button to copy all the data, go to the next product, click on Import/Export again and paste all the data there >> press Update.

    If you would like to change the data, we recommend that you do it by adding/removing the items listed above that and modify the price/discounts before clicking on the Export button and start copying those data. It should be the most convenient and proper way to handle it. 

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  2
    Aline Duchesne replied

    To confirm, for every product, the best way is to export one then import for each product? Is there a way to use WP All Import to set all products at once? I have over 3,000 products that come in sets of 4 so a manual for each product would be very time consuming.

  •  767
    Janilyn replied

    Hi Aline,

    Thanks for contacting WPClever Support Forum. We're not available at the weekends so today (Monday) I am able to help you with your question.

    I have assigned one of our developers to help you with that. He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,222
    Dustin replied

    Hi Aline,

    To add the same frequently-bought-together products for all of your products, I think it's better to use the below trick. It won't increase your database since it won't add data for each product.

    1.1 Install and activate a free plugin from us https://wordpress.org/plugins/wpc-smart-linked-products/

    1.2 Choose Upsells (or Cross-sells) as default products here https://www.screencast.com/t/2FtgEIeZ

    1.3 Config upsells (or cross-sells) products for all of your products here https://www.screencast.com/t/JpX1b5N9y

    All done! You don't need to choose frequently-bought-together products on each product setting page. You also can easily change these products.

    Best regards,
    Dustin

  •  2
    Aline Duchesne replied

    Before I dive into giving this option a try Justin,  is there a way to apply settings such as applying a discount if all products in the cross-sell group are selected? 

  •  1,222
    Dustin replied

    I can help you write a snippet to set the same discount or other settings for all of your products.

    For example, the below snippet will apply a discount of 30% for all frequently-bought-together products:

    add_filter( 'woobt_show_items', function ( $items ) {
        $new_items = [];
        if ( is_array( $items ) && ! empty( $items ) ) {
            foreach ( $items as $item ) {
                if ( is_array( $item ) ) {
                    $item['price'] = '70%';
                    $new_items[]   = $item;
                } else {
                    $item_arr    = array(
                        'id'    => absint( $item ),
                        'price' => '70%',
                        'qty'   => 1
                    );
                    $new_items[] = $item_arr;
                }
            }
        }
        return $new_items;
    }, 99 );

    Best regards,
    Dustin

  •  2
    Aline Duchesne replied

    You are good Dustin and I don't mean to give you a hard time but...some of my products are priced at $20.00 and some at $400.00 so you can see that a standard across-the-board percentage discount would not work. 30% On 4 products at $20.00 is different than 4 products at $400.00. The ability to provide different discounts to each set of 4 is important.

  •  1,222
    Dustin replied

    Yes, we also can do thatsmile.png

    In this case, you can use the snippet only, don't need to use https://wordpress.org/plugins/wpc-smart-linked-products/

    add_filter( 'woobt_show_items', function ( $items ) {
        return array(
            array(
                'id'    => 96,
                'price' => '70%',
                'qty'   => 1
            ),
            array(
                'id'    => 97,
                'price' => '40%',
                'qty'   => 2
            ),
            array(
                'id'    => 98,
                'price' => '80%',
                'qty'   => 1
            ),
            array(
                'id'    => 99,
                'price' => '15',
                'qty'   => 3
            ),
        );
    }, 99 );

    96, 97, 98, 99 are product IDs, and below are the prices and quantities of these products.

    If you want to discount 30%, please leave the value for 'price' as '70%'.

    Best regards,
    Dustin

  •  2
    Aline Duchesne replied

    lol...You are definitely giving it your best shot Dustin and I do appreciate it. But...this code snippet is for those 4 id's. What do I do about the other 2996 products? I cannot issue a code snippet for each set of 4 product ID's.

  •  1,222
    Dustin replied

    This snippet sets 4 frequently-bought-together products (ID 96, 97, 98, 99) for all of your 3000 products. I think it's your requirement, right?

    I have over 3,000 products that come in sets of 4 so a manual for each product would be very time consuming.

    Best regards,
    Dustin

  •  2
    Aline Duchesne replied

    No, each set of 4 products are different id's. so 3,000 products divided into 4 would mean 750 different sets of 4 with 3,000 product id's.

  •  1,222
    Dustin replied

    All frequently-bought-together products will be exported together to the main products. Just ensure that you also export all metadata of a product. After importing, you don't need to choose these products again.

    It doesn't work for you when exporting/importing? I still don't clear about your idea "Is there a way to use WP All Import to set all products at once?"smile.png

    Best regards,
    Dustin

  •  2
    Aline Duchesne replied

    Thanks for your assistance Dustin. We can close this ticket. I have been working with WP All Import and another plugin and WP All Import just emailed me requesting a bit more info and access to my site so they can fix the issue.

    The efforts you have put in and have gone the extra mile are really appreciated. Great customer service.

  •  1,222
    Dustin replied

    You're welcome!

    Feel free to submit a new ticket if you have any questions when using our plugin.

    Best regards,
    Dustin

  •  3
    Rudolf replied

    Hi Dustin,

    your first code snippet in this thread looks very promising to me. Could you please explain what the IF ... ELSE does?

    Thanks :)

  •  1,222
    Dustin replied
    add_filter( 'woobt_show_items', function ( $items ) {
        $new_items = [];
        if ( is_array( $items ) && ! empty( $items ) ) {
            foreach ( $items as $item ) {
                if ( is_array( $item ) ) {
                    $item['price'] = '70%';
                    $new_items[]   = $item;
                } else {
                    $item_arr    = array(
                        'id'    => absint( $item ),
                        'price' => '70%',
                        'qty'   => 1
                    );
                    $new_items[] = $item_arr;
                }
            }
        }
        return $new_items;
    }, 99 );

    The IF...ELSE statement just to ensure this snippet will work with all versions of our plugin. In the near versions, we had changes in the data structure.

    Best regards,
    Dustin