title: Override Variable in Array - Smarty
body: <p>A slightly strange one, but I'm using an ecommerce platform called CS-Cart which uses smarty for it's templating language. It has a smarty debug console which allows me to see which variables the current page is using.</p>
  
  <p>For example, here is an array that is being used (I have shortened this for the example):</p>
  
  <pre><code> Appearance =&gt; Array (33)
    products_per_page =&gt; "10"
    admin_products_per_page =&gt; "10"
    admin_elements_per_page =&gt; "10"
    columns_in_products_list =&gt; "3"
    default_products_sorting =&gt; "price"
  </code></pre>
  
  <p>I would like to be able to assign a different value to <code>default_products_sorting =&gt; "price"</code>
  I plan to do this in the header of my document as it will be included in an IF statement whereby the variable is only changed if certain conditions are true.</p>
  
  <p>Is this even possible in smarty? (without the use of PHP) and if so any ideas on how this could be achieved? I've scoured Google but so far turned up a blank.</p>
  
  <p>Any help is much appreciated.</p>