0

We have a few different shipping options set up on the site, but in the admin area when editing the shipping for a particular order just a free text field is provided rather than a drop down of the shipping options.

Is it possible to change this to a drop down - so that its easier to control the values entered in that field?

Additionally - changes to shipping made in the admin don't update the shipping data available via the order tag. So any 'order dispatched' emails still show the shipping details made at checkout - rather than those updated by the admin.

Is there a way to show the final shipping option in the emails?

Thanks!

0

First thing: Admin Area

What you need is an accessory. You'll have to write one yourself. I can throw some pseudocode at you for the logic.

https://ellislab.com/expressionengine/user-guide/development/accessories.html

Example:

function set_sections()
{
    /*
    Here we do a few things

    First, I would recommend checking if we are on the admin page for
    Expresso store. I don't know the plugin, so I don't know it's module URLs or whatever.

    https://ellislab.com/expressionengine/user-guide/development/module_tutorial.html#the-control-panel-file-mcp-download-php

    You'd want something like:

    */   
    if (ee()->input->get('method') != 'expresso_store')
    {
        // bail, we aren't even looking at an Expresso Store CP page
        return false;
    }

    /*
    Then, if we aren't bailed, let's insert some jQuery to modify that input
    */

    ee()->cp->add_to_foot('
        <script>
        $(document).ready(function(){

           /* 
           jQuery here to replace the input you're concerned about.
           Replace it with a <select> tag with your controlled <option>s.
           */

        });
        </script>
    ');
}

Second thing: Edited via-admin shipping options not showing up via order tag

I have no idea. But let's start with the basics... do you have any caching in place? This data is obviously stored in a database table. After you change a shipping option via the CP, can you reload the same CP page and verify the changes? Also, can you whip a database tool and investigate the Expresso Store DB tables and look at what gets changed to the order when you edit it via the CP? Sorry for asking so many questions, I don't have this addon to play with.

| improve this answer | |
  • Thanks Jrothafer - I'll have a play with your suggestions and let you know how I get on. – Tomtids Sep 23 '15 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.