AbanteCart Community
AbanteCart Development => Customization help => Topic started by: Christo1045 on October 19, 2017, 02:27:12 AM
-
Hi Guys
I've added a dropdown list on the Confirm page at /storefront/view/default/template/pages/checkout/confirm.tlp for the user to select the Sales Rep they usually deal with.
Code:
<div class="col-md-3 well" style="margin-left: 15px">
<h4>Who do you deal with?</h4>
<select required>
<option value="">Choose Sales Rep</option>
<option value="Rep1">Rep1</option>
<option value="Rep2">Rep2</option>
<option value="Rep3">Rep3</option>
<option value="Rep4">Rep4</option>
</select>
</div>
Questions:
1.) How to save this with my order, show on my invoice etc?
2.) Which table to add fields to?
3.) Which files to add code to?
I'll look into creating an extension later on as I'm currently restricted with budget and time.
Any help to point me in the right direction would be appreciated.
Thanks
Chris
-
Hello.
Check this extension https://marketplace.abantecart.com/order-attributes
-
I know about the extension, but prefer not to use it due to budget constraints...
Any other help?
-
Okay, so I bought the extension but have an issue. I'm using a select (dropdown) and it's set to required, leaving the first option as empty so the user should make a selection. Any RegEx I try either let's the user proceed or not at all. I need a solution, correct RegEx to not accept blank values.
-
What is the RegEx that you use?
-
I tried /.*\S.*/ and a few others, but nothing works. The normal select fields in AbanteCart has a Placeholder attribute that can be set, but not in this extension. I need the user to choose an option and not leave it black, nor use the default.
-
No Suggestions yet guys?
-
Hello.
There are a lot tools in the internet to create or test regex or even libraries http://www.regexlib.com
-
Okay, so this is why this extension does not work 100%.
It allows an Element to be blank, but assigns a value to it, so therefore, your selection will always have a value to it.
<select name="attributes[10]" class="form-control " id="attributes10" data-placeholder=""> <-- Where do I set this in the Extension?
<option value="101"></option> <-- How can I set this to "selected disabled"
<option value="102">Sales Rep 1</option>
<option value="103">Sales Rep 2</option>
<option value="104">Sales Rep 3</option>
<option value="105">Sales Rep 4</option>
<option value="106">Sales Rep 5</option>
<option value="107">Sales Rep 6</option>
<option value="108">Sales Rep 7</option>
<option value="109">Sales Rep 8</option>
<option value="110">Sales Rep 9</option>
<option value="111">Sales Rep 10</option>
<option value="112">Not applicable</option>
</select>
Regards
Chris
-
So I've managed to get this working in a way.
Inspecting the Element (MS Edge), find the value attached to the blank option:
<select name="attributes[10]" class="form-control " id="attributes10" data-placeholder="">
<option value="111">-- Choose a Rep --</option> <!--- Here we are, value = 111 -->
<option value="115">Not applicable</option>
<option value="101">Sales Rep 1</option>
<option value="102">Sales Rep 2</option>
<option value="103">Sales Rep 3</option>
<option value="104">Sales Rep 4</option>
<option value="105">Sales Rep 5</option>
<option value="106">Sales Rep 6</option>
<option value="107">Sales Rep 7</option>
<option value="108">Sales Rep 8</option>
<option value="109">Sales Rep 9</option>
<option value="110">Sales Rep 10</option>
</select>
Set the RegEx to /^((?!111).)*$/
So you can select any other value except 111.
Hope this helps someone else.
Regards
Chris
-
Thank you, Christo1045