Hi,
I am attempting to find a way of passing a number to our shipping courier with each order depending on the shipping class a customer chooses. I have been thinking about the problem and decided the simplest way of solving it would be to pass this number to our courier in an unused field like the fax number text field (which would be hidden from the customer). This can then be sent to our courier via Mole Ends One Stop Order Processing order export.
So what I am attempting to do is via a piece of javascript pass the value of the shipping option to this fax text field. What I could do with a hand with is getting each shipping class to have a unique value which corresponds to our courier companies shipping code. Therefore instead of our standard service having an option value of 10 I need it to have a value of 212.
To do this I thought the easiest way would be to manually change the option value and I go into how this was attempted below. However if someone reads this and can think of a better method then I’m all ears. My other thoughts were to write a piece javascript which would look at the value of the currently selected option and then assign the correct value to the fax field, but this seemed a bit long winded.
What I did:
I am attempting to change each shipping classes value. By the value i mean the value set within the form on our site which corresponds to that class.
i.e
At present we have a couple of UK classes which look like below in the source code:
<SELECT ID='lstClass' NAME='ShippingClass'>
<OPTION Value='10'>Standard 1-3 days (£3.95)
<OPTION SELECTED Value='12'>Next Working Day (£5.95)
<OPTION Value='23'>Next Day pre 9.30am (£13.95)
<OPTION Value='22'>Saturday Delivery (£19.95)
</SELECT>
however i need to change there values to ones which would correspond to a shipping service code provided by our courier Interlink express. Therefore i want the above source code to look like this:
<SELECT ID='lstClass' NAME='ShippingClass'>
<OPTION Value='210'>Standard 1-3 days (£3.95)
<OPTION SELECTED Value='212'>Next Working Day (£5.95)
<OPTION Value='234'>Next Day pre 9.30am (£13.95)
<OPTION Value='16'>Saturday Delivery (£19.95)
</SELECT>
Within the ShipControl folder located in our site root folder there is a file called SimpleShipping.mdb and when opened in Access there is a table named Classes. After opening this I found that I could see the ClassID column the values of which correspond to the option values pasted in the first piece of source code above. The ClassID column is defined as an ‘autonumber’ field so I changed this to a number field so that I could manually edit the values for the shipping classes. I realise this will cause problems but I figured as long as I set up all my shipping classes now then I won’t need to add any more so it should be ok.
Once I had changed these values to correspond with the values in the second piece of source code above I uploaded the site and found a number of problems.
Firstly none of the value fields for the classes on the site have been changed ( i.e the standard 1-3 day service still reads like <OPTION Value='10'> not <OPTION Value='210'> as I wanted). Also none of the class names appear any longer (i.e Standard 1-3 days (£3.95) is now just displayed as (£3.95)). This obviously wasn’t the way to do this….
All the names of the classes have also disappeared from view/business settings/Shipping and Handling but they actually function correctly on the site, by this I mean the prices still changes for each class depending on the weight you just have no idea what service you are selecting as you only see the price. It seems therefore that the ClassID field within SimpleShipping.mdb is only used to reference the name and description of a shipping class and assign it on the site.
What I really need to know for this to work is what I need to update to be able to define my own values for all our shipping classes. If I then have to mirror these changes in the SimpleShipping.mdb file to get the names to display on the site that’s fine.
This is of course unless someone knows of a much better way of doing this.
I am attempting to find a way of passing a number to our shipping courier with each order depending on the shipping class a customer chooses. I have been thinking about the problem and decided the simplest way of solving it would be to pass this number to our courier in an unused field like the fax number text field (which would be hidden from the customer). This can then be sent to our courier via Mole Ends One Stop Order Processing order export.
So what I am attempting to do is via a piece of javascript pass the value of the shipping option to this fax text field. What I could do with a hand with is getting each shipping class to have a unique value which corresponds to our courier companies shipping code. Therefore instead of our standard service having an option value of 10 I need it to have a value of 212.
To do this I thought the easiest way would be to manually change the option value and I go into how this was attempted below. However if someone reads this and can think of a better method then I’m all ears. My other thoughts were to write a piece javascript which would look at the value of the currently selected option and then assign the correct value to the fax field, but this seemed a bit long winded.
What I did:
I am attempting to change each shipping classes value. By the value i mean the value set within the form on our site which corresponds to that class.
i.e
At present we have a couple of UK classes which look like below in the source code:
<SELECT ID='lstClass' NAME='ShippingClass'>
<OPTION Value='10'>Standard 1-3 days (£3.95)
<OPTION SELECTED Value='12'>Next Working Day (£5.95)
<OPTION Value='23'>Next Day pre 9.30am (£13.95)
<OPTION Value='22'>Saturday Delivery (£19.95)
</SELECT>
however i need to change there values to ones which would correspond to a shipping service code provided by our courier Interlink express. Therefore i want the above source code to look like this:
<SELECT ID='lstClass' NAME='ShippingClass'>
<OPTION Value='210'>Standard 1-3 days (£3.95)
<OPTION SELECTED Value='212'>Next Working Day (£5.95)
<OPTION Value='234'>Next Day pre 9.30am (£13.95)
<OPTION Value='16'>Saturday Delivery (£19.95)
</SELECT>
Within the ShipControl folder located in our site root folder there is a file called SimpleShipping.mdb and when opened in Access there is a table named Classes. After opening this I found that I could see the ClassID column the values of which correspond to the option values pasted in the first piece of source code above. The ClassID column is defined as an ‘autonumber’ field so I changed this to a number field so that I could manually edit the values for the shipping classes. I realise this will cause problems but I figured as long as I set up all my shipping classes now then I won’t need to add any more so it should be ok.
Once I had changed these values to correspond with the values in the second piece of source code above I uploaded the site and found a number of problems.
Firstly none of the value fields for the classes on the site have been changed ( i.e the standard 1-3 day service still reads like <OPTION Value='10'> not <OPTION Value='210'> as I wanted). Also none of the class names appear any longer (i.e Standard 1-3 days (£3.95) is now just displayed as (£3.95)). This obviously wasn’t the way to do this….
All the names of the classes have also disappeared from view/business settings/Shipping and Handling but they actually function correctly on the site, by this I mean the prices still changes for each class depending on the weight you just have no idea what service you are selecting as you only see the price. It seems therefore that the ClassID field within SimpleShipping.mdb is only used to reference the name and description of a shipping class and assign it on the site.
What I really need to know for this to work is what I need to update to be able to define my own values for all our shipping classes. If I then have to mirror these changes in the SimpleShipping.mdb file to get the names to display on the site that’s fine.
This is of course unless someone knows of a much better way of doing this.
Comment