Exemple #1
0
    $xoopsMailer->setBody(sprintf(__('A user has requested more information about the product %s. User message below.', 'shop'), $product->getVar('name')) . "\n---------------\n" . $message . "\n--------------\n" . __('Message sent with MiniShop', 'shop') . "\n" . ShopFunctions::get_url());
    $xoopsMailer->setToEmails($xoopsModuleConfig['email']);
    $xoopsMailer->setFromEmail($email);
    $xoopsMailer->setFromName($name);
    $xoopsMailer->setSubject(sprintf(__('Information request about product %s', 'shop'), $product->getVar('name')));
    if (!$xoopsMailer->send(true)) {
        redirect_header($url, 1, __('Message could not be delivered. Please try again.', 'shop'));
        die;
    }
    redirect_header(ShopFunctions::get_url(), 1, __('Your message has been sent successfully!', 'shop'));
} else {
    $xoopsOption['template_main'] = 'shop_contact.html';
    include 'header.php';
    $tf = new RMTimeFormatter(0, '%d%/%M%/%Y%');
    // Product data
    $xoopsTpl->assign('product', array('name' => $product->getVar('name'), 'description' => $product->getVar('description'), 'price' => sprintf(__('Price: <strong>%s</strong>', 'shop'), sprintf($xoopsModuleConfig['format'], number_format($product->getVar('price'), 2))), 'type' => $product->getVar('type'), 'stock' => $product->getVar('available'), 'image' => $product->getVar('image'), 'created' => sprintf(__('Since: <strong>%s</strong>', 'shop'), $tf->format($product->getVar('created'))), 'updated' => $product->getVar('modified') > 0 ? sprintf(__("Updated: <strong>%s</strong>", 'shop'), $tf->format($product->getVar('modified'))) : '', 'link' => $product->permalink(), 'metas' => $product->get_meta(), 'images' => $product->get_images()));
    $categories = array();
    ShopFunctions::categos_list($categories);
    array_walk($categories, 'shop_dashed');
    $xoopsTpl->assign('categories_list', $categories);
    $xoopsTpl->assign('lang_selcat', __('Select category...', 'shop'));
    $xoopsTpl->assign('xoops_pagetitle', sprintf(__('Requesting information about %s', 'shop'), $product->getVar('name')) . ' &raquo; ' . $xoopsModuleConfig['modtitle']);
    $xoopsTpl->assign('lang_requesting_info', sprintf(__('Request Information for %s', 'shop'), $product->getVar('name')));
    $xoopsTpl->assign('lang_yname', __('Your Name:', 'shop'));
    $xoopsTpl->assign('lang_ymail', __('Your Email:', 'shop'));
    $xoopsTpl->assign('lang_prod', __('Product:', 'shop'));
    $xoopsTpl->assign('lang_message', __('Message:', 'shop'));
    $xoopsTpl->assign('lang_send', __('Send Message', 'shop'));
    $xoopsTpl->assign('form_action', RMFunctions::current_url());
    if ($xoopsUser) {
        $xoopsTpl->assign('shop_name', $xoopsUser->name());