Exemplo n.º 1
0
 /**
  * Check Stock Alert and email information
  *
  * @param object $product 
  * @return boolean
  */
 function verifyLowStock(&$product)
 {
     if ($this->isAlertStockReached($product)) {
         $msg = array();
         $msg['PRODUCT_NAME'] = $product->getVar('product_title');
         $msg['ACTUAL_QUANTITY'] = $product->getVar('product_stock');
         $msg['ALERT_QUANTITY'] = $product->getVar('product_alert_stock');
         $msg['PUBLIC_URL'] = $product->getLink();
         $msg['ADMIN_URL'] = MYSHOP_URL . 'admin/index.php?op=editproduct&id=' . $product->getVar('product_id');
         myshop_utils::sendEmailFromTpl('shop_lowstock.tpl', myshop_utils::getEmailsFromGroup(myshop_utils::getModuleOption('stock_alert_email')), _MYSHOP_STOCK_ALERT, $msg);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 2
0
 /**
  * Informe le propriétaire du site qu'une commande à échoué (le paiement)
  *
  * @param object $order La commande en question
  * @return void
  */
 function notifyOrderCanceled(myshop_commands $order)
 {
     $msg = array();
     $msg['NUM_COMMANDE'] = $order->getVar('cmd_id');
     myshop_utils::sendEmailFromTpl('command_shop_cancel.tpl', myshop_utils::getEmailsFromGroup(myshop_utils::getModuleOption('grp_sold')), _MYSHOP_ORDER_CANCELED, $msg);
     myshop_utils::sendEmailFromTpl('command_client_cancel.tpl', $order->getVar('cmd_email'), _MYSHOP_ORDER_CANCELED, $msg);
 }
Exemplo n.º 3
0
 $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'] = MYSHOP_URL . 'invoice.php?id=' . $commande->getVar('cmd_id') . '&pass='******'IP'] = myshop_utils::IP();
 if ($commande->getVar('cmd_bill') == 1) {
     $msg['FACTURE'] = _YES;
 } else {
     $msg['FACTURE'] = _NO;
 }
 // Send mail to user
 myshop_utils::sendEmailFromTpl('command_client.tpl', $commande->getVar('cmd_email'), sprintf(_MYSHOP_THANKYOU_CMD, $xoopsConfig['sitename']), $msg);
 // Send mail to group admin
 myshop_utils::sendEmailFromTpl('command_shop.tpl', myshop_utils::getEmailsFromGroup(myshop_utils::getModuleOption('grp_sold')), _MYSHOP_NEW_COMMAND, $msg);
 // Display form to send to Paypal
 // Display final caddy with hidden values
 if (myshop_utils::getModuleOption('offline_payment') == 1 && isset($_POST['offline_payment']) && intval($_POST['offline_payment']) == 0 || $commandAmountTTC == 0 || xoops_trim(myshop_utils::getModuleOption('paypal_email')) == '') {
     $payURL = XOOPS_URL;
     $registry = new myshop_registryfile();
     $text = $registry->getfile(MYSHOP_TEXTFILE4);
     $xoopsTpl->assign('text', xoops_trim($text));
     $sform = new XoopsThemeForm(_MYSHOP_FINISH, 'payform', $payURL, 'post');
     $h_myshop_caddy->emptyCart();
 } else {
     $payURL = $paypal->getURL();
     $sform = new XoopsThemeForm(_MYSHOP_PAY_PAYPAL, 'payform', $payURL, 'post');
     $elements = array();
     $elements = $paypal->getFormContent($commande->getVar('cmd_id'), $commandAmountTTC, $commande->getVar('cmd_email'));
     foreach ($elements as $key => $value) {