$msgCommande .= implode("\n", $discountsDescription); $msgCommande .= "\n"; } $msg = array(); $msg['COMMANDE'] = $msgCommande; $msg['NUM_COMMANDE'] = $commande->getVar('cmd_id'); $msg['NOM'] = $commande->getVar('cmd_lastname'); $msg['PRENOM'] = $commande->getVar('cmd_firstname'); $msg['ADRESSE'] = $commande->getVar('cmd_adress', 'n'); $msg['CP'] = $commande->getVar('cmd_zip'); $msg['VILLE'] = $commande->getVar('cmd_town'); $msg['PAYS'] = $countries[$commande->getVar('cmd_country')]; $msg['TELEPHONE'] = $commande->getVar('cmd_telephone'); $msg['EMAIL'] = $commande->getVar('cmd_email'); $msg['URL_BILL'] = OLEDRION_URL . 'invoice.php?id=' . $commande->getVar('cmd_id') . '&pass='******'IP'] = oledrion_utils::IP(); if ($commande->getVar('cmd_bill') == 1) { $msg['FACTURE'] = _YES; } else { $msg['FACTURE'] = _NO; } // Envoi du mail au client oledrion_utils::sendEmailFromTpl('command_client.tpl', $commande->getVar('cmd_email'), sprintf(_OLEDRION_THANKYOU_CMD, $xoopsConfig['sitename']), $msg); // Envoi du mail au groupe de personne devant recevoir le mail oledrion_utils::sendEmailFromTpl('command_shop.tpl', oledrion_utils::getEmailsFromGroup(oledrion_utils::getModuleOption('grp_sold')), _OLEDRION_NEW_COMMAND, $msg); // Présentation du formulaire pour envoi à la passerelle de paiement // Présentation finale avec panier en variables cachées ****************************** $registry = new oledrion_registryfile(); $text = $registry->getfile(OLEDRION_TEXTFILE7); $xoopsTpl->assign('text', xoops_trim($text)); if (oledrion_utils::getModuleOption('offline_payment') == 1 && isset($_POST['offline_payment']) && intval($_POST['offline_payment']) == 0 || $commandAmountTTC == 0) {
} } if ($product->getVar('product_online') && $product->getVar('product_stock') > 0) { // Set parameter $password = md5(xoops_makepass()); $passwordCancel = md5(xoops_makepass()); $uid = oledrion_utils::getCurrentUserID(); $cmd_total = $product_price; $cmd_shipping = 0; // Save command $commande = $h_oledrion_commands->create(true); $commande->setVar('cmd_uid', $uid); $commande->setVar('cmd_date', date("Y-m-d")); $commande->setVar('cmd_create', time()); $commande->setVar('cmd_state', OLEDRION_STATE_NOINFORMATION); $commande->setVar('cmd_ip', oledrion_utils::IP()); $commande->setVar('cmd_lastname', $cmd_lastname); $commande->setVar('cmd_firstname', $cmd_firstname); $commande->setVar('cmd_adress', $cmd_adress); $commande->setVar('cmd_zip', $cmd_zip); $commande->setVar('cmd_town', $cmd_town); $commande->setVar('cmd_country', $cmd_country); $commande->setVar('cmd_telephone', $cmd_telephone); $commande->setVar('cmd_mobile', $cmd_mobile); $commande->setVar('cmd_email', $cmd_email); $commande->setVar('cmd_articles_count', 1); $commande->setVar('cmd_total', oledrion_utils::formatFloatForDB($cmd_total)); $commande->setVar('cmd_shipping', oledrion_utils::formatFloatForDB($cmd_shipping)); $commande->setVar('cmd_packing_price', $cmd_packing_price); $commande->setVar('cmd_bill', $cmd_bill); $commande->setVar('cmd_password', $password);
/** * Crée un vote pour un produit * * @param integer $vote_product_id L'identifiant du produit * @param integer $vote_uid L'identifiant de l'utilisateur * @param integer $vote_rating Le vote * @return le résultat de la création du vote */ function createRating($vote_product_id, $vote_uid, $vote_rating) { $product = $this->create(true); $product->setVar('vote_product_id', $vote_product_id); $product->setVar('vote_uid', $vote_uid); $product->setVar('vote_rating', $vote_rating); $product->setVar('vote_ratinghostname', oledrion_utils::IP()); $product->setVar('vote_ratingtimestamp', time()); return $this->insert($product); }