1

i am working on a shop that uses smarty tag. I want to do following sql query:

{php}
    $sql = "SELECT intraship_shipmentnumber FROM orders WHERE orders_id = {$ORDER_NUMBER} ";
{/php}

when i insert a static order number the sql query works, but it does not work with the smarty tag and i poorly have no idea how to insert it so it works.

2 Answers 2

1

I already found a solution myself. Here it is for anyone who is interested:

First you assign a variable via Smarty:

{assign var=test value=$ORDER_NUMBER}

Then you can put this in a PHP Variable which you can use:

$order = $this->get_template_vars('test');
Sign up to request clarification or add additional context in comments.

Comments

0

I am not an Smarty expert. But could you try:

{php}
    $sql = "SELECT intraship_shipmentnumber FROM orders WHERE orders_id = {/php}{$ORDER_NUMBER}{php} ";
{/php}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.