Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 18 of 18

Thread: default shipping method

  1. #1
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default default shipping method

    We use checkout1 and wish to have a shipping option pre selected how can this be done?

    Thanks in advance.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  2. #2
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Can we change it to a drop down list?
    Or even have one of the radio buttons pre selected?

    Thanks in advance.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  3. #3
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Has no one done this?
    We just need one option as a default due to some customers making errors and causing odd errors in the orders.

    We have access to the source as well.
    Thanks.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  4. #4
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Still anyone?
    Bump
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  5. #5
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Add this to your checkout1 page :-

    Code:
    <script type="text/javascript">
            	if (document.getElementById("ShippingMethodID1")) {
            		document.getElementById("ShippingMethodID1").checked = true;
            	}
    </script>
    Courtesy of Rugster.


    TTFN

    BFG

  6. #6
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    This solution did not work.
    It looked like it would but no joy.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  7. #7
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Very strange - working perfectly here....

  8. #8
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    tried it on the checkout1 page and on the skin we use for the checkout page. No joy. Tried it on chrome and ie.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  9. #9
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Go to your checkout1 page - make sure you're logged in (or have submitted your address details to 'get shipping methods), then paste this into your address bar :-

    C#/VB.NET Code:
    javascript:void(document.getElementById("ShippingMethodID1").checked true
    You should see the first radio button for the shipping methods become checked.
    (Just tried it on your site & it works.....).



    TTFN

    BFG

  10. #10
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    The JavaScript injection works however the JavaScript on the page does not...
    Very odd...
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  11. #11
    mebrahimi is offline Junior Member
    Join Date
    Feb 2009
    Posts
    14

    Default

    make sure the element that's rendered on the page has its ID defined, and not just name.

  12. #12
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    We know the ID is defined as the JavaScript injection works fine. As well as this you can view the source on the page and see all ID's listed.

    For some reason the JavaScript doesn't seem to work when simply placed on the page.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  13. #13
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Where exactly are you pasting it mate - does it throw an error?
    Can you put it in place & let me have a look?


    TTFN

    BFG

  14. #14
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Pasting in your code
    C#/VB.NET Code:
    <script type="text/javascript">
                if (
    document.getElementById("ShippingMethodID1")) {
                    
    document.getElementById("ShippingMethodID1").checked true;
                }
    </script> 
    in the head of the template used only on checkout1

    I have been playing with the code on local and everytime i get it working (in the aspx file or the template) i cause another issue.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  15. #15
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Ahh - that might be your problem.
    If it's in the head - then it might be trying to run before the page has downloaded.
    i.e. before "ShippingMethodID1" actually exists.

    I put mine just before the closing </body> tag.


    TTFN

    BFG

  16. #16
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Still no joy
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  17. #17
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    any error message?

  18. #18
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    No just doesn't work. Nothing different happens.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience