Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8029751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:31:52+00:00 2026-06-05T00:31:52+00:00

A slightly strange one, but I’m using an ecommerce platform called CS-Cart which uses

  • 0

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.

For example, here is an array that is being used (I have shortened this for the example):

 Appearance => Array (33)
  products_per_page => "10"
  admin_products_per_page => "10"
  admin_elements_per_page => "10"
  columns_in_products_list => "3"
  default_products_sorting => "price"

I would like to be able to assign a different value to default_products_sorting => "price"
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.

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.

Any help is much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:31:54+00:00Added an answer on June 5, 2026 at 12:31 am

    You can change the variable like this

    {$Appearance.default_products_sorting = "NEW_VALUE"}
    

    And after this line, if you use {$Appearance.default_products_sorting} you should get the new value.

    I just checked and it worked.

    You should change it at the top of your smarty template, so that any code that is using this variable get the updated value.

    Looks like the above method doesn’t work for arrays. You can consider using the custom function from this link http://www.smarty.net/forums/viewtopic.php?t=7201&highlight=create+array

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

slightly strange request, but does anybody know of any cool jquery plugin that changes
This is a slightly weird one. I'm iterating through quite a large database, using
Slightly strange question, but hopefully someone can help. In essence, if the time was
I'm using a slightly modified ImageAndTextCell from one of Apple's tutorials in a custom
Slightly daft, but... Is there a way to prevent Visual Studio treating a .jpg
I slightly remember that there is an class which is capable of stretching an
This is a slightly weird setup, and I'm planning on redoing it, but, if
I've got a bit of a strange one for you (so to speak). I've
I am working on a website at the moment which is displaying a strange
I am experiencing a very strange issue with custom conflict handling using the Sync

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.