• Resolved Shadowelf

    (@shadowelf)


    Hello,
    I tried to export and import products from one wooCommerce-shop to a new instance using this plugin. After passing the file-upload and clicking submit at the “mapping”-page. Nothing happens. This means the screen only shows the loading-animation. In my firefox-developer-tools I can find the error-Message:”SyntaxError: unterminated string literal”

    Clicking on the linked pointer gets me to the following lines:

    function import_rows( start_pos, end_pos ) {

    var data = {
    action: ‘woocommerce_csv_import_request’,
    file: ‘/[private path cutted out by me]/demoshop/wp-content/uploads/2017/04/Woocomm2.csv-4.txt’,
    mapping: ‘{[cutted out by my for better reading, I can provide if needed}’,
    eval_field: ‘<br />
    <b>Warning</b>: json_encode() expects exactly 1 parameter, 2 given in <b>/[private path cutted out by me]/demoshop/wp-content/plugins/product-import-export-for-woo/includes/importer/class-wf-prodimpexpcsv-product-import.php</b> on line <b>148</b><br />’,

    When I look in the fiel class-wf-prodimpexpcsv-product-import.php I can see the line:
    eval_field: ‘<?php echo stripslashes(json_encode(($_POST[‘eval_field’]),JSON_HEX_APOS)) ?>’,

    Maybe the problem is because on the “mapping”-page there is an array of eval_field.
    During the process I left the “mapping”-page filled out as it was with no content in the eval_fields.

    I hope you understand my problem.
    Can you please help me or give me any hint?
    Regards,
    Philipp

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Philipp (@@shadowelf):

    Can you share the page screenshot of WooCommerce System Status( Under menu WooCommerce -> System Status). So we can check this with same configuration and find out if any issues.

    We haven’t had any other reports of this, and I’m not seeing it myself.
    Your PHP version might be too low, If your version of PHP is less than 5.3, just use json_encode(($_POST[‘eval_field’]),JSON_HEX_APOS) without second parameter like json_encode($_POST[‘eval_field’])

    Thread Starter Shadowelf

    (@shadowelf)

    Hello,

    thank you for your help. Indeed the PHP-Version is less than 5.3 but I’m not allowed to change the version on this system. BUT you hint with using the method in another way helped.
    Thank you!

    Regards,
    Philipp

    Hi Philipp(@shadowelf):

    Glad that it helped. You can leave us a review here if the plugin/support was helpful

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘No Import eval_field causes “unterminated string literal”-SyntaxError’ is closed to new replies.