Skip to content

Commit

Permalink
dodatkowe sprawdzanie czy edd_options istnieje i jest array
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaszKurpanik committed Jun 3, 2024
1 parent 3c93a25 commit cc4adf7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/cart/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ function edd_process_cart_endpoints() {
*/
function edd_process_add_to_cart( $data ) {
$download_id = absint( $data['download_id'] );
$options = isset( $data['edd_options'] ) ? $data['edd_options'] : array();

if ( ! empty( $data['edd_download_quantity'] ) ) {
$options = (isset($data['edd_options']) && is_array($data['edd_options'])) ? $data['edd_options'] : array();

if ( ! empty( $data['edd_download_quantity'] ) ) {
$options['quantity'] = absint( $data['edd_download_quantity'] );
}

Expand Down

0 comments on commit cc4adf7

Please sign in to comment.