내가 원하는 것은 선택한 구성에 따라 재고 상태를 변경하는 것입니다.opencart의 제품 옵션 재고 업데이트
제품 옵션은 "재고 없음"수량 0 쇼와 스톡 옵션이 있거나 수량 50 쇼 "사용 가능한"이고 경우 때입니다 수량 -1 쇼 "사전 순서"
if ($product_option_value['quantity'] <= -1) {
$this->data['stock'] = $product_info['stock_status'];
} elseif ($this->config->get('config_stock_display')) {
$this->data['stock'] = $product_info['quantity'];
} else {
$this->data['stock'] = $this->language->get('text_preorder');
if ($product_option_value['quantity'] <= 0) {
$this->data['stock'] = $product_info['stock_status'];
} elseif ($this->config->get('config_stock_display')) {
$this->data['stock'] = $product_info['quantity'];
} else {
$this->data['stock'] = $this->language->get('text_outstock');
}
if ($product_option_value['quantity'] => 50) {
$this->data['stock'] = $product_info['stock_status'];
} elseif ($this->config->get('config_stock_display')) {
$this->data['stock'] = $product_info['quantity'];
} else {
$this->data['stock'] = $this->language->get('text_instock');
}
그래서 해결해야 할 문제가 무엇인가요? –
작동하지 않습니다 – user3063382
'$ this-> data [ 'stock'] = $ this-> language-> get ('text_instock'); -이 코드 조각'else'는 항상 렌더링됩니다 . –