Adding some vars to email

Home Forums General Help Adding some vars to email

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5287
    Sergslavomir
    Guest

    At start: thanks for great and simply plugin! Simply and clever solution.

    I trying to add some more variations to admin’s email when order is created.

    Can add vatiations in dp-cart.php like:


    $totalprice = $dpsc_total;
    $shipping = $dpsc_shipping_value;
    $paymentoption = __($payment_option, "dp-lang");

    I need to print products table. When i use $products in line:

    $array2 = array($billing_addreess, $order_id, $shipping_address, $invoice, $shop_name, $site_url, $transaction_log, $products);

    it’s display all information from base about this products, like this:

    a:2:{i:0;a:5:{s:2:”id”;s:3:”355″;s:4:”name”;s:5:”Test2″;s:5:”price”;d:1000;s:8:”quantity”;i:1;s:6:”weight”;s:4:”1500″;}i:1;a:5:{s:2:”id”;s:3:”362″;s:4:”name”;s:5:”Test3″;s:5:”price”;d:2000;s:8:”quantity”;i:1;s:6:”weight”;i:0;}}

    , but i need to print only some fields like ‘name’ and ‘quantity’.

    I’m a little stumped and need help. Can anyone help me with that problem?

    Thanks.

    #5288
    Sergslavomir
    Guest

    Resolving this problem by adding some code before $array2:


    $producttable = '';
    $dpsc_products = $_SESSION['dpsc_products'];
    $count = 1;
    foreach ($dpsc_products as $dpsc_product) {
    $producttable .= '
    ' . $dpsc_product['name'] . '
    ' . $dpsc_product['quantity'] . '
    ' . $dpsc_product['price'] . '
    ';
    $count++;
    }
    $producttable .= '';

    And after add vars in:


    $array1 = array('%baddress%', '%order%', '%saddress%', '%inv%', '%shop%', '%siteurl%','%order-log-transaction%', '%ptable%');
    $array2 = array($billing_addreess, $order_id, $shipping_address, $invoice, $shop_name, $site_url, $transaction_log, $productable);

    Hope this information will help someone who just want add simple product table in admin email.

    #5317
    wham
    Guest

    Thanks for posting this!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Adding some vars to email’ is closed to new replies.
© 2024 DukaPress. All rights reserved.
Design By Madoido.