0

the mod.cartthrob.php has the cart_items_info function.

On that function I have

    foreach ($data as &$row)
    {
        $row['cart_count'] = $count;
        $row['cart_total_results'] = $total_results;
        $row['first_row'] = ($count === 1) ? TRUE : FALSE;
        $row['last_row'] = ($count === $total_results) ? TRUE : FALSE;
        //added by me
        $row['conversion_rate'] = $this->EE->cartthrob->store->config('Cartthrob_stripe_settings')['stripe_conversion_rate'];

        $count++;
    }

But the stripe_conversion_rate key was added by me in the file. I don't think this is the way, because I should not edit the core files. So in my case how can I add that key so in the html file to have access to conversion_rate:

{exp:cartthrob:cart_items_info}
  {conversion_rate}
   ..........
2

CartThrob does not allow you to modify any of its tag functions. In this case you're better off creating your own small plugin which returns the value of $this->EE->cartthrob->store->config('Cartthrob_stripe_settings')['stripe_conversion_rate'];.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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