0

如何添加两个产品。例如,我添加了 product1 。我想将该 product1 拆分为带有媒体的产品和不带媒体的 product1。数量相同。

在产品列表中,它必须显示在两个不同的条目中。下面是添加产品的代码。现在它只需要一个..

$this->data[$key] = array(
    'key'             => $key,
    'product_id'      => $product_query->row['product_id'],
    'name'            => $product_query->row['name'],
    'model'           => $product_query->row['model'],
    'shipping'        => $product_query->row['shipping'],
    'image'           => $product_query->row['image'],
    'option'          => $option_data,
    'download'        => $download_data,
    'quantity'        => $quantity,
    'minimum'         => $product_query->row['minimum'],
    'subtract'        => $product_query->row['subtract'],
    'stock'           => $stock,
    'price'           => ($price + $option_price),
    'total'           => ($price + $option_price) * $quantity,
    'reward'          => $reward * $quantity,
    'points'          => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $quantity : 0),
    'tax_class_id'    => $product_query->row['tax_class_id'],
    'weight'          => ($product_query->row['weight'] + $option_weight) * $quantity,
    'weight_class_id' => $product_query->row['weight_class_id'],
    'length'          => $product_query->row['length'],
    'width'           => $product_query->row['width'],
    'height'          => $product_query->row['height'],
    'length_class_id' => $product_query->row['length_class_id'],
    'recurring'       => $recurring
);
4

0 回答 0