DownloadPermissionsAdjuster::adjust_download_permissions( int $product_id )

Create additional download permissions for variations if necessary.


Description Description

When a simple downloadable product is converted to a variable product, existing download permissions are still present in the database but they don’t apply anymore. This method creates additional download permissions for the variations based on the old existing ones for the main product.

The procedure is as follows. For each existing download permission for the parent product, check if there’s any variation offering the same file for download (the file URL, not name, is checked). If that is found, check if an equivalent permission exists (equivalent means for the same file and with the same order id and customer id). If no equivalent permission exists, create it.


Parameters Parameters

$product_id

(Required) The id of the product to check permissions for.


Top ↑

Source Source

File: src/Internal/DownloadPermissionsAdjuster.php


			


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.