Skip to content

Commit

Permalink
Merge pull request #27 from pagantis/fix_phpNotice
Browse files Browse the repository at this point in the history
check if field exists in array
  • Loading branch information
pgarcess authored Sep 30, 2019
2 parents 582e6ee + 5437f05 commit 6afe6eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions WC_Pagantis.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pagantis
* Plugin URI: http://www.pagantis.com/
* Description: Financiar con Pagantis
* Version: 8.2.3
* Version: 8.2.4
* Author: Pagantis
*/

Expand Down Expand Up @@ -608,7 +608,8 @@ private function preparePriceSelector($css_price_selector)
private function isPromoted($product_id)
{
$metaProduct = get_post_meta($product_id);
return ($metaProduct['custom_product_pagantis_promoted']['0'] === 'yes') ? 'true' : 'false';
return (array_key_exists('custom_product_pagantis_promoted', $metaProduct) &&
$metaProduct['custom_product_pagantis_promoted']['0'] === 'yes') ? 'true' : 'false';
}
}

Expand Down
3 changes: 2 additions & 1 deletion controllers/paymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,8 @@ private function checkDbLogTable()
private function isPromoted($product_id)
{
$metaProduct = get_post_meta($product_id);
return ($metaProduct['custom_product_pagantis_promoted']['0'] === 'yes') ? 'true' : 'false';
return (array_key_exists('custom_product_pagantis_promoted', $metaProduct) &&
$metaProduct['custom_product_pagantis_promoted']['0'] === 'yes') ? 'true' : 'false';
}

/**
Expand Down

0 comments on commit 6afe6eb

Please sign in to comment.