Answer the question
In order to leave comments, you need to log in
Editing options on opencart order confirmation page?
Good afternoon. Trying to do edit options on opencart 2.3 confirmation page.
Made the output of options by adding to the controller
$options_my = array();
foreach ($this->model_catalog_product->getProductOptions($product['product_id']) as $option) {
$product_option_value_data = array();
foreach ($option['product_option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency']);
} else {
$price = false;
}
$product_option_value_data[] = array(
'product_option_value_id' => $option_value['product_option_value_id'],
'option_value_id' => $option_value['option_value_id'],
'name' => $option_value['name'],
'image' => $this->model_tool_image->resize($option_value['image'], 50, 50),
'price' => $price,
'price_prefix' => $option_value['price_prefix']
);
}
}
$options_my[] = array(
'product_option_id' => $option['product_option_id'],
'product_option_value' => $product_option_value_data,
'option_id' => $option['option_id'],
'name' => $option['name'],
'type' => $option['type'],
'value' => $option['value'],
'required' => $option['required']
);
}
'options_my' => $options_my,
public function edit() {
Answer the question
In order to leave comments, you need to log in
All right.
Editing products in the controller/checkout/cart.php -> edit() method
Plus you will need to edit system/library/cart/cart.php -> update(
) options
2. From the controller, pass this to the basket library
3. It remains to add the request so that, in addition to the number, it also updates information about the options.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question