CHANGE_product_details:ss
This commit is contained in:
parent
7a8d4041c9
commit
9f01abb8fe
@ -264,9 +264,17 @@ echo $html;die;
|
||||
$data['make_model'] = $make_name['make'].' ' . $model_name['model_name'];
|
||||
// Encode the modelId before searching
|
||||
$encodedModelId = json_encode([$makeId]);
|
||||
// array_push($makeId, 0);
|
||||
// array_push($modelId, 0);
|
||||
$product = $productModel->where('JSON_CONTAINS(make_id, \'' . $encodedModelId . '\')', null, false)->where('qty_stock >',0)->findAll();
|
||||
$encoded_make_id = json_encode(['0']);
|
||||
$product1 = $productModel
|
||||
->where('JSON_CONTAINS(make_id, \'' . $encodedModelId . '\')', null, false)
|
||||
->where('qty_stock >',0)
|
||||
->findAll();
|
||||
$product2 = $productModel
|
||||
->orWhere('JSON_CONTAINS(make_id, \'' . $encoded_make_id . '\')', null, false)
|
||||
->where('qty_stock >',0)
|
||||
->findAll();
|
||||
$product = array_merge($product1, $product2);
|
||||
$data['product']=$product;
|
||||
$data['product']=$product;
|
||||
|
||||
// echo json_encode($product);die;
|
||||
|
||||
@ -778,6 +778,7 @@ $(window).on('load', function() {
|
||||
var product = products.find(function(item) {
|
||||
return item.product_id == productId;
|
||||
});
|
||||
console.log(product,'product');
|
||||
// Access unit price from product and set it as rate
|
||||
var unitPrice = parseFloat(product.unit_price); // Convert to float if necessary
|
||||
$(this).closest('tr').find('.rate-d-only').val(unitPrice);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user