Example #1
0
function fn_get_single_map_data($order_info, $auth = null)
{
    $data = array();
    $data["order_date"] = date('d-m-Y', $order_info['timestamp']);
    $data["email"] = $order_info['email'];
    $data["customer_name"] = $order_info['firstname'] . ' ' . $order_info['lastname'];
    $data["order_id"] = $order_info['order_id'];
    $products = $order_info['products'];
    $products_arr = array();
    $currencies = Registry::get('currencies');
    $currency = isset($order_info['secondary_currency']) ? $currencies[$order_info['secondary_currency']] : $currencies[CART_SECONDARY_CURRENCY];
    #modified by Hungryweb 12.10.2015
    //$data["currency_iso"] = $currency['currency_code'];
    $data["currency_iso"] = 'USD';
    foreach ($products as $product) {
        $product_id = is_array($product) ? $product['product_id'] : intval($product);
        $product_data = array();
        $product_data['url'] = fn_get_product_url($product_id);
        #modified by Hungryweb 12.10.2015
        //$product_data['name'] = fn_get_product_name($product_id,CART_LANGUAGE,false);
        $product_data['name'] = fn_specific_development_get_category($product['product_id']) . ' ' . fn_get_product_name($product_id, CART_LANGUAGE, false);
        $product_data['description'] = db_get_field("SELECT full_description FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $product_id, CART_LANGUAGE);
        if (isset($product_data['description'])) {
            $product_data['description'] = strip_tags(html_entity_decode($product_data['description'], ENT_NOQUOTES, 'UTF-8'));
        }
        $product_data['image'] = fn_get_product_image_url($product_id);
        $price = is_array($product) ? $product['base_price'] : fn_get_product_price($product_id, 1, $auth);
        $product_data['price'] = fn_format_rate_value($price, 'F', '2', '.', ',', $currency['coefficient']);
        $products_arr[$product_id] = $product_data;
    }
    $data['products'] = $products_arr;
    return $data;
}
Example #2
0
<?php

use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($mode == 'view' && !empty($_REQUEST['product_id']) && Registry::isExist('addons.yotpo.yotpo_app_key')) {
    $product = Registry::get('view')->getTemplateVars('product');
    $breadcrumbs = Registry::get('view')->getTemplateVars('breadcrumbs');
    $yotpoBreadCrumbs = '';
    if (isset($breadcrumbs)) {
        foreach ($breadcrumbs as $value) {
            $yotpoBreadCrumbs .= $value['title'] . ';';
        }
    }
    Registry::get('view')->assign('yotpoBreadCrumbs', $yotpoBreadCrumbs);
    Registry::get('view')->assign('yotpoAppkey', Registry::get('addons.yotpo.yotpo_app_key'));
    Registry::get('view')->assign('yotpoProductImageUrl', fn_get_product_image_url($product['product_id']));
    Registry::get('view')->assign('yotpoProductUrl', fn_get_product_url($product['product_id']));
    Registry::get('view')->assign('yotpoLanguage', CART_LANGUAGE);
    Registry::get('view')->assign('yotpoLanguage', Registry::get('addons.yotpo.yotpo_widget_language'));
}