bigcommerce-api-php icon indicating copy to clipboard operation
bigcommerce-api-php copied to clipboard

Rules Conditions

Open msznaper opened this issue 7 years ago • 1 comments

Expected behavior

It should return the value of the property condition from the Object Rules.

Actual behavior

Is trying to get property of non-object at /var/www/rebillia/vendor/bigcommerce/api/src/Bigcommerce/Api/Resources/Rule.php:25)

Steps to reproduce behavior

$product_rules = $bc_product->rules(); foreach ($product_rules as $pr) { if ($pr->conditions){ foreach ($pr->conditions as $condition) { $conditions[] = array('product_option_id' => $condition->product_option_id, 'option_value_id' => $condition->option_value_id, 'sku_id' => $condition->sku_id); } }else{ $conditions = null; } } }

SOLUTION

I know the problem occurs because instead of get the property of the Object is trying to execute the public function on the file "/var/www/rebillia/vendor/bigcommerce/api/src/Bigcommerce/Api/Resources/Rule.php:25)". If I comment or change the name of the public function its work properly.

msznaper avatar Jan 11 '19 15:01 msznaper

?

msznaper avatar Jan 22 '19 19:01 msznaper