1
{exp:cartthrob:order_items order_id="1937" variable_prefix="items_"}
    $titlu_carte = '{items_title} ';       
    $gestiune_id = '{product_sku} ';
    $cantitate_carte = '{items_quantity}';
   $pret_numeric_carte = '{items_price_numeric}';           
{/exp:cartthrob:order_items}

echo $titlu_carte;
echo $gestiune_id;
echo $cantitate_carte;
echo $pret_numeric_carte;

Result:

TITLE1 012L000001 2 12 TITLE1 ( again ? why not the next title? ) 2 12

Why is it giving me the same book and not the next one in the entry?

1 Answer 1

1

I don't think it would be good practice to output data with PHP while you can do the same with tags. In your code, you are outputting the PHP variables out of {exp:cartthrob:order_items} which is looping. PHP variables within the paired tag loop will store only the last tag values which will be outputted.

So either prepare your PHP variable (within) loop by concatenating or output within the loop.

1
  • I got solved wilth multidimensional arrays in Php
    – Klauss
    Sep 19, 2013 at 19:21

Your Answer

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

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