ben al tijdje aan het stoeien met een array waar ik een variable uit wil halen maar om een of anderre reden maak ik een domme fout geloof ik..
ik heb dus uit variations de producten nodig. en dan het liefst de eancode.
Array
(
[product_id] => 314955
[sku] => 0401103078
[name] => Bomber cardigan Bethany
[set] => 41
[type] => configurable
)
Array
(
[product_id] => 314955
[sku] => 0401103078
[set] => 41
[type] => configurable
[shoot_photo] =>
[customer_group_id] => 5
[customer_group_price] => Array
(
[price_id] => 107292129
[website_id] => 12
[all_groups] => 0
[cust_group] => 5
[price] => 38.4000
[website_price] => 38.4000
[customer_group_code] => PL0
[special_price] =>
)
[customer_group_price_rrp] => Array
(
[price_id] => 107292130
[website_id] => 12
[all_groups] => 0
[cust_group] => 12
[price] => 99.95
[website_price] => 99.95
[customer_group_code] => PL0_RRP
)
[model] => 0401103078
[name] => Bomber cardigan Bethany
[season_usage_label] => Winter
[image] => http://cp.hv-polo.com/media/catalog/product/0/4/0401103078-stogre.jpg
[variations] => Array
(
[0401103078-5001-2XL] => Array
(
[color] => Navy
[shirt_size] => 2XL
[is_active] => 1
[is_saleable] => 1
[name] => Bomber cardigan Bethany Navy XXL
[eancode] => 8718563881661
[stock] => 24
[image] => http://cp.hv-polo.com/media/catalog/product/b/o/bomber_cardigan_bethany_navy_l_1.jpg
)
[0401103078-5001-3XL] => Array
(
[color] => Navy
[shirt_size] => 3XL
[is_active] => 1
[is_saleable] => 1
[name] => Bomber cardigan Bethany Navy XXXL
[eancode] => 8718563881678
[stock] => 6
[image] => http://cp.hv-polo.com/media/catalog/product/b/o/bomber_cardigan_bethany_navy_l_1.jpg
)
)
)
dit is mijn stukje script
public function updateProduct($data) {
$option = $this->db->query("SELECT * FROM " . DB_PREFIX . "power_options_data WHERE pwr_sku = '" . $this->db->escape($data['sku']) . "' LIMIT 1");
//print $data;
print "<br />data sku ".$data['sku']."<br />";
print "data sku ".$data['eancode']."<br />";
print $data['variations']['eancode'];
if ($option->num_rows) {
$pwr_id = $option->row['pwr_id'];
$this->db->query("UPDATE " . DB_PREFIX . "power_options_data SET pwr_quantity = '" . (int)$data['stock'] . "' WHERE eancode = '" . (int)$data['eancode'] . "'");
//print_r(" . (int)$data['stock_qty'] . ")
}
}