Search

Hey Guys, what the best option to use items and sub items in a section.

For example: I have an order with multiple items on it?

Whats the best way to do that using Symphony?

Cheers. Andre.

I did this with the Dynamic Text Group extension, and I was also using the Shopping Cart extension. You just have to POST the data with the right field names (i.e. getting the [] parts right).

This won't result in linked entries in the backend, but I made sure to save the product IDs ("instance" IDs in my case) along with each DTG row in case this relationship is needed in future.

Here's some code from my custom event which might help with getting started.

        // Map data to $_POST

        foreach($_SESSION['sym-cart'] as $instance_id => $instance) {

            // ...

            $_POST['fields']['items']['instance-id'][] = $instance_id;
            $_POST['fields']['items']['quantity'][] = $instance['num'];
            $_POST['fields']['items']['item'][] = "$instance_code - $product_brand $product_name $instance_name";
            $_POST['fields']['items']['price'][] = number_format($instance['sum'] / $instance['num'], 2, '.', '');
            $_POST['fields']['items']['line-total'][] = number_format($instance['sum'], 2, '.', '');
            $total += $instance['sum'];

        }

        $_POST['fields']['total'] = number_format($total, 2, '.', '');

        include(TOOLKIT . '/events/event.section.php');
        return $result;

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details