- Messages
- 21
- Reactions
- 11
working very well to replace the codeThis is not a NULL issue. For some reason the devs made the quotes work only if the product has variants
quote_requests.php view (lines 78-116):
PHP:<?php if (!empty($quoteRequest->variant_hash)): $variant = getVariantByHash($quoteRequest->variant_hash); if (empty($variant) || $variant->is_active != 1): ?> <!-- Shows "Expired" badge --> <?php else: ?> <!-- Shows Accept/Reject buttons for pending_quote --> <!-- Shows Add to Cart button for pending_payment --> <?php endif; endif; ?>
You can try fixing it by adding this code to line 116 (replace endif; ?>):
PHP:else: ?> <!-- Show buttons for products without variants --> <?php if ($quoteRequest->status == 'pending_quote'): ?> <form action="<?= base_url('bidding/accept-quote-post'); ?>" method="post"> <?= csrf_field(); ?> <input type="hidden" name="id" class="form-control" value="<?= $quoteRequest->id; ?>"> <input type="hidden" name="back_url" class="form-control" value="<?= getCurrentUrl(); ?>"> <button type="submit" class="btn btn-sm btn-success color-white m-b-5"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="#ffffff" width="14" height="14"> <path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/> </svg> <?= trans("accept_quote"); ?> </button> </form> <form action="<?= base_url('bidding/reject-quote-post'); ?>" method="post"> <?= csrf_field(); ?> <input type="hidden" name="id" class="form-control" value="<?= $quoteRequest->id; ?>"> <input type="hidden" name="back_url" class="form-control" value="<?= getCurrentUrl(); ?>"> <button type="submit" class="btn btn-sm btn-danger color-white m-b-5"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#ffffff" width="14" height="14"> <path d="M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"/> </svg> <?= trans("reject_quote"); ?> </button> </form> <?php elseif ($quoteRequest->status == 'pending_payment'): ?> <form action="<?= base_url('add-to-cart-quote'); ?>" method="post"> <?= csrf_field(); ?> <input type="hidden" name="id" class="form-control" value="<?= $quoteRequest->id; ?>"> <button type="submit" class="btn btn-sm btn-info color-white m-b-5"><i class="icon-cart-solid"></i> <?= trans("add_to_cart"); ?></button> </form> <?php endif; ?> <?php endif; ?>
Reacted by: