Easy-digital-downloads: CSV Import not properly setting variable Price Assignments

Created on 29 Apr 2019  路  6Comments  路  Source: easydigitaldownloads/easy-digital-downloads

Bug Report

Expected behavior

For variable pricing, CSV Import should properly set the Price Assignment upon import.

Actual behavior

Price Assignment is properly set via the Download settings:
Screen Shot 2019-04-29 at 10 34 20 AM

BUT, when you purchase there is no download files available:
Screen Shot 2019-04-29 at 10 33 30 AM

If you click Update in the Download settings (without changing any settings), the Price Assignment begins to work.

Database Price Assignment after CSV import:
a:1:{i:1;a:2:{s:4:"file";s:59:"http://edd.test/wp-content/uploads/2019/04/logo_example.png";s:4:"name";s:16:"logo_example.png";}}

Database Price Assignment after Updating Download settings:
a:1:{i:1;a:6:{s:5:"index";s:1:"1";s:13:"attachment_id";s:1:"0";s:14:"thumbnail_size";s:0:"";s:4:"name";s:16:"logo_example.png";s:4:"file";s:59:"http://edd.test/wp-content/uploads/2019/04/logo_example.png";s:9:"condition";s:3:"all";}}

This behavior is the same whether a price assignment is specified or not in the CSV file column. For example:

  • http://edd.test/wp-content/uploads/2019/04/logo_example.png
  • http://edd.test/wp-content/uploads/2019/04/logo_example.png;all
  • http://edd.test/wp-content/uploads/2019/04/logo_example.png;1

Also tested specifying multiple price assignments:

  • http://edd.test/wp-content/uploads/2019/04/logo_example.png;1 | http://edd.test/wp-content/uploads/2019/04/logo_example.png;2

Steps to reproduce the behavior

1) Import a product via CSV with variable price options.
CSV Example: https://www.dropbox.com/s/x8bn1fk1b6c0035/CSV%20Import%20Example.csv?dl=1
2) Test purchase of imported product
3) Purchase conformation should include proper download link. Not No downloadable files found

Information (if a specific version is affected):

PHP Version: 7.0

EDD Version (or branch): master

WordPress Version: 5.1.1

Any other relevant information:
Reported by customer and replicated on my test site.
https://secure.helpscout.net/conversation/816449878/104110?folderId=1847242

type-bug workflow-has-pr workflow-needs-testing

All 6 comments

Customer is requesting this be fixed as soon as possible, as it requires updating each download after an import. When you import a large number of products this adds additional manual labor.

I personally think this is import to fix along with EDD3 (or sooner) to encourage migrations.

@dgoldak This is working properly for me.

Here's my CSV that works properly:

Name, Files, Price
Product 1, http://site.com/file.jpg, 10
Product 2, http://site.com/file1.jpg;1|http://site.com/file2.jpg;2, Price One:5 | Price Two:10
Product 3, bucket/file.jpg, 20

Can you test again and, if it fails, show me the CSV you're using?

Result of the above CSV:
Screen Shot 2019-10-28 at 4 07 28 PM

@pippinsplugins did you test the purchase to confirm the proper download links appear? They appear to work after the import but upon purchase there is no download available.

The CSV i'm using is here: https://www.dropbox.com/s/x8bn1fk1b6c0035/CSV%20Import%20Example.csv?dl=1

@dgoldak Ok I have replicated it with your CSV.

Note: so far it seems the problem only happens when a price assignment is _not_ specified for files. If a price is specified, it works properly.

Tracked it down! PR submitted that's ready for testing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mihaijoldis picture mihaijoldis  路  5Comments

michaelbeil picture michaelbeil  路  5Comments

nabeghe picture nabeghe  路  5Comments

JeroenSormani picture JeroenSormani  路  5Comments

SDavisMedia picture SDavisMedia  路  3Comments